The page should when the text ends. So, that there is only one "page". Don't worry. It's not for being printed.


% Packages
paperwidth=1052px, paperheight=2250 px]{geometry} % max 15800 long


This is for a board. You can upload pictures (yes, I can convert to pictures) and there is a perfect format (e.g. 1052px).

  • It is very important that the units are in pixel.

  • Advices for a better/easier font(-size) are appreciated but not needed (Font is unbelievable big as a cause of using px as unit).

I found this one Is there a way to make "page" size match document length? but I does not help. Pls don't hate me.


1 Answer 1


The following example puts the page contents in a box, measures the box and ship outs a page with the corrected dimensions for the height of the page. The example assumes pdfTeX or LuaTeX. Here \pdf(h,v)origin and \pdfpage(height,width) are available to set the dimensions of the output page.

% arara: pdflatex


  \edef\PageHeightPt{\strip@pt\pdfpageheight pt}%
      % scaling operation with doubled precision
  \typeout{=> Page height = \PageHeightPt\space = \PageHeightPx}%

  \ifdim\pdfpageheight>15800px %
    \errmessage{Page height is too large!}%

\addtolength{\textwidth}{-200px}% 2 * 100px


  \begingroup % for color support
  \addtolength{\paperheight}{100px}% 2 * 50px


Reported page height:

=> Page height = 2518.68092pt = 2509.26201px
  • Is there a way of knowing the actual page height? Or restrict the pageheight to 15800px? Mar 25, 2016 at 19:17
  • 1
    @JoelDuscha I have updated the answer, it prints the page height in pt and px. Also the height is checked and an error is thrown, if the page height is too large. Mar 25, 2016 at 19:59

You must log in to answer this question.

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