Page 1 of 1

Load PDF and Print Details

Posted: Wed Sep 03, 2014 1:04 pm
by cdmmaui
Hello,

Is it possible to load a PDF document (see link below) and print data from FWH application in defined fields? If so, where can I see an example?

http://www.cbsa-asfc.gc.ca/publications ... es/ci1.pdf

Thank you,

Re: Load PDF and Print Details

Posted: Wed Sep 03, 2014 6:28 pm
by Manuel Valdenebro
You can find a solution in the spanish forum

http://forums.fivetechsupport.com/viewt ... f=6&t=4897

Re: Load PDF and Print Details

Posted: Wed Sep 03, 2014 8:50 pm
by cdmmaui
Hello,

Thank you for the link. However, where can I find a good example? The links on the post no longer work.

Sincerely,

Re: Load PDF and Print Details

Posted: Thu Sep 04, 2014 10:51 am
by dutch
My code for example.

Code: Select all

*-----------------------------------*
Function OpenPdf(cTempFile,cReport)
LOCAL oWnd, oPdf, arq

Default cReport := cTempFile

arq := ""

if PDFActivex(@arq) 
    DEFINE WINDOW oWnd TITLE cReport

    oPdf = TActiveX():New( oWnd, arq )  // "AcroPDF.PDF" )

    // oPdf:LoadFile := cTempFile
        oPdf:Do( "LoadFile", cTempFile )
    
    oWnd:oClient = oPdf

    ACTIVATE WINDOW oWnd MAXIMIZED ;
                ON INIT SETWINDOWPOS( oWnd:hWnd, -1, 0, 0, 0, 0, 3 ) ;
                VALID (oPdf:End(), .T. )
else
    MsgAlert('Acrobat Reader is not install !')
end
RETURN NIL

Re: Load PDF and Print Details

Posted: Fri Sep 05, 2014 4:13 pm
by cdmmaui
Hi Dutch,

Thank you. However I am looking to automatically transfer data from my FWH application to the PDF document. I do not want the user to have to re-enter data. I am looking to do a PDF Meld type transfer.

Re: Load PDF and Print Details

Posted: Mon Sep 08, 2014 7:36 pm
by James Bott
Darrell,

You might try what I have done in the past with TXT files.

Generate the PDF using whatever tool you have and include in it keywords for the fields you want to insert--something like [*field1*] (including the brackets and asterisks). This will be your form. Then load the entire file into a memory variable using memoread() or the binary functions if needed. Then do a search and replace for each of the fields using left() and right(). Then write the file out to a temp name and print it.

James

Re: Load PDF and Print Details

Posted: Mon Sep 08, 2014 7:41 pm
by cdmmaui
Hi James,

Thank you. Actually, I was able to use a third party application called Pdf Meld to transfer data from my FWH application to the PDF. It seems to be working well.

Re: Load PDF and Print Details

Posted: Tue Sep 09, 2014 8:25 pm
by Manuel Aranda
Hola,
Aquí tienes un ejemplo de fusión de datos y formulario PDF:

http://www.ge.tt/21mzjFw/v/0?c

Re: Load PDF and Print Details

Posted: Tue Sep 09, 2014 8:35 pm
by cdmmaui
Gracias Manuel

Re: Load PDF and Print Details

Posted: Tue Sep 09, 2014 9:28 pm
by mastintin
Aqui tienes un codigo publicado en el foro que lo hace mediante ole ( Adobe acrobat , ojo creo que no vale Reader )
http://forums.fivetechsupport.com/viewt ... 13#p154413