Hi Support,
I'm using IPXC_Document::EnumFonts to grab all the fonts in a PDF (going through all the pages). Then using IPXC_DocFontsInfo and IsEmbedded and IsSubset...
All works well - but the enumeration execution speed seems to be slow (on a larger number of documents it takes quite some time to enumerate all - even if I do nothing in OnNewFont).
Is there any other (faster) approach you could suggest to check if any of the fonts used in a document (anywhere) is not (fully) embedded?
-žarko
Enumerating fonts (to see if embedded) - speed issue SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
-
- Site Admin
- Posts: 17957
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Enumerating fonts (to see if embedded) - speed issue
Hello zarkogajic,
Passed it on to the dev team and they will post here soon!
Kind regards,
Stefan
Passed it on to the dev team and they will post here soon!
Kind regards,
Stefan
-
- Site Admin
- Posts: 3554
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: Enumerating fonts (to see if embedded) - speed issue
The only other possible way to find all fonts in the document is to go through all objects (using IPXS_Document::GetObjectByNum) and if the object is a dictionary, check its Type field. For fonts, it should be "Font". Then, you can get IPXC_Document::GetFont to get IPXC_Font from this IPXS_PDFVariant, and having this font you can use its property IPXC_Font::FontInfo to retrieve font info.
But I cannot promise this way will be faster, and, secondly, it will find all fonts in a document, even unused ones.
But I cannot promise this way will be faster, and, secondly, it will find all fonts in a document, even unused ones.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Enumerating fonts (to see if embedded) - speed issue
Hi Ivan,
Thanks, will try.
Btw, the EnumFonts implementation - is it the same as grabbing all IPXC_ContentItems on all pages and looking for PXC_CIType
== CIT_Text then getting IPXC_TState and finally CurFont ...
-žarko
Thanks, will try.
Btw, the EnumFonts implementation - is it the same as grabbing all IPXC_ContentItems on all pages and looking for PXC_CIType
== CIT_Text then getting IPXC_TState and finally CurFont ...
-žarko
-
- Site Admin
- Posts: 3554
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
Re: Enumerating fonts (to see if embedded) - speed issue
Not exactly. This method does not go through page content. Instead, it checks the /Resources dictionary recursively, and not only for pages as fonts may be used in many places.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Enumerating fonts (to see if embedded) - speed issue SOLVED
Hi Ivan,
Ok, clear, thanks.
-ž
Ok, clear, thanks.
-ž
-
- Site Admin
- Posts: 6902
- Joined: Wed Mar 25, 2009 10:37 pm
- Location: Chemainus, Canada
Enumerating fonts (to see if embedded) - speed issue
Best regards
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com