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

PDFViewer incorrect editable field visibility

4 Answers 170 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Marek
Top achievements
Rank 1
Marek asked on 30 Sep 2020, 07:20 AM

Hello,

 

I have tested a specific .pdf file in Adobe Reader, Chrome and Edge, in all viewers the pdf loads without issues and all text is visible.

This is not the case in PDFViewer, the content is obscured in some way (marked in red rectangles on screens). I have tested it on the demo preview of features.

Would it be possible to fix this issue?

 

I'm attaching  the difference in views example in PDFViewer and Edge.

It is not possible to attach the .pdf file in question, can i provide this file in any other way?

Thank you.

4 Answers, 1 is accepted

Sort by
0
Marek
Top achievements
Rank 1
answered on 30 Sep 2020, 07:50 AM

I have uploaded this .pdf file to a third party hosting service. I hope this suffices.

 

https://gofile.io/d/kTCkv0

0
Martin
Telerik team
answered on 01 Oct 2020, 07:50 AM

Hello Marek,

Thank you for sharing the document with us.

It seems you are hitting a known issue related to incorrectly mapped CharCodes to glyph indices. We have an item logged in our backlog to fix this issue: CharCodes to glyph indices are incorrectly mapped when exporting TextBoxField with TrueType font and defined encoding. You can follow the item so you can receive updates when ist status changes.

Until this bug is fixed you can check the provided in the public item workaround. I am attaching a sample project demonstrating the suggested workaround as well.

Regards,
Martin
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
Marek
Top achievements
Rank 1
answered on 16 Oct 2020, 06:09 AM

Hi Martin,

 

sorry that it took me so long to post a reply. The suggested workaround does not work for me. The Font is set correctly when i was deugging the document, but when the document is sent to the pdfViewer it still shows up as glyphs.

I have attached screens the before and after using the method you suggested

 

I'm not sure if this is relevant but the version of .dll's we use is: 2019.3.1023.45

 

0
Martin
Telerik team
answered on 16 Oct 2020, 07:17 AM

Hello Marek,

Indeed, the reason this workaround to not work in your case is the older version of binaries referenced, because since R3 2020 the RadPdfViewer uses PdfProcessing and its RadFixedDocument as a model. So, you have two options:

  1. Update the binaries to the current version.
  2. Import the document firstly with the PdfProcessing`s PdfFormatProvider, apply the fix, then export it to a byte array, and finally import it again using the PdfViewer`s PdfFormatProvider. Check the following code snippet:
    PdfFormatProvider pdfProcessingProvider = new PdfFormatProvider();
    RadFixedDocument pdfProcessingDocument;
    using (Stream stream = File.OpenRead("SampleData/testFilePDF.pdf"))
    {
    	pdfProcessingDocument = pdfProcessingProvider.Import(stream);
    }
    
    this.FixEncodingIssues(pdfProcessingDocument);
    byte[] data = pdfProcessingProvider.Export(pdfProcessingDocument);
    
    PdfFormatProvider pdfViewerProvider = new PdfFormatProvider(new MemoryStream(data), FormatProviderSettings.ReadOnDemand);
    this.pdfViewer.Document = pdfViewerProvider.Import();

I hope this helps.

Regards,
Martin
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
Marek
Top achievements
Rank 1
Answers by
Marek
Top achievements
Rank 1
Martin
Telerik team
Share this question
or