2

I have a PDF, which I want to convert to PCL

I convert PDF to PCL using the following command: (gs 8.70)

    gswin32c.exe -q -dNOPAUSE -dBATCH \
       -sDEVICE=ljetplus -dDuplex=false -dTumble=false \
       -sPAPERSIZE=a4 -sOutputFile="d:\doc1.pcl" \
       -f"d:\doc1.pdf" -c -quit

When I view or print the output PCL, it is cropped. I would expect the output to start right at the edge of the paper (at least in the viewer).

Is there any to way get the whole output without moving the contents of the page away from the paper edge?

I tried the -dPDFFitpage option which works, but results in a scaled output.

Michi
  • 487
  • 5
  • 20
  • Is `ljetplus` a hard requirement for the PCL variant of your output? AFAIK, `ljetplus` is no longer officially supported by Artifex. I'm pretty sure if you use `-sDEVICE=pxlmono` you'd either (a) get correct output, or (b) can have a bug report accepted and acted upon. – Kurt Pfeifle Sep 19 '12 at 07:45

1 Answers1

1

You are using -sPAPERSIZE=a4. This causes the PCL to render for A4 sized media.

Very likely, your input PDF is made for a non-A4 size. That leaves you with 3 options:

  1. ...you either use that exact page size for the PCL too (which your printer possibly cannot handle),

  2. ...or you have to add -dPDFFitPage (as you tried, but didn't like),

  3. ...or you skip the -sPAPERSIZE=... parameter altogether (which most likely will automatically use the same as size as the PDF, and which your printer possibly cannot handle...)


Update 1:

In case ljetplus is not a hard requirement for your requested PCL format variant, you could try this:

gs  -sDEVICE=pxlmono   -o pxlmono.pcl   a4-fo.pdf
gs  -sDEVICE=pxlcolor  -o pxlcolor.pcl  a4-fo.pdf

Update 2:

I can confirm now that even the most recent version of Ghostscript (v9.06) cannot handle non-Letter page sizes for ljetplus output.

I'd regard this as a bug... but it could well be that it won't be fixed, even if reported at the GS bug tracker. However, the least that can be expected is that it will get documented as a known limitation for ljetplus output...

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
  • Hello Kurt, thank you for your suggestions. The PDF is made for 210mm x 297mm, which is size A4. At least I specified the page Master like that. The `-dPDFFitpage` option won't work, because I am printing on pre-printed forms. When I skip the `-sPAPERSIZE` parameter, I cannot see any difference in the PCL. My Printer could handle printing 3mm from the paper edge, but the PCL is already cropped when I view it on screen. – Michi Sep 18 '12 at 08:53
  • @Michi: This calls for a closer investigation. Can you provide a (link to a) sample PDF? (It would also be useful to see if the most current GS, version 9.06 creates a different result...) – Kurt Pfeifle Sep 18 '12 at 21:13
  • I uploaded a zip file containing a pdf, a pcl (converted from the pdf using conversion options from my question) and two screenshots how they appear on my screen. http://mjk.infotron.at/pdf_pcl.zip – Michi Sep 19 '12 at 06:45
  • 1
    The ljetplus device is still supported, as far as I know (its not a contributed device). However it looks like it only supports US Letter size media. I'll have to check with someone else to be sure, PCL is not my area really. – KenS Sep 19 '12 at 08:36
  • I forgot to say that Kurt is quite correct about the pxlmono device and that produces output which is correctly sized with -sPAPERSIZE=a4. – KenS Sep 19 '12 at 08:38
  • @Michi: You're lucky! You've triggered KenS' attention with your problem -- and KenS is a GS developer :-) – Kurt Pfeifle Sep 19 '12 at 09:17
  • @Kurt: I mark the question as resolved, pxlmono (and probably pxlcolor, too) solves the specific problem. ljetplus is a kind of a hard requirement, but I'll find a way to work around it. I tried pxlmono already but obviously my PCLViewer couldn't handle it (it showed an empty page), I didn't try printing, so I didn't follow it any longer, but printing works perfectly. Thank you! – Michi Sep 19 '12 at 10:08