Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining multiple PDFs into one
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01656035
Message ID:
01656042
Views:
51
Yes, You can.

Alternative way is using append mode:
USE demoreps\invoices ORDER customer
LOCAL m.loSession, m.lnRetval
m.loSession = XFRX("XFRX#LISTENER")
m.lnRetval = loSession.SetParams("output.pdf",,,,,,"PDF")
IF m.lnRetval = 0
   REPORT FORM report1 OBJECT m.loSession
ELSE
   ? m.lnRetval
ENDIF

* one hour later
m.loSession = XFRX("XFRX#LISTENER")
m.lnRetval = loSession.SetParams("output.pdf",,,,,,"PDF",,,,.T.)

*https://eqeuscom.atlassian.net/wiki/spaces/DOC/pages/25821220/Properties+and+methods+common+in+XFRXListener+and+XFRXSession+classes#PropertiesandmethodscommoninXFRXListenerandXFRXSessionclasses-Setparams()
* parameter tuAppend

IF m.lnRetval = 0
   REPORT FORM report2 OBJECT m.loSession
ELSE
   ? m.lnRetval
ENDIF
>>>Hi,
>>>
>>>I am working on a routine that will create a number of PDF files. Each PDF is FRX report converted via a XFRX. Each FRX is a Form/Order. Therefore, it is not possible for me to combine various FRX into one.
>>>If I wanted to have all these PDF to be in one PDF, would it be possible to do from VFP application?
>>>
>>>TIA
>>
>>Hi Dmitry,
>>
>>You can combine more reports into one output file:
>>
>>USE demoreps\invoices ORDER customer
>>LOCAL m.loSession, m.lnRetval
>>m.loSession= xfrx("XFRX#INIT")
>>m.lnRetVal = m.loSession.SetParams("output.pdf",,,,,,"PDF")
>>IF m.lnRetVal = 0
>>   m.loSession.ProcessReport("report1")
>>   m.loSession.ProcessReport("report1")
>>   m.loSession.ProcessReport("report2")
>>   m.loSession.finalize()
>>ELSE
>>   ? m.lnRetVal
>>ENDIF
>>
>>
>>
>>
>>USE demoreps\invoices ORDER customer
>>LOCAL m.loSession, m.lnRetval
>>m.loSession = XFRX("XFRX#LISTENER")
>>m.lnRetval = loSession.SetParams("output.pdf",,,,,,"PDF")
>>IF m.lnRetval = 0
>>   REPORT FORM report1 OBJECT m.loSession NOPAGEEJECT
>>   REPORT FORM report1 OBJECT m.loSession NOPAGEEJECT
>>   REPORT FORM report2 OBJECT m.loSession
>>ELSE
>>   ? m.lnRetval
>>ENDIF
>>
>>
>>MartinaJ
>
>Hi Martina,
>
>First, thank you very much. I have a follow up question. Do you know if I could have some code between each REPORT FORM in your example above? For example,
>
>IF m.lnRetval = 0
>   *-- Code here that creates a cursor for Report1
>   REPORT FORM report1 OBJECT m.loSession NOPAGEEJECT
>   *-- Code here that creates a cursor for Rpoert2
>   REPORT FORM report1 OBJECT m.loSession NOPAGEEJECT
>   *-- Code here that creates a cursor for Report3
>   REPORT FORM report2 OBJECT m.loSession
>ELSE
>   ? m.lnRetval
>ENDIF
>
>
>See the line *-- Code here above
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform