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

Converting PDF to image containing form fields returns blank fields #57

Closed
vinishiru opened this issue Dec 23, 2021 · 2 comments
Closed

Comments

@vinishiru
Copy link

When calling the "GetImage" function with a PDF file that contains "Form Fields", the generated image does not contain the form fields values, becoming all blank after the operation.

We tried to change the RenderFlags used as arguments to GetImage function, but with no success at all.

Here is the code snippet that I used:

using (var docReader = rasterizer.GetDocReader(pdfBuffer, new Docnet.Core.Models.PageDimensions(1080, 1920)))
        for (var i = 0; i < docReader.GetPageCount(); i++)
        {
          using (var pageReader = docReader.GetPageReader(i))
          {
            var pageBytes = pageReader.GetImage(new NaiveTransparencyRemover(255, 255, 255), RenderFlags.RenderForPrinting);

            return BytesToBitmap(pageReader, pageBytes, dpi);
          }
        }

Is there anything, or any argument missing when calling the GetImage function to get the desired result?

Here follows the screenshots before and after the operations.

Screenshot before converting.
image

Screenshot after converting.
image

Original PDF.
OriginalFilledForms.pdf

Thanks in advance.

@vinishiru
Copy link
Author

Hi there.
I now realized, after studying how Pdfium render annotations and FormFills, how to make it work.
Is there any contribute guide lines before I can send an PR?
Thanks.

@Modest-as
Copy link
Member

Hey, no strict guidelines, link the Issue in the PR, make sure that code follows the existing styles and add a few tests

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

2 participants