Skip to main content
13-Aquamarine
September 4, 2022
Solved

Script/mapkey to Print to PDF a specific view of a part

  • September 4, 2022
  • 2 replies
  • 7439 views

I tried (in CREO 3.0) to create a mapkey that would go through these steps:

1) Click FILE --> PRINT --> click Quick Print

2) this brings up the PRINT windows, with Printer Name set to Microsoft Print to PDF

3) Click PROPERTIES

4) Click ADVANCED

5) PAPER SIZE: change from LETER to TABLOID

6) Click OK to close Advanced Options window

7) Click OK to close Document Properties window

8.) Click OK to close PRINT window

9) The "Save Print Output As" window opens
10) Type in File name: zzzz.pdf

11) Click SAVE button.

Problem is that the mapkey registration of commands stops at the Quick PRINT window and does not register any more clicks after that...
mapkey p= @MAPKEY_NAMEPrint to PDF, LANDSCAPE, ledger paper size.;\
mapkey(continued) @MAPKEY_LABELPRINT_LANDSCAPE_PDF;~ Close `main_dlg_cur` `appl_casc`;\
mapkey(continued) ~ Command `ProCmdQuickPrint`;

The default printer on my laptop is Microsoft Print to PDF, and the default is set to TABLOID size, but this does not seem to matter for CREO 3.0, it always defaults to LETTER in [Quick] Print. It may have to do with the box named PAPER AVAILABLE, which shows LETTER all the time and I could not find any way to change that to say TABLOID.
I tried everything on my laptop, from a Windows/system perspective, to make CREO 3.0 default to TABLOID.

So now I am left with making a script for CREO, but it seems that the mapkey register mechanism has its limitations (or I am not using it right).
Any suggestions?

Best answer by cgherghe-2

I figured out that once you get to the various printers, you actually leave CREO and land in Microsoft Windows' court. The change I need must be made on the operating system side, and it seems to be a Windows bug where the paper size (set at the printer level) does not propagate to any other apps than MS apps (and even for MS apps is not working). So this is not an issue with CREO, but with the operating system.

2 replies

tbraxton
22-Sapphire II
22-Sapphire II
September 4, 2022

I think it will be easier for you to use the File-> Save As-> PDF option if you want to do this using a mapkey. You can create export profiles (.dop extension) for the specific PDF settings you need and retrieve them as needed. Set up your PDF export setting(s) once and then use them with a mapkey sequence going forward as required.

 

Is there a reason you are not able to use save as PDF to accomplish this?

13-Aquamarine
September 4, 2022

Truth is I do not know how to create export profiles, and I cannot control the color, width and quality of the line when I save as PDF.

In Quick Print I can play with table.pnt and I get enough leverage to achieve decent quality in the image files I produce (mind you, it is a lot of work there too, since it is relatively difficult to frame the desired zoomed view in the printed page, and then I have to convert the PDF to an image file using ImageMagick, but at least I get good drawings out if this convoluted process). 

With Save As option I get very feeble light gray lines, and I do not know where to go to control that...

I would appreciate it very much if you could shed more light on the subject.

24-Ruby III
September 5, 2022

@cgherghe-2 wrote:

Truth is I do not know how to create export profiles, and I cannot control the color, width and quality of the line when I save as PDF.

In Quick Print I can play with table.pnt and I get enough leverage to achieve decent quality in the image files I produce (mind you, it is a lot of work there too, since it is relatively difficult to frame the desired zoomed view in the printed page, and then I have to convert the PDF to an image file using ImageMagick, but at least I get good drawings out if this convoluted process). 

With Save As option I get very feeble light gray lines, and I do not know where to go to control that...

I would appreciate it very much if you could shed more light on the subject.


Hi,

if you want to apply pentable to save as PDF command, you have to put following options in config.pro (see lines used by me)

use_8_plotter_pens yes
pen_table_file E:\users\creo7_parametric\tabulka_per.pnt
pdf_use_pentable YES

 

cgherghe-213-AquamarineAuthorAnswer
13-Aquamarine
September 12, 2022

I figured out that once you get to the various printers, you actually leave CREO and land in Microsoft Windows' court. The change I need must be made on the operating system side, and it seems to be a Windows bug where the paper size (set at the printer level) does not propagate to any other apps than MS apps (and even for MS apps is not working). So this is not an issue with CREO, but with the operating system.

1-Visitor
September 17, 2022

It is a property, an "characteristic", not necessarily a problem.

 

You can use automation script to click that "print" button.

The paper size and plot can be pre-determined using configuration option.

 

I actually created a script that automatically print a drawing with correct paper size.

For example, with the script running, if I press Alt P, an A4-sized drawing will be automatically printed to an A4 paper, no other setting needed.

With automation script, I can also print all drawings of components in an assembly.

 

For PDF, I recommend using the PDF export functionality of Creo.