Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - How to Flatten a Form?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to Flatten a Form?

 Post Reply Post Reply
Author
Message
alecd4 View Drop Down
Beginner
Beginner


Joined: 29 Sep 11
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote alecd4 Quote  Post ReplyReply Direct Link To This Post Topic: How to Flatten a Form?
    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?







Edited by alecd4 - 29 Sep 11 at 8:27PM
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.


Andrew.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store