Page 1 of 1
PdfProperties
Posted: Tue May 13, 2025 2:49 am
by joaodaffonsojr
Hello!
I was trying to use this script to get box values in mm and noticed that cropbox and artbox have the same values.
But not in PDF! Here is an example of a PDF file in Pitstop Pro

- pitstop_mm.png (31.41 KiB) Viewed 28122 times
and also the values in Switch using the PdfProperties example script.

- switch_pdfproperties.png (62.19 KiB) Viewed 28122 times
What could I be doing wrong?
Thanks in advance
Re: PdfProperties
Posted: Wed May 14, 2025 2:41 pm
by mkayyyy
I've just had a debug through the
PdfProperties script with a blank PDF I made matching the values of the screenshot and I get the same result as you with the artBox and cropBox values being the same.
I don't think this is something you or the script is doing wrong. When I was debugging it looks like the calls getCropBoxWidth and getArtBoxWidth / getCropBoxHeight and getArtBoxHeight return the same values 637.7956999999999 and 892.9134.
Unless I'm missing something obviously wrong with the PDF I made (Blank PDF made with Enfocus Create Document through PitStop Pro) it looks like an issue with how the Switch Scripting Engine is parsing this PDF
Link to the PDF I made to test with if anybody else has any other thoughts:
https://www.dropbox.com/scl/fi/t8y7z10p ... jiz7m&dl=0
Re: PdfProperties
Posted: Wed May 14, 2025 3:32 pm
by freddyp
Thanks for reporting this. It does indeed seem like it is a bug in the PdfPage class. I logged it.
Art boxes are not used very often, so I hope you do not suffer from this. If it is important to you and you have PitStop Server then I suggest to use the FastLane app:
https://www0.enfocus.com/en/appstore/product/fastlane
Re: PdfProperties
Posted: Thu May 15, 2025 5:23 pm
by joaodaffonsojr
Hi Freddy,
I can't use fastlane for this project, because I need to read the artbox variable from 2 different datasets and do a calculation to see if the values are within a range.
I'll switch to bleedbox for now until this is resolved.
Thanks!
And thanks Mark for helping me too!
Re: PdfProperties
Posted: Thu May 15, 2025 7:11 pm
by jan_suhr
Do you have callas pdfToolbox?
Re: PdfProperties
Posted: Thu May 15, 2025 8:18 pm
by joaodaffonsojr
jan_suhr wrote: ↑Thu May 15, 2025 7:11 pm
Do you have callas pdfToolbox?
No !
But can callas read 2 different datasets in the same pdf ?
Re: PdfProperties
Posted: Thu May 15, 2025 9:00 pm
by jan_suhr
You can script everything in pdfToolbox so it can handle it. From Switch you transfer your values from the datasets to variables that pdfToolbox can use.
Re: PdfProperties
Posted: Fri May 16, 2025 10:22 am
by tdeschampsBluewest
joaodaffonsojr wrote: ↑Thu May 15, 2025 8:18 pm
jan_suhr wrote: ↑Thu May 15, 2025 7:11 pm
Do you have callas pdfToolbox?
No !
But can callas read 2 different datasets in the same pdf ?
I don't understand the problem here, you can pick value from two dataset and make calculation from them in switch, so what's blocking you with fastlane?
Re: PdfProperties
Posted: Sun May 18, 2025 3:34 pm
by joaodaffonsojr
tdeschampsBluewest wrote: ↑Fri May 16, 2025 10:22 am
joaodaffonsojr wrote: ↑Thu May 15, 2025 8:18 pm
jan_suhr wrote: ↑Thu May 15, 2025 7:11 pm
Do you have callas pdfToolbox?
No !
But can callas read 2 different datasets in the same pdf ?
I don't understand the problem here, you can pick value from two dataset and make calculation from them in switch, so what's blocking you with fastlane?
Problem is that looks like a bug in the PdfPage class, as Freddy said.
The cropbox and artbox have the same values.
So script gets the wrong info, nothing related to Pitstop or Fastlane.