Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdf annotations are not being drawn #13

Open
migueloliveira-agentifai opened this issue Nov 23, 2023 · 8 comments
Open

Pdf annotations are not being drawn #13

migueloliveira-agentifai opened this issue Nov 23, 2023 · 8 comments

Comments

@migueloliveira-agentifai

.pdf documents that contain annotations are drawn without them.
https://github.com/barteksc/PdfiumAndroid , in which the library is based, draws the annotations.

@johngray1965
Copy link
Owner

Can you provide me with an example PDF?

@migueloliveira-agentifai
Copy link
Author

Sorry, I completely forgot to upload it. Here it goes:
pdfsample.pdf
It will be missing "22/12/2023" when rendered with the sample app.

The macOS Preview app renders it as:
Screenshot 2023-12-04 at 10 06 44

@odmfl
Copy link

odmfl commented Dec 7, 2023

The annotations, currently in pdfium are only drawn, perhaps this also allows them to be compiled

Maybe with this commit you could also compile the pdf with foarms. Would be great

trylevel/PdfiumAndroid@a1912d9

@johngray1965
Copy link
Owner

From the pdfium code:
// flags - 0 for normal display, or combination of the Page
// Rendering flags defined above. With the FPDF_ANNOT
// flag, it renders all annotations that do not require
// user-interaction, which are all annotations except
// widget and popup annotations.

We or in FPDF_ANNOT if renderAnnot is true on renderPageBitmap, but it still doesn't render that page correctly. Happen to know what kind of annotation it is?

@migueloliveira-agentifai
Copy link
Author

@johngray1965 unfortunately I don't, as I don't have access to how the pdf is generated. But I would say it is an interactive form, which is a type of widget.

@marain87
Copy link

marain87 commented May 6, 2024

It is related to FPDF_FFLDraw not called for new version of Pdfium render annotation and signature.

I made some modifications to the code in PdfiumAndroid
code ref to sample of pdfium

@odmfl
Copy link

odmfl commented May 9, 2024

@marain87 would you be able to add other functions such as search and more from these two repositories?

https://github.com/Lesmm/AndroidPdfViewer/tree/develop ( in this branch search and selection works)

https://github.com/TEA-ebook/AndroidPdfViewer (search, selection and highlighting should work here)

@johngray1965
Copy link
Owner

@odmfl those projejcts are viewers. This projects wraps the native pdfium api to provide the APIs to an Android app. We project isn't a viewer. You are talking about viewer functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants