logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
DarkyUK  
#1 Posted : Tuesday, April 20, 2021 5:59:59 AM(UTC)
Quote
DarkyUK

Rank: Newbie

Groups: Registered
Joined: 4/20/2021(UTC)
Posts: 3
United Kingdom

Thanks: 1 times
Hi Guys,

Hope you are all well and keeping safe?

I'm after a bit of advise, I am sure this will be possible with PDFium but I cannot figure out how.....

We have a requirement to do some basic PreFlight checks on PDF files prior to printing, really simple things like making sure all required fonts are embedded and also that any images used in the PDF are over a certain resolution, for example 300dpi.

In the future we might want to enhance this to also check objects are not outside the printable border of the page, but thats another topic for another day.

Is there a way to list the font usage and fonts embedded in the pdf to do a comparison? Also can the images resolutions be access or would they need to be extracted first?

Thanks

Andy
Paul Rayman  
#2 Posted : Tuesday, April 20, 2021 4:09:22 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Hi,

You can try to enumerate all the objects on the page (here's an example: https://pdfium.patagames.com/help/html/WorkingSDK_PageObjects.htm ) and check the IsEmbedded flag of the Font property of the text object.
DarkyUK  
#3 Posted : Wednesday, April 21, 2021 3:26:43 AM(UTC)
Quote
DarkyUK

Rank: Newbie

Groups: Registered
Joined: 4/20/2021(UTC)
Posts: 3
United Kingdom

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
Hi,

You can try to enumerate all the objects on the page and check the IsEmbedded flag of the Font property of the text object.


Thanks Paul,

Is there a way to check the image resolution without extracting the image?

Cheers, Andy
Paul Rayman  
#4 Posted : Wednesday, April 21, 2021 4:13:30 AM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Originally Posted by: DarkyUK Go to Quoted Post
Is there a way to check the image resolution without extracting the image?


What is "Image Resolution"? You can get the size of the image in pixels.
Just list the page objects and read the corresponding property. Please follow the class diagram here.
https://pdfium.patagames...rkingSDK_PageObjects.htm
thanks 1 user thanked Paul Rayman for this useful post.
DarkyUK on 4/21/2021(UTC)
DarkyUK  
#5 Posted : Wednesday, April 21, 2021 4:16:32 AM(UTC)
Quote
DarkyUK

Rank: Newbie

Groups: Registered
Joined: 4/20/2021(UTC)
Posts: 3
United Kingdom

Thanks: 1 times
Originally Posted by: Paul Rayman Go to Quoted Post
Originally Posted by: DarkyUK Go to Quoted Post
Is there a way to check the image resolution without extracting the image?


What is "Image Resolution"? You can get the size of the image in pixels.
Just list the page objects and read the corresponding property. Please follow the class diagram here.


Thanks Paul, I think we can work it out from that. Image resolution is typically dots or pixels per inch, so ppi or dpi.

Thanks for your help.

Cheers, Andy

Quick Reply Show Quick Reply
Users browsing this topic
Guest (3)
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.