FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Load PDF and Print Details
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Load PDF and Print Details
Posted: Wed Sep 03, 2014 01:04 PM
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/forms-formulaires/ci1.pdf

Thank you,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: Load PDF and Print Details
Posted: Wed Sep 03, 2014 06:28 PM

You can find a solution in the spanish forum

viewtopic.php?f=6t=4897

&

Un saludo



Manuel
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Load PDF and Print Details
Posted: Wed Sep 03, 2014 08:50 PM

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
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Load PDF and Print Details
Posted: Thu Sep 04, 2014 10:51 AM
My code for example.
Code (fw): Select all Collapse
*-----------------------------------*
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 2304 / 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)
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Load PDF and Print Details
Posted: Fri Sep 05, 2014 04:13 PM

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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Load PDF and Print Details
Posted: Mon Sep 08, 2014 07:36 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Load PDF and Print Details
Posted: Mon Sep 08, 2014 07:41 PM

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
Posts: 610
Joined: Wed Oct 19, 2005 08:20 PM
Re: Load PDF and Print Details
Posted: Tue Sep 09, 2014 08:25 PM

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 23.07 32 bits, BC++ 7.4, xVerce CW 1.0, PellesC
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Load PDF and Print Details
Posted: Tue Sep 09, 2014 08:35 PM

Gracias Manuel

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: Load PDF and Print Details
Posted: Tue Sep 09, 2014 09:28 PM

Aqui tienes un codigo publicado en el foro que lo hace mediante ole ( Adobe acrobat , ojo creo que no vale Reader )

viewtopic.php?f=6t=25369p=154413#p154413

&&

Continue the discussion