On Tue, Mar 23, 2010 at 2:31 PM, dennis jenkins
<dennis.jenkins...@gmail.com> wrote:
> Dominik,
>
>     Thank you for that suggestion.  The code change fixes PDFs that I
> generate myself (my small test case).
> However, it does not work with editing existing PDFs.
>
>     I will study the functionality in PdfAcroForm.cpp and experiment.
>  Thank you very much.
>
> ps- Why is the "NeedAppearances" code commented out at all?  In a
> future release will there a way to specify this behavior
> programatically so that users won't need to maintain custom PoDoFos?

I got it to work, with a little C++ abuse.

I modified "PdfAcroForm.h" so that "Init()" was a public method,
recompiled and re-installed.

In my own code, I load the IRS form into a PdfMemDocument, then do this:

doc.GetAcroForm()->Init
(PdfAcroForm::ePdfAcroFormDefaultAppearance_BlackText12pt);

I then loop through all of the form fields, calling "SetText" on the
text fields.  Finally I save the PDF.  The resulting PDF displays as
desired.


So, my question now is what is a "proper" fix?  I can think of a few
alternatives:

1) Wait for PoDoFo to make a formal code change that helps my situation.

2) Continue to use a hacked PoDoFo (not a problem right now, but not
desirable long term).

3) Extract the relevant logic from PdfAcroInit() and embed it directly
in my own code (risking my code breaking in the future if PoDoFo makes
an incompatible change).  I have not fully researched this
alternative.  At this time I don't know if the methods invoked by
PdfAcroRead::Init() are "public" such that I can invoke them myself
directly in my own code.

Anyway, thank you guys very much for your assistance.

If you are willing to make a change to PoDoFo to make the above
"proper" or "formal" or whatever then I would be more than happy to
test.

Thank you for your time.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to