cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to remove border from print using laserjetv4 in pcf file.

mvitárius
15-Moonstone

How to remove border from print using laserjetv4 in pcf file.

Hello,

 

I want automate printing drawings in creo, which mostly works fine with our printer but there is a huge white border around while I use laserjetv4 printer type. Obviously I can't use MS_PRINTER_MANAGER if I want to automate the whole process. I attached my .pcf file for reference but it doesn't really look like that it has anything to do with it.

Only the "plotter" settings seems to affect the border. Anyone can help me with this problem?

ACCEPTED SOLUTION

Accepted Solutions

At the end of the day I had to go with your 2nd suggestion, to simulate a click on the print dialog box. I use vb.net for automation and here is the code if anyone ever needs it:

 

 

Imports System.Runtime.InteropServices

Dim hWndAbout As IntPtr = FindWindowExW(IntPtr.Zero, IntPtr.Zero, Nothing, "Print") 
        Dim hWndOkButton As IntPtr = FindWindowExW(hWndAbout, IntPtr.Zero, "Button", "Ok")
        SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero)
        SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero)

 

 

Source is from: Microsoft forum , the rest of the code is at the bottom of the thread. Not really the best solution for my original problem, but as close to it I could get.

 

View solution in original post

11 REPLIES 11

Hello, 

 

I want automate printing drawings in creo, which mostly works fine with our printer but there is a huge white border around while I use laserjetv4 printer type. Obviusly I can't use MS_PRINTER_MANAGER if I want to automate the whole process. I attached my .pcf file for reference but it doesn't really look like that it has anything to do with it.

Only the "plotter" settings seems to affect the border. Anyone can help me with this problem?

 

 

You didn't attach your file. Here is the contents of a b-size.pcf we use to print to our shared printer:

plotter postscript
plotter_command windows_print_manager \\company-server\SHARP MX-M314N
plot_names yes
paper_size b
plot_segmented no
plot_scale fit_paper
plot_stroke_text YES

perhaps one of the lines in this will help (maybe "plot_scale fit_paper")?

mvitárius
15-Moonstone
(To:KenFarley)

Sorry, I attached the files now, I did try to that option with no luck.


@mvitárius wrote:

Hello,

 

I want automate printing drawings in creo, which mostly works fine with our printer but there is a huge white border around while I use laserjetv4 printer type. Obviously I can't use MS_PRINTER_MANAGER if I want to automate the whole process. I attached my .pcf file for reference but it doesn't really look like that it has anything to do with it.

Only the "plotter" settings seems to affect the border. Anyone can help me with this problem?


Hi,

I guess that the problem is related to laserjet4V printer type.

  • Creo generates plot data in HPGL-2 format when laserjet4V printer is used
  • AFAIK when printer processes HPGL-2 data, it is not able to draw lines up to the edge of the paper

Suggestions:

  • if your printer is able to process Postscript data, then set plotter postscript option in your pcf file, the result should be better
  • automate MS_PRINTER_MANAGER printing using AutoIt software

 


Martin Hanák

Postscript gives the same border as as laserjetv4 in the preview, is it possible that the printed document has less border? I'll try to download postscript drivers and try it. I really want to avoid Autolt and alike programs for this, it just seem like an unnecessary step.


@mvitárius wrote:

Postscript gives the same border as as laserjetv4 in the preview, is it possible that the printed document has less border? I'll try to download postscript drivers and try it. I really want to avoid Autolt and alike programs for this, it just seem like an unnecessary step.


Hi,

in your place I would try the following...

  • save plot into file with plotter laserjet4v
  • save plot into file with plotter postscript
  • send file to printer using copy filename.ext \\path_to_printer

 


Martin Hanák

Same result, I'm pretty sure the output file has the border already.

At the end of the day I had to go with your 2nd suggestion, to simulate a click on the print dialog box. I use vb.net for automation and here is the code if anyone ever needs it:

 

 

Imports System.Runtime.InteropServices

Dim hWndAbout As IntPtr = FindWindowExW(IntPtr.Zero, IntPtr.Zero, Nothing, "Print") 
        Dim hWndOkButton As IntPtr = FindWindowExW(hWndAbout, IntPtr.Zero, "Button", "Ok")
        SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero)
        SendMessageW(hWndOkButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero)

 

 

Source is from: Microsoft forum , the rest of the code is at the bottom of the thread. Not really the best solution for my original problem, but as close to it I could get.

 

mvitárius,

The first question is: does your printer support printing to the edge of the paper? Try testing by printing from other programs (print a MS Word document with 0" borders). Most printers don't support printing to the edge of the paper OOTB because they don't want to contaminate the components of the printer with ink. Look at your printer documentation to determine the maximum print area per supported paper/page size. Plotters can typically print "full" size because the print role sizes are larger than the standard drawing format sizes.

 

Also, you're printing a large size format onto a smaller page size from within Creo Parametric.  The down scaling itself will produce larger than expected "borders" because the down scaling will scale x & y by the same ratio to avoid distortion.   The down scaling isn't a "best fit" scaling.  Try creating your print full size (the output from Creo Parametric is full size), and then use a command line utility to print the files with specific printer settings (like printing "best fit").  Windows does offer command line controls of printer settings (printui.dll, etc.).

 

Regards,

Dan N.

mvitárius
15-Moonstone
(To:dnordin)

The printer is fine, because if I use MS_PRINT_MGR and use the dialog box to print, it prints just fine, also as long as the preview is fine, the print is fine too. (Maybe I should mention that even than there is a border, but it is just small one)

 

Also, you're printing a large size format onto a smaller page size from within Creo Parametric.  The down scaling itself will produce larger than expected "borders" because the down scaling will scale x & y by the same ratio to avoid distortion. 


As long as it is just as small as it is with MS_PRINT_MGR I'm fine with it, but it is not.

 

 creating your print full size (the output from Creo Parametric is full size), and then use a command line utility to print the files with specific printer settings (like printing "best fit").


This is what I did: Printed to a file, then print it with a command line below. The result is the same.

 

Print [/d:<PrinterName>] [<Drive>:][<Path>]<FileName>[ ...]

 

I'm not sure I'm doing it right, because it is exactly what Creo does with the plotter_command line.

Announcements


Top Tags