Problem when create PDF

Hello every body!
Is anybody here that can help me with the PDF include? I'm new with this tool!!

The situation is this:
I'm creating a PDF Documents, and I'v already finished with that, but know I need to create just one PDF in which I can have all the PDF that I've already create.

I'm using one ".p" file for each PDF that I'm creating, to make it easy to de user, so in that way, the user makes click in a link and I run the .p file to create the PDF, and show it on the window explorer.

So the point is that I create two files (PDF), with some information, and for now I need to create JUST ONE PDF with all the documents.

I try to run another ".p" file in progress that calls the creation of the two PDF so when the first has finsihed, I put the next command:

opchrArchivo = "/sales/SalesByHours.pdf".
RUN pdf_open_PDF("Spdf",opchrArchivo,"Inv").
RUN pdf_new_page("Spdf").

and then I run the second .p file to add the information of the next PDF, but it show me this error:

Content-type: text/html n** "pdfextract.p" was not found. (293)

Does anybody knows about how can I put together tow PDF that are separte?

Please help meeeeeeeeeeeeeeeeeee!!!!

Sorry about my english!!


Comment viewing options

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

Problem when creating PDF

Here is some sample code, and attachment of pdfextract.p

It works. Obviously references to my database won't work for you, but I can explain if necessary. Important: I created the PDF template in Excel and used PDFCreator to create/print it with all the encrypt settings off. PDFcreator available at:
http://sourceforge.net/projects/pdfcreator/

Feel free to email ncbaines@mweb.co.za

Norman Baines


AttachmentSize
PDFextract.p101.09 KB
statementwriter6.p11.44 KB

This is the code for the first .o

It's just an exemple

/*************************************************************************************/

opchrArchivo = vcRutaMail + "kpi_prueba444.pdf".
RUN pdf_new ("Spdf", opchrArchivo).
RUN pdf_set_parameter ("Spdf", "Compress", "FALSE").
RUN pdf_set_parameter ("Spdf", "AllowModify", "FALSE").

RUN pdf_set_Orientation ("Spdf", "Landscape").
RUN pdf_new_page("Spdf").

RUN pdf_set_font ("Spdf", "Helvetica-Bold", 7).
RUN pdf_text_color ("Spdf", .0, .0, .0).
RUN pdf_text_xy ("Spdf", " Hello World!", 13, 300).

RUN pdf_text_xy ("Spdf", STRING(pdf_Page("Spdf")) + " de " + STRING(pdf_TotalPages("Spdf")), 13, 400).

RUN pdf_close ("Spdf").

/* ___ WHEN I ADD THIS CODE TO ADD THE NEXT PDF IT SHOWS ME THE ERROR ______*/
RUN pdf_new ("Spdf","opchrArchivo").
RUN pdf_open_pdf ("Spdf","opchrArchivo", "INV").

RUN sales/create2ndReport.p.


known problem :-(

Hi
Unfortunately pdfinclude is very bad at opening its own generated pdfs! :-(
I'm currently working on a rewrite of this part which should allow to reuse any pdf file, but this will take some more time.
In the meanwhile, I'm using pdftk to modify the pdf files I've created, for example to concatenate them, add a watermark. It all depends on what you intend to do...


Mmm..

Well I've already readed the manual for the PDF Include, and also there are some exemples to use template and so on.

I guess is so easy, the way to do it is like this:
1.- You need to create your pdf template and save it on your server o you PC or whatever you are workin on.

2.- When you need to edit that template, first you need to create a new PDF

RUN pdf_new ("Spdf","openpdf.pdf").
RUN pdf_set_parameter("Spdf","Compress","TRUE").

3.- Now open the PDF template and assign a nicknamed to call that document, in this case the nickname is "Inv" is at the end of the sentece.

RUN pdf_open_PDF("Spdf","c:\gord\pdfinclude2\samples\support\Invoice.pdf","Inv").

4.-And then if you need to add more pages you must have to indicate that the page is gonna be like the pdf tamplate.

RUN pdf_new_page("Spdf").
RUN pdf_use_PDF_page("Spdf","Inv",1).

5.- Now you can write your infromation.
RUN pdf_set_font("Spdf","Helvetica",8).
RUN pdf_text_color("Spdf",1.0,0.0,0.0).

/* This procedure overlays the DB info on the external PDF form */
RUN pdf_text_xy ("Spdf",STRING(Invoice.InvoiceNum,"99999"),350,557).
RUN pdf_text_xy ("Spdf",STRING(Invoice.InvoiceDate,"99.99.9999"),350,546).
RUN pdf_text_xy ("Spdf",STRING(Invoice.CustNum,"99999"),350,535).

Now here is the compleate code:

{ pdf_inc.i "THIS-PROCEDURE"}

DEFINE VARIABLE i_Counter AS INTEGER NO-UNDO.

RUN pdf_new ("Spdf","openpdf.pdf").
RUN pdf_set_parameter("Spdf","Compress","TRUE").

RUN pdf_open_PDF("Spdf","c:\gord\pdfinclude2\samples\support\Invoice.pdf","Inv").

FOR EACH Invoice NO-LOCK:
RUN DoNewPage.

RUN DoInvoiceInfo.

/* Only do two pages for demo purposes */
i_Counter = i_Counter + 1.
IF i_Counter = 2 THEN LEAVE.
END.

RUN pdf_close("Spdf").

/* ------------------- INTERNAL PROCEDURES ------------------------- */
PROCEDURE DoNewPage:
RUN pdf_new_page("Spdf").
RUN pdf_use_PDF_page("Spdf","Inv",1).
END.

PROCEDURE DoInvoiceInfo:

RUN pdf_set_font("Spdf","Helvetica",8).
RUN pdf_text_color("Spdf",1.0,0.0,0.0).

/* This procedure overlays the DB info on the external PDF form */
RUN pdf_text_xy ("Spdf",STRING(Invoice.InvoiceNum,"99999"),350,557).
RUN pdf_text_xy ("Spdf",STRING(Invoice.InvoiceDate,"99.99.9999"),350,546).
RUN pdf_text_xy ("Spdf",STRING(Invoice.CustNum,"99999"),350,535).

END.

Now the problem is that when run it, It show me this error:

Content-type: text/html n** "pdfextract.p" was not found

So I try to look for that file in the server but it's not there!!!

So how can I get it?


missing pdfextract?

pdfextract is in the pdfinclude distribution. strange that you don't have it...
depending on the version you are usoing you'll find it here: http://www.oehive.org/files/PDFinclude3.3.3.zip or here: http://websvn.oehive.org/filedetails.php?repname=pdfinclude&path=%2Ftrun... (last development version).
Just download it and drop it in the directlry where pdfinclude lies.
++