Print Page | Close Window

Filling out PDFs with FormFields then saving them

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3092
Printed Date: 28 Apr 24 at 5:09AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Filling out PDFs with FormFields then saving them
Posted By: BobW
Subject: Filling out PDFs with FormFields then saving them
Date Posted: 20 Mar 15 at 8:03PM
I was working with some government documents that contain form fields.  I wrote some code that filled out the fields and printed the documents.  It worked just fine.  If I want to save the same documents as filled-out PDFs that can't be re-filled out I get the following message from Adobe Reader:

"This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document."

I couldn't find a solution to this in the forum (maybe my searching abilities are poor).  I solved this problem by filling out the form fields, using UpdateAndFlattenFormField on each field (in reverse order) then using RemoveUsageRights.

That seems to work.  Is it the preferred method?

TIA

Bob



Replies:
Posted By: Ingo
Date Posted: 21 Mar 15 at 5:48PM
Hi Bob,

if you have ANY solution against this built in "money-making" adobe behavior it's absolutely great!
Thanks a lot for this post!
If you don't have anything against it i'll copy your post with a new title into the general section?

Cheers,
Ingo



-------------
Cheers,
Ingo



Posted By: BobW
Date Posted: 02 Sep 15 at 5:34PM
Slight update:

I had an issue with Adobe Reader 8 not being able to open a PDF but 9, 10, and 11 could.  It happened when I filled out the form fields then added a watermark in a new content stream before flattening the fields and removing the usage rights.  I first solved this by removing the usage rights before using UpdateAndFlattenFormField.  After moving the watermark code to a point BEFORE I fill out the form fields, I found the order of RemoveUsageRights and UpdateAndFlattenFormFields didn't matter.  Still, this is probably the best way to do it as it seems to work in all cases for all versions of Reader:

CreateNewContentStream and add watermark

For each Form Field you want to fill out
    SetFormFieldValue
    UpdateAppearanceStream
next Form Field

RemoveUsageRights

ii=FormFieldCount
do While ii > 0
    UpdateAndFlattenFormField ii
    ii = ii-1
loop





Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk