Printing a PDF using Brainy Data PDFDevice

Michael Mantkowski michaelj at clientrax.com
Thu Sep 2 14:42:37 UTC 2021


Hi Mayada,

Normally your report would be set with a specific paper setting by default
and these settings would be saved with the report.

We normally print to memory and view the report in an Omnis Report Field on
a window before printing it or saving it as a PDF with PDF Device.  The
"Load Page setup" gets the saved paper settings from the report and sets
them up for this print.  I also have a whole set of generic report formats
setup to just store page settings for various categories of reports so that
I can use its printer and papers settings for 95% of my printing methods.
If I want my invoices to go to a specific printer with letter size for
example but want my daily reports to go to another printer and print in
landscape format.



;Print Report
Calculate $cdevice as kDevMemory
Set report name MyReport
Begin reversible block
    Load page setup
End reversible block
Print report
Open Preview Window


; Save to PDF
Do FileOps.$putfilename(ivPDFfile,'Save As',con('*','.pdf'),ivPDFfile)
Returns #F
If flag false
    Quit method 
End If
;  Get final location
Do FileOps.$splitpathname(ivPDFfile,lvDrv,lvDir,lvFile,lvExt) Returns
lvError
Do code method CodeClass/SaveLastPDFPath (con(lvDrv,lvDir))

Begin reversible block
    Calculate $cdevice as kDevPdf
End reversible block
Do $cdevice.$setparam(kDevPdfConvLinks,kTrue)
Do $cdevice.$setparam(kDevPdfFileName,ivPDFfile)

Do $cinst.$objs.ReportField.$redirect(kFalse) Returns lvError


*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************


-----Original Message-----
From: omnisdev-en On Behalf Of malkishtini at gmail.com
Sent: Thursday, September 2, 2021 10:23 AM
To: 'OmnisDev List - English' <omnisdev-en at lists.omnis-dev.com>
Subject: RE: Printing a PDF using Brainy Data PDFDevice

Hi Phil,

Thank you for your response.
I found this page property on the report and on the $root of Omnis as well
and I figured that this might be what I need to change at runtime.
I have to play with it and see how to change it based on user pref.

Thank you and best regards,
Mayada

-----Original Message-----
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of
Phil (OmnisList) via omnisdev-en
Sent: Thursday, September 02, 2021 9:41 AM
To: omnisdev-en at lists.omnis-dev.com
Cc: Phil (OmnisList) <phil at pgpotter.co.uk>
Subject: Re: Printing a PDF using Brainy Data PDFDevice

Hi Mayada,

For Omnis reports, you set the page setup to what you want on the individual
report...
in Property manager
So I guess paper would be set to kPaUsLegal ?

not forgetting to load page setup before printing.

You could probably set it via notation before the instance is generated, if
it changes...

I tend to use oWrite these days, so slightly different, but still you set
the page paper size within the report in oWrite as well.

regards
Phil Potter
Based in Chester in the UK.

On 02/09/2021 13:35, malkishtini at gmail.com wrote:
> Hello all,
> I'm using Brainy Data PDFDevice to print an Omnis report to a PDF in
memory in studio 10.
> The PDF document that gets created will always be in "letter" size, is
there a way to change the paper size of the created doc to "Legal" when
printing from an API?
>
> Thank you,
> Mayada
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com Start a 
> new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com Start a new
message -> mailto:omnisdev-en at lists.omnis-dev.com 

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com Start a new
message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list