Width and Height is smaller by creation from file

Product: Nodejs @pdftron/pdfnet-node
Product Version: “@pdftron/pdfnet-node”: “^9.0.0-2”,

I create the a PDF from file and try to read the width and height of the first page.
The Size is smaller than the original file. Why?

Of course I can scale it, but I don’t know how much it should be scaled.

How to read a PDF-file with original dimensions. Thx.

const pdfDoc = await PDFNet.PDFDoc.createFromFilePath('some.pdf');
const pdfPage = await pdfDoc.getPage(1);
const pdfPageBox = await pdfPage.getCropBox();
console.log('pdfPageBox', pdfPageBox);

Hello,

From the code you are using, you are extracting the values of the CropBox, which is defined to be the region to which the contents of the page shall be cropped when displayed and printed. In other words, it is the width and height of the visible content regions of the page.

You mentioned that the size is smaller than the original file. How are you measuring the original file in this case?

I measure with a rule in the Acrobat Reader, but i get the size 33% smaller, then original file


The question is, how do i get the original size?
Now i scale the size to 1.333 before convert to SVG.

Hello,

You can check the dimensions of the file by right clicking the properties of the and looking at the page size. for example, see the following page (Note that 1 inch is 72 points in a PDF. You can use this to scale accordingly):

You mentioned that you are converting this file to SVG. Are you doing this through the PDFTron SDK?

Hi,
i know this properties, after converting i get the size smaller, it is about 33,33% smaller as original
I use pdftron API for nodejs, here is a link to example:

Could you please provide us with the input example file, along with the settings you have used to convert the PDF to SVG?

Thank you in advance.

Example:
fgb-08-13_90x70.pdf (812.2 KB)
Code:

const pdfDoc = await PDFNet.PDFDoc.createFromFilePath('path_to_pdf');
const pdfPage = await pdfDoc.getPage(1);
   // pdfPage.scale(1.333);
const pdfPageMediaBox = await pdfPage.getMediaBox();
console.log('pdfPageMediaBox', pdfPageMediaBox);

the variable pdfPageMediaBox shows the smaller size in the log , if I do not scale it. Try to scale and without