• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unable to read paged within AVDocDidOpen notification handler

Community Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

I have a plugin that's reading the fonts within a pdf document

I have written code to use PDDocEnumLoadedFonts to read all the fonts loaded by the doc

This code will be run after the AVDocDidOpen fired by the runtime

 

I am expecting to be able to read fonts

But no fonts are read 

It seems that the whole of doc is not loaded when AVDocDidOpen is fired

If I run the same code say on a pointer move, the fonts are found

 

Regards

Rahul

TOPICS
Acrobat SDK and JavaScript , Mac , Windows

Views

377

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 14, 2021 Jul 14, 2021

"I am expecting to be able to read fonts" You should not expect this. You should expect no fonts to be loaded, this should be clear from the documentation "PDDocEnumLoadedFonts... Enumerates all the fonts that have been encountered so far. A font is loaded when a page that uses it is processed. This typically happens when a page is drawn or its thumbnail image is created."

 

It is a fundamental part of Acrobat that pages are not even read from disk until they are needed. This is very important. A

...

Votes

Translate

Translate
LEGEND ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

"I am expecting to be able to read fonts" You should not expect this. You should expect no fonts to be loaded, this should be clear from the documentation "PDDocEnumLoadedFonts... Enumerates all the fonts that have been encountered so far. A font is loaded when a page that uses it is processed. This typically happens when a page is drawn or its thumbnail image is created."

 

It is a fundamental part of Acrobat that pages are not even read from disk until they are needed. This is very important. A file might be 20GB in size and have 500,000 pages. The user would not want to wait 20 minutes when opening, while all the fonts were scanned for your convenience. By coincidence, I recently posted a reply giving two methods of enumerating a PDF to get a full list of fonts - check the forum. These are a lot more work than just calling one method!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Hey, many thanks!

 

I tried searching your posts on forum and its a long list!

Do you happen to remember the title of the posts?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

LATEST

1. Enumerate pages, enumerate all text runs, check PDEFont for embedding flags.

2. Enumerate all font dictionaries in all Resources dictionaries (recursively into Form XObjects etc.), checking the FontFileXXX values in font attribute dictionaries.

 

It was this post: https://community.adobe.com/t5/acrobat-sdk/is-it-possible-to-determine-missing-fonts-psname-and-the-...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines