Java printing existing pdf with right scaling
<p>I'm trying to print an existing PDF.</p>

<p>I already tried this: <a href="https://stackoverflow.com/questions/35479613/java-pdfbox-printerjob-wrong-scaling-page-format">java pdfbox printerjob wrong scaling / page format</a></p>

<p>PDFBox is not working for me, because I can't get the right scaling of my PDF.
<code>Scaling.SHRINK_TO_FIT</code> is almost working but it's missing about 5mm and I can't add them because <code>paper.setImageableArea</code> is resetting it.</p>

<p>Also I tried to use <code>new Paper();</code> with own margins and without <code>setSize</code>, because I can't get the size of an DIN A4 paper. The problem with the margins is, if I'm getting the correct top &amp; left size and then try to set the height and width then it's destroying the top &amp; left position.</p>

<p>Now I'm looking for a free and simple solution without PDFBox to print a pdf file without losing the quality and the scaling.</p>