I'm using pdfbox pdfbox-2.0.22 but also tried in pdfbox-3.0.0-RC1. So I have this strange behavior.
With this code:
documentoIn = PDDocument.load(file);
documentoOut = new PDDocument();
for (PDPage page : documentoIn.getPages() )
{
documentoOut.addPage(page);
}
In most cases it works ok, but with pdfs with one page with dimensions 209,9x296,7mm the resulting page has size +-Letter (215,9x279,4mm) and it's cropped. And this happens to several pdfs with this size.
With other sizes and, even more fun, with a pdf with the 209,9x296,7 page duplicated the resulting pages are ok.
Didn't check where the pdfs came from, but then can came all from the same scanning machine which should produce A4 pages, but misses by a few milimiters.
Any thoughts?
Thanks, Cláudio