Problems using PDF template

Hello - I am getting the following error when trying to create a PDF via existing PDF template.

However, I can not get past the "pdf_use_PDF_page" call. I always get the error:

"pdf_use_PDF_Page Invalid Page # for PDF ID = Inv stream=Spdf"

Can anyone help?

Here is my code:

{ pdf_inc.i}

RUN pdf_new ("Spdf","c:\temp\InvoiceDoc-Fill.pdf").

RUN pdf_open_PDF("Spdf","c:\temp\invForm.pdf","Inv"). /* Open Template PDF */

RUN pdf_new_page("Spdf").
RUN pdf_use_PDF_page("Spdf","Inv",1). /* Use Page 1 from Template */ /*XXXXXXXXXX THIS IS WHERE THE ERROR OCCURS XXXX*/

RUN pdf_fill_text("Spdf",
"CustomerName",
"MMMMMM",
"").
RUN pdf_close("Spdf").

THanks,
MIke.


AttachmentSize
invForm.pdf8.37 KB
inv-pdf.p563 bytes

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

See

See http://www.oehive.org/node/1889 to use OpenOffice.org generated forms.

Will investigate yours though, time is too short, but I did not forget :p


erickroco's picture

Try to set the PDF Version to 1.4

Hi.

I have the same problem!!!

In some places I have found that we need to save to PDF in Version 1.4 (Acrobat 5).

I changed the Adobe Acrobat Distiller Options to save the file in Version 1.4. I didn't get to figure it out! I didn't get any error and the PDF didn't generate neither!

Could you try this (Create a PDF Version 1.4) and we'll se if you have better luck.

See U!

P.D. Don't forget to share your results.

Erick Christian Rosales Cruz
ABL Developer to TOTVS MEXICO


Acrobat 9

I'd be very interested in having some Acrobat 9 examples so that I can try to patch pdfextract.p to make them work. Can anybody send me some?

pdfextract.p is more a hack, and expects the pdf to have a certain strcuture. It would need a rewrite, but I've no time nor money for this...


:-)

Let me know if you work out which is easier! I don't have the CD's for Acrobat 5 anymore, so I need to hope the old hard drive lives a bit longer.

If you want to fix PDFInclude - you need to go to the pdfextract.p and down to procedure LoadObjectPointers and then message text-ptr after the code line: text-ptr = readline(). There you will see that the temp table tt_object is never getting created because the input data looks a bit strange.

I've attached a document showing what the different messages show.

I'm going to try something else, somewhere inside Acrobat, you can choose to have your PDF's created in the version 5 style. Will let you know if I find it, and it works!

Let me know if you find any solutions!


AttachmentSize
PDF Include.doc35.5 KB

PDF Include: 'Problems using PDF template

I am an extreme newbie and have not attempted to include a pdf form, but perhaps you need a different stream for the form. You're using Spdf for both streams.


Code was taken fromincluded examples

The code used is taken straight from the example under section "Introducing Complex Forms."

I am thinking that perhaps it may be something to do with incompatibility between PDFInclude and Adobe Acrobat???


Same problem

Hi Javacinno

I have the same problem. I have been using PDFInclude for many years, and always created my PDF files with Adobe Acrobat 5. Now I have upgraded my PC and installed Adobe Acrobat 9, I am getting this problem. Nothing else has changed, only the version of Adobe.

I'm not sure if PDF Include is still supported and being upgraded, Gordon Campbell who originally wrote it, died very tragically and suddenly of cancer a few years ago.

I'll look into it and get back to you if I find anything.

regards
Marcia


Hmmmm

It seems that Adobe is not backwards compatible. After quite a lot of digging, I found that inside pdfextract.p there is an internal procedure called LoadObjectPointers, which is expecting data in a certain format and receiving it (with PDF's created in Acrobat 9) in a totally different format.

My conclusion here (please someone prove me wrong!) is that pdfinclude can no longer be used in conjunction with later versions of Acrobat.

The last version that definitely worked was Acrobat 5.


Any progress?

Hi Mash / All,

Was wondering if anyone managed to progress things so pdfextract.p is now compatible with a version of Adobe above 5?

Any information greatly received.

Thanks


Thank you for the analysis!

Mash - Thank you for the wonderful analysis you performed. Yes, we are using Acrobat 9.

So I guess there are a couple of ways to proceed for us:
1) Fix PDFINclude or
2) Find Acrobat 5 for our PDF forms

I wonder which one is easier? :)


Getting a bit closer...

In my case I'm converting Excel Documents into PDF's. So in Excel, a new menu has appeared at the top, at the end - Adobe PDF. Select that, and then "Change Conversion Settings". Go to "Advanced Settings" and then in "Compatibility" choose Acrobat 5.0. Save this conversion setting, and then select the newly saved conversion setting when you run "convert to Adobe PDF". YOu get some message about tags which I ignored.

Now it creates a PDF document which inputs data that looks a lot more like it should! However, I'm still getting the error at the end of it, but I think this is a step closer.

Will let you know...


OpenOffice generated pdfs?

Hi
I'm successfully using pdfs generated using the pdf export function of OpenOffice.org
As long as they don't contain pictures, it works perfectly.
May be this would be a third, less painful solution.
regards
JC


pictures: ok

by the way I published today in the svn a new version which handles pictures!


PDFS = PDF Forms?

Hi JC -

I had attempted early on during these attempts to produce a PDF Form via OpenOffice.org... but I had similar errors kick back.

Which version of OO did you use?


OpenOffice.org 3.1 ; See

OpenOffice.org 3.1 ; See http://www.oehive.org/node/1889


nope

No in fact the pdfs I use are just masks over which I add content. Does not know how to generate a form with Ooo, although I'd be very interested... Anyone?