Print Page | Close Window

Reader wants to save changes on close

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=486
Printed Date: 27 May 24 at 3:04AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Reader wants to save changes on close
Posted By: Jay2068
Subject: Reader wants to save changes on close
Date Posted: 04 Aug 06 at 12:34PM
I've created a VB.NET program that creates and launches a PDF. When the end user closes the PDF it ask's to save changes. Is there a way to make it so it just closes the PDF without asking?



Replies:
Posted By: bogey
Date Posted: 07 Aug 06 at 7:33AM
I believe this is caused by the "setNeedsAppearances" property. It instructs Acrobat to scan the file and update all fields on load. Then it thinks the file has changed, causing the prompt.


Posted By: Jay2068
Date Posted: 07 Aug 06 at 1:13PM
So no way around this then??


Posted By: bogey
Date Posted: 07 Aug 06 at 2:34PM
Don't use the needsApperances option?


Posted By: Jay2068
Date Posted: 08 Aug 06 at 10:09AM

Ahh.. I thought that was an Adobe function. I checked it out and it works fine for the documents that have a single line fill in form. But when I'm sending text to a multi-line field it adds an odd square character to the left of the text. If I click on the "allow rich text formatting" it removes the squares. I'm sure this might just be a line feed or return character. The thing is I’m not sending the data to the form any different. Here is what I use to send the different types:

 

Single Form Field:

Call QP.SetFormFieldValueByTitle("eEmpPhone", CurrentEmpPhone)

 

Multi-line Form field:

QP.SetFormFieldValueByTitle("Salutation", Salutation)

Dim fff As Integer = QP.FindFormFieldByTitle("Salutation")

If fff <> 0 Then

   QP.SetFormFieldReadOnly(fff, 1)

End If

 

The only diffrence is I set the multi-line fields to read only.

 

Both strings are coming from an SQL database.

 

Anyone have any ideas why this is happening?



Posted By: chicks
Date Posted: 08 Aug 06 at 10:25AM
Do you need the forms to be fillable? If not, flatten the fields.


Posted By: Jay2068
Date Posted: 09 Aug 06 at 11:59AM

That does the same thing. If I apply the 'flatten' to the field the squares show up.

below is a sample letter that I create. The top field is not flattened and works great (but give me the save changes on exit). The bottom field (the rest of the letter) is flatten and it shows the odd characters.

 

Any help is appreciated. Thanks!



Posted By: Jay2068
Date Posted: 17 Aug 06 at 9:49AM

Just for anyone in the future that might need to know. I solved the problem by removing the bad ASCII characters out of the string before I sent it to the PDF. Works great now!

 

Code i used:

Friend Function removebadchar(ByVal TheString As String)

For x As Integer = 0 To 12

While InStr(TheString, Chr(x)) > 0

TheString = Replace(TheString, Chr(x), "")

End While

Next x

For x As Integer = 14 To 31

While InStr(TheString, Chr(x)) > 0

TheString = Replace(TheString, Chr(x), "")

End While

Next x

For x As Integer = 127 To 255

While InStr(TheString, Chr(x)) > 0

TheString = Replace(TheString, Chr(x), "")

End While

Next x

Return TheString

End Function

 

 




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