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}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
kvaleev
  • 449

1 Answers1

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}
Ulrike Fischer
  • 327,261
  • 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 — http://tex.stackexchange.com/questions/1162/included-png-appears-blurry-in-pdf). Can I do same thing with xelatex? – kvaleev Apr 28 '14 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. – Ulrike Fischer Apr 29 '14 at 06:51