1

I am trying to change the DPI of the output PDF using \pdfpxdimen in the preamble, but it returns an error:

"! Undefined control sequence \pdfpxdimen".

I guess that is because I am using XeLaTeX instead of pdfLaTeX. If it is so, is there any way to change the DPI using XeLaTeX?

Here is the MWE:

\documentclass[a4paper,11pt]{article}

\pdfpxdimen=1in % 1 DPI
\divide\pdfpxdimen by 96 % 96 DPI

\begin{document}
some text
\end{document}
1
  • 1
    Can't work: XeTeX doesn't know that primitive
    – Joseph Wright
    Commented Apr 28, 2014 at 14:39

1 Answer 1

2

Your code doesn't "change the dpi". You are only changing the value of the "px" unit. Try this with pdflatex to understand what's happening:

\documentclass[a4paper,12pt]{report}
\begin{document}

\pdfpxdimen=1in % 
a\hspace{1px}b 

\pdfpxdimen=2in % 
a\hspace{1px}b
\end{document}
2
  • Yeah, I see. But this px value changing has a side effect, that I need: increasing sharpness of included images (for example according to this — tex.stackexchange.com/questions/1162/…). Can I do same thing with xelatex?
    – kvaleev
    Commented Apr 28, 2014 at 15:50
  • Changing the size of an image can naturally increase the sharpness. But I doubt very much that you can get some additional improvements by using \pdfxdimen: imho it only helps with the calculation of a good size. Commented Apr 29, 2014 at 6:51

You must log in to answer this question.

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