Tag PDF

Tag PDF RSS 2.0 Feed

Bootstrap responsive embed aspect ratio

Bootstrap responsive embed can be very helpful to show responsive PDF files or videos. But it supports only the aspect ration 16by9 and 4by3. But what about other aspect rations? For example 210by297 would be interesting to embed a A4 paper.

Continue reading

Ignore pause in LaTeX beamer with handout

When preparing my LaTeX slides with the beamer class for a presentation, I have used pretty often the pause command. This command splits a frame and hides the content under pause on the first frame. This is very helpful to give the audience step by step the content of a talk. But this can be very annoying when clicking throw the slides after the talk. There is a simple solution to ignore the pause commands.

Continue reading

PHPUnit compare generated PDF files with Imagick

Sometimes it is necessary to compare a generated PDF file with a given one in PHP. Just to check with one PHPUnit test that your PDF generation works the expected way. But pretty often generated PDF files are equal, but there content isn't the same. For example if you use FPDF the following assertion can fail if the files have different meta data.

$pdfContent1 = file_get_contents('path_to_pdf1');
$pdfContent2 = file_get_contents('path_to_pdf2');
$this->assertSame($pdfContent1, $pdfContent2);

Continue reading

Rotate every second page of a PDF file on Linux

A little bit special today, but I would like to show how to rotate every second page of every PDF file in a directory. This mostly happends if you scan a book for example and that looks something like this after scanning.

Continue reading