Load PDF and Print Details

Post Reply
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Load PDF and Print Details

Post 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,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: Load PDF and Print Details

Post by Manuel Valdenebro »

You can find a solution in the spanish forum

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

Manuel
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: Load PDF and Print Details

Post 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,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Load PDF and Print Details

Post 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
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: Load PDF and Print Details

Post 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.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Load PDF and Print Details

Post 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
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: Load PDF and Print Details

Post 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.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
Manuel Aranda
Posts: 561
Joined: Wed Oct 19, 2005 8:20 pm
Location: España

Re: Load PDF and Print Details

Post by Manuel Aranda »

Hola,
Aquí tienes un ejemplo de fusión de datos y formulario PDF:

http://www.ge.tt/21mzjFw/v/0?c
Un saludo,
Manuel

xH 1.2.3, FWH 14.09, BC++ 5.8.2, xVerce CW 1.0, PellesC
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: Load PDF and Print Details

Post by cdmmaui »

Gracias Manuel
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: Load PDF and Print Details

Post 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
Post Reply