Printing to a PDF File

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Printing to a PDF File

Post by MGOLDFARB »

Hi. When printing, if the user selects the printer ADOBE PDF WRITER, the default name that shows up for the PDF file is HMG PRINT SYSTEM.PDF.

Anyone know a way to change the default name in this case?

Thanks.

Mark
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Printing to a PDF File

Post by mol »

You should start printing with:

Code: Select all

cNameOfPrinterJob := "Any title"
START PRINTDOC name cNameOfPrinterJob
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Printing to a PDF File

Post by MGOLDFARB »

It works! Thank you!

Mark
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Printing to a PDF File

Post by MGOLDFARB »

Using the printer dialogue option, is there a way to force the landscape button to be checked? Or does the user need to do this?

I am currently selecting printer as follows:
select printer dialog preview

Mark
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Printing to a PDF File

Post by Rathinagiri »

Since the printer option dialog is not in the control of HMG, I am afraid it would not be possible. However, if you always print in landscape in that printer, you can do so by change the orientation setting in the default printer options in windows.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: Printing to a PDF File

Post by IMATECH »

Or just create a PDF page as Landscape
using HMGHPDF library in HFCL to export to PDF
thanks to Sr.Rathinagiri :)

Code: Select all

#define HPDF_ORIENT_PORTRAIT   1
#define HPDF_ORIENT_LANDSCAPE  2

Regards
Last edited by IMATECH on Mon Nov 19, 2012 6:40 pm, edited 1 time in total.
M., Ronaldo

By: IMATECH

Imation Tecnologia
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Printing to a PDF File

Post by MGOLDFARB »

Can I create a PDF directly from the print system of HMG? Up to now I have been just choosing my Adobe PDF (or compatible) printer to create the PDF file.

On a related topic (printing that is)....
When the printer dialogue comes up, if I click on CANCEL, instead of going back to the application I get an HMG error:
HMG 3.0.44 (2012.09.03)
Non top modal windows can't be released. Program terminated.

Any ideas what I can change to avoid this error?

Thanks.

Mark
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Printing to a PDF File

Post by Rathinagiri »

Can I create a PDF directly from the print system of HMG?
While the direct answer to this question is 'no', you can use HMGHPDF library in HFCL to export to PDF.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
MGOLDFARB
Posts: 71
Joined: Thu Jun 21, 2012 7:46 am

Re: Printing to a PDF File

Post by MGOLDFARB »

Thanks.

Any suggestions to the second part of my question...
When the printer dialogue comes up, if I click on CANCEL, instead of going back to the application I get an HMG error:
HMG 3.0.44 (2012.09.03)
Non top modal windows can't be released. Program terminated.

Any ideas what I can change to avoid this error?
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Printing to a PDF File

Post by Rathinagiri »

Please use the following code:

Code: Select all

lSuccess := .f.
select printer dialog to lSuccess preview

if .not. lSuccess
   // printer dialog was cancelled
   return nil
endif

start printdoc
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply