Print Page | Close Window

How to Flatten a Form?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1979
Printed Date: 03 Jul 25 at 11:02AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How to Flatten a Form?
Posted By: alecd4
Subject: How to Flatten a Form?
Date Posted: 29 Sep 11 at 6:32PM
I am using QuickPDF library 8.11.906   via C# wrapper. Trying to flatten a form that I previously filled in my application. Here is my [pseudo]code

LoadFromFile(path)
while(FormFieldCount() > 0)
{
   FlattenFormField(1);
}
SaveToFile()


FlattenFormField above returns 0 to indicate a problem while LastErrorCode returns 0 as well.

I was trying to add SetNeedAppearances(1) just after LoadFromFile with no change in behavior


What I am doing wrong?

UPDATE:
Well, I figured out that the code above won't produce any result if first field will fail to flatten for whatever reason

Here my new code

LoadFromFile(path)
total=FormFieldCount();
while( total> 0)
{
  FlattenFormField(total--);
}
SaveToFile()

Above code simply removes control's appearance: for edit field only value is shown but no box borders, radio buttons and checkboxes are gone. I called SetNeedAppearances(1) just after LoadFromFile but still no controls.

Any ideas what is wrong?








Replies:
Posted By: AndrewC
Date Posted: 03 Oct 11 at 5:36AM
FormField flattening works much better in reverse because you can flatten the children before flattening the parent objects.  It doesn't work so well the other way around.

Can you send the PDF through to the official support site and I can see what could be going on.  There are many different issues that could be causing this type of behaviour.

http://www.quickpdflibrary.com/support/support-query.php - http://www.quickpdflibrary.com/support/support-query.php

Andrew.



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