unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.5k stars 249 forks source link

fix: partial flattening #391

Closed ghost closed 3 years ago

ghost commented 4 years ago

I was unable to generate PDF with filled form flattened and empty forms available for electronic filling.

This is now solved.

Btw, it is required to save the AcroForm object from pdfReader before using FlattenFields method, and then use SetForms on pdfWriter.


This change is Reviewable

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 4 years ago

Codecov Report

Merging #391 into master will not change coverage. The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   57.34%   57.34%           
=======================================
  Files         249      249           
  Lines       47251    47251           
=======================================
  Hits        27096    27096           
  Misses      16727    16727           
  Partials     3428     3428           
Impacted Files Coverage Δ
model/flatten.go 66.05% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dcb84ad...87317c2. Read the comment docs.

ghost commented 3 years ago

ping @gunnsth :)

gunnsth commented 3 years ago

Thanks for your contribution. Support for this has been added via a filtering function, see https://github.com/unidoc/unipdf/issues/392#issuecomment-695327742