What is --hires for?

To obtain a better result when cropping a pdf image produced by PSTricks, I use --hires option as follows

latex filename.tex
dvips filename.dvi
ps2pdf -sOutputFile=filename-temp.pdf filename.ps
pdfcrop --hires filename-temp.pdf filename.pdf

According to pdfcrop --help shown in the following screenshot, the --hires make pdfcrop use high resolution bounding box (instead of the usual bounding box) to crop a pdf input.

enter image description here

Scenario & Problem

I am writing a book that use PDF, PNG, JPEG images and PSTricks codes. Actually xelatex can help me to compile the input file. Unfortunately, xelatex runs very very very slowly. The very bad performance makes me reluctant to use xelatex.

The next candidates are pdflatex (and context but I am not familiar with it). Behind the scene, pdflatex with auto-pst-pdf package compiles each PSTrick code, converts it to PDF, crops the surrounding white space of the PDF image, and finally includes all the resulting PDF images to produce a complete document. In this process, there is a temporary PDF file that contains a bunch of the cropped PDF images in the working directory. Unfortunately, the bounding box is not so accurate. If we see each cropped image carefully, we will notice that the left, right, top, and bottom margins are not exactly the same. Therefore, I need to pass --hires to pdfcrop, but I don't know how to do this.

The following code snippet might be needed for a test.

Don't forget to use -shell-escape or --enable-write18 when invoking pdflatex.

\usepackage{auto-pst-pdf}% I need pass --hires, but how ?

\caption{\label{fig:circle}This is a circle.}



Is it possible to force auto-pst-pdf to use --hires option when it internally invokes pdfcrop?

1 Answer 1

  • @xport: that's a typo, I meant ps2pdf. pspdf is an own script.
    – user2478
    Jun 13, 2011 at 11:55
  • 1
    @xport: ah, sure. Totally forget, that the keywords can't contain a digit in their names.
    – user2478
    Jun 13, 2011 at 12:17
  • -dAutoRotatePages=/None is mandatory? If I ignore it, what is the problem? Jul 2, 2011 at 23:54
  • 1
    When using ghostscript it can be sometimes too clever and rotates an images itself where it shouldn't be rotated
    – user2478
    Jul 3, 2011 at 7:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .