If I add a highlight annotation to a PDF and after that use pdfViewer.LoadedDocument.FlattenAnnotations(), the highlight annotation is set to foreground.
Please find a demo PDF attached.
This seems to happen after upgrading to syncfusion 21.1.35.
Marco, based on previous forum threads, we suspect that you are using Pdfium as your rendering engine and SfPdf for text extraction. With this combination, we were unable to reproduce the reported issue when trying to highlight annotations and flatten them. Therefore, we have attached a sample below that we used to try and reproduce the issue on our end.
However, if we use SfPdf for rendering the PDF, we can reproduce the reported issue. We should note that this issue has also been present in previous versions. Can you please confirm whether you are using Pdfium or SfPdf for rendering the PDF in PdfViewer? This information would be helpful for us to investigate further.
Krithika, I am using the SfPdf for rendering. Otherwise I have another problem selecting the text. This is what is in the other thread.
Hope this helps.
Marco, In our PDF viewer WPF control, we are using Pdfium by default for text extraction, rendering PDF, creating images, printing the page, exporting as images, etc without any flaws. PDFium rendering engine renders the PDF pages, which is more robust and promising than our own rendering engine(SFPDF). PDFium rendering engine is comparatively more reliable and will be better in performance when compared to SFPDF rendering engine. PDFium rendering engine is used in Google Chrome for rendering the PDF files. Hence, we highly recommend you use PDFium rendering engine.
The document you have shared in this forum cause the issue in pdfium. We have already reported this issue to Pdfium, please find the link below,
meanwhile for other PDF document we are not facing the reported issue to highlight the text and flatten the annotations. We have also attached a sample below for your reference.
Understand, but we cannot use the Pdfium engine because of the bug with missing characters while copy and selecting text.
This is very critical for us, so perhaps can you put more focus on the reported issue with Pdfium?
Thank you and kind regards, Marco
Marco, we have requested update in this public PDFium group
We will wait for further update from Pdfium team