0

My application let the user upload a PDF for printing. I want to know dynamically the recommended ISO page print size (i.e. A3, A2...)
One solution is with Apache PDFBox to take the page dimension and divide in 72 to get the inch size.

There is other way more accurate to do it, that also round dynamically the dimensions if needed? (i.e. if for example A4 is 8.3 x 11.7 in, what happened if the dimension is 9 x 12 in?)

There is rule of thumb for recommended rounding?

Eitan Rimon
  • 431
  • 6
  • 10
  • Possible duplicate : http://stackoverflow.com/questions/20904191/pdfbox-find-page-dimensions – c0der Mar 10 '17 at 06:38
  • no, it just the solution that i wrote above, i looking for more dedicated solution to measure the print size – Eitan Rimon Mar 10 '17 at 16:21
  • What do you mean by a *"more dedicated solution"*? – mkl Mar 12 '17 at 10:22
  • function that get the dimension and "fix it" (if needed) to recommended print size. example: user upload PDF 9*12 inch and the function recommended to print it in A4 format – Eitan Rimon Mar 12 '17 at 11:04
  • PDFBox does not contain a function to *recommend a print size*. Thus, you have to retrieve the actual size as you do (make sure you use the trim box, not the media box, an check whether the default user space unit has been redefined in a PDF) and implement a method doing such recommendations yourself. – mkl Mar 13 '17 at 11:34

0 Answers0