This is a migrated thread and some comments may be shown as answers.

Pdf Annotations and Appearance Streams

6 Answers 274 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Veteran
Vladimir asked on 01 Oct 2020, 06:22 AM

Hello!

 

I use PdfViewer and in some pdf files I have annotations (comments) to show them for users. But sometimes these annotations are not displayed in the Viewer. In particular we use /FreeText annotations.

I can read these annotations through Annotations property in RadFixedPage, but I can't see them in the Viewer. And if I open the same file in Adobe Reader, I can watch these annotations.

 

I noticed, that if annotation dictionary (/Annot) doesn't contain "appearance stream" in itself (/AP), it won't be displayed in the Viewer. 

For /FreeText annotation, key /AP is Optional and it annotation also contains other keys in annotation dictionary for display itself, such as /DA, /DS and /RC.

Key /DA is "Required" key and should be used like the default appearance if there is no /AP entry.

What should we do to display annotations if there aren't appearance streams for annotations? Because pdf files could be created not only Adobe software.

 

I attached 2 files:

"Before.png" on which you can see text 'Hello'

"After.png" on which you can't see that text.

Difference between these files, that in the "After.png" there is no /AP key in annotation dictionary.

You can see this on other screens: "After_behind.png" and "Before_behind.png".

 

6 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
Veteran
answered on 01 Oct 2020, 06:30 AM

I have loaded these files for sharing:

Before file:   http://u.pc.cd/aKwitalK

After file:      http://u.pc.cd/Hp1rtalK

0
Tanya
Telerik team
answered on 05 Oct 2020, 12:52 PM

Hi Vladimir,

Although PdfViewer can show almost all annotations, the ones that are fully supported are Link and Widget. All other types are visualized in a read-only mode. To extract their appearance, the current logic uses the appearance defined by the AP entry. The DA entry is indeed required for text annotations but there are other types that do not contain such an entry. Since the model cannot currently make a difference between the different annotations, the common AP definition is used. With that said, I am afraid that there isn't much I can suggest despite ensuring that the AP dictionary is defined.

I hope this information is useful.

Regards,
Tanya
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Vladimir
Top achievements
Rank 1
Veteran
answered on 09 Oct 2020, 09:40 AM

Hello, Tanya!

We tried to find easy solution for this, but we understand that we will have to create AP entry for each type of 'Markup annotations' to PdfViewer can display them. Could you tell us, is it possible to read raw data of every annotation through model of RadFixedDocument? I mean, for example for free text - DA, DS, RC entries to generate the annotation appearance

It looks like super crutch, only needed to display data from pdf file, but different viewers has own behavior for generating annotation appearance

0
Tanya
Telerik team
answered on 09 Oct 2020, 01:34 PM

Hello Vladimir,

All annotations that are currently not supported are parsed at the minimum (loading only visual appearance properties common for all annotation types) so that they can be later shown in the UI. However, the whole data of the unsupported annotations and their appearance is not available in the model of RadFixedDocument as it hasn't been processed while importing. Thus, I am afraid I cannot suggest an approach for obtaining the complete data for such an annotation.

Regards,
Tanya
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Vladimir
Top achievements
Rank 1
Veteran
answered on 12 Oct 2020, 07:45 AM

Hello, Tanya!

I understood your answer.
How can we add this to user requests, because allmost all types of markup annotation have their own required flags and this is part of Pdf standard? Because 'Appearance Stream' is not the only way to generate a representation in Pdf.

0
Tanya
Telerik team
answered on 14 Oct 2020, 06:53 AM

Hello Vladimir,

You can submit any requests for features or bug fixes directly on our public portal. We completely understand that each annotation has its own properties and definitions, thus we consider the ones that are rendered in read-only mode as unsupported. Searching in the feedback portal, you can find all the requested types of annotations. In case you don't find what you need, feel free to create a new item through the available buttons on the right.

Regards,
Tanya
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
PDFViewer
Asked by
Vladimir
Top achievements
Rank 1
Veteran
Answers by
Vladimir
Top achievements
Rank 1
Veteran
Tanya
Telerik team
Share this question
or