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 - Fix a wrong PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Fix a wrong PDF

 Post Reply Post Reply
Author
Message
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Topic: Fix a wrong PDF
    Posted: 24 Oct 07 at 8:12AM
Hello !

I used QuickPDF to load a PDF  template and stuff field contents into it, generating a new PDF file (LoadFromFile, SetFormFieldValue , FlattenFormField and then SaveToFile).

So far , so good.

It happens that the PDF template was WRONG.

Now I need to modify those generated PDFs, in order to replace a very small string.

IOW, I need to replace ".DES." by ".PRO."  .

I tried to load the PDF into my editor, in binary mode and to replace the strings directly cause the editor allows a kind of binary or "raw" editing. It doesnt work.

What could I do ?

You can have a sample of the PDF here :

http://www.DES.online.unimep.br/au/pub/wrong.pdf

I thought about doing a very simple VBScript to modify it but, dont know how to start....

Thanks in advance 4 your help !




Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 26 Oct 07 at 6:01PM
When you edit anything in a PDF, you will most likely mess up the XREF table. Reader will try to fix the errors, but might not be able to.

You can use pdftk to do some simple edits. It has the capability of fixing corrupt XREFs when it saves. You'll need to have it uncompress streams in order to edit compressed text:

1. Uncompress wrong.pdf, save as wrong1.pdf
$ pdftk wrong.pdf output wrong1.pdf uncompress

2. Edit wrong1.pdf, make your changes
$ vi wrong1.pdf

3. Recompress and fix wrong1.pdf, save as right.pdf
$ pdftk wrong1.pdf output right.pdf compress

(I did this in a *nix environment, it will also work fine with Windows, so long as you use a binary editor).
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