Smokes your problems, coughs fresh air.

Tag: pdf

Malware in PDFCreator

On one of our computers, some websites behaved very weird; pages could not be found and they were redirected to mybrowserbar.com. I found this on Wikipedia about PDFCreator:

Starting with version 0.9.7 (February 2009), PDFCreator has included a new toolbar application that is considered by many to be malicious software. The end-user-license agreement for Pdfforge Toolbar by Spigot, Inc. (versions prior to 0.9.7 have a different, optional toolbar called “PDFCreator Toolbar”), states that the software will: modify your Microsoft Internet Explorer and/or Mozilla Firefox browser settings for the default search engine, address bar search, “DNS error” page, “404 error” page, and new tab page to facilitate more informative responses as determined by The Toolbar.

The opt out procedure is difficult, but possible:

The opt-out procedure during installation is confusing. There are two separate screens where the user must take action if they do not wish to install the toolbar, one of which is not clearly labeled. This confusing process leads many users to believe they have opted-out of the installation when they have not. Some users erroneously report that it is not possible to opt-out of the toolbar installation, which is not true. If one reads the instructions carefully and follows them, it IS possible to install PDFCreator without also installing the unwanted toolbar, even if the process is confusing.

I may want to consider another PDF printer.

ImageMagick can convert PDF to anything

I encountered one of those scans which was shared as a single-page PDF. I don’t want it that way, because I want to include it in a web page. I want a simple bitmap image. ImageMagick comes to the rescue:

convert scan.pdf scan.jpg

If the resolution this produces is too low for you, try telling Ghostscript (which ImageMagick uses internally) that you want a different density:

convert -density 300 scan.pdf scan.jpg

Attribution

Googling linux pdf to jpg produced two useful results:

  1. Batch converting PDF to JPG/JPEG using free software
  2. Converting PDF to PNG/JPG using ImageMagick in Linux

eps2eps to the rescue when epstopdf complains of no bounding box

PDFLaTeX doesn’t like encapsulated postscript images. If you want to use .eps files with pdflatex, you can convert these files to PDF using Sebastian Rahtz’ epstopdf, and then remove all .eps file extensions from the image locations in your .tex source files. Then, the latex command will look for .eps file and the pdflatex command will look for .pdf, .jpg and .png files.

The other moment, I tried to do just this. But, epstopdf complained about the lack of a bounding box in one of my EPS files. Indeed, the conversion finished but generated a huge white background with the actual image somewhere in the lower left corner. From the man-page:

epstopdf transforms the Encapsulated PostScript file so that it is guaranteed to start at the 0,0 coordinate, and it sets a page size exactly corresponding to the BoundingBox. This means that when Ghostscript renders it, the result needs no cropping, and the PDF MediaBox is correct. The result is piped to Ghostscript and a PDF version written.

If the bounding box is not right, of course, you have problems…

Luckily, while tab-completing from eps to epstopdf, I noticed the eps2eps utility. I though: What if this utility happens to sanitize the EPS file a bit? A quick look at the man page and a test run later, my hope was confirmed: epstopdf would now generate a nice PDF file without complaining.

The epstopdf manual page could be amended to: If the bounding box is not right, you might want to try to run eps2eps first.

© 2024 BigSmoke

Theme by Anders NorenUp ↑