Summary: | Orientation after convert from PDF to PCL | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Amanda <amuabei> |
Component: | PDF Interpreter | Assignee: | Alex Cherepanov <alex> |
Status: | NOTIFIED FIXED | ||
Severity: | critical | ||
Priority: | P3 | ||
Version: | 8.60 | ||
Hardware: | PC | ||
OS: | AIX | ||
Customer: | Word Size: | --- |
Description
Amanda
2008-06-24 03:03:18 UTC
While this may be "P1" to you, our bug tracker policy allows for the highest "free user" bug to be P3. I'll leave the 'critical' severity since we really don't use that field much. V. 8.60 is obsolete. Please try v. 8.62 . Please attach the sample PDF file to the bug report. Can you reproduce the problem on other devices, for instance tiffg4 ? Can you reproduce the problem on Linux or Windows ? Removing data from Customer: field, which is for licensed Artifex customers only. Dear Sir/Lady, The issue is ocurred on UNIX OS which is AIX 5.3.0.0. I tested devices such as ljet4, laserjet and tiffg4. The result is as following. 1. In my tests, I can see part of the content via PCLReader after converting the original PDF file to PCL by devices ljet4 and laserjet. The format of the hard copies looks like portrait. I used below two commands: $ gs -q -dNOPAUSE -dBATCH -dSAFER -dPDFDEBUG -dCCFONTDEBUG -dCFFDEBUG - dCMAPDEBUG -dDOCIEDEBUG -dEPSDEBUG -dFAPIDEBUG -dINITDEBUG -dPDFDEBUG - dPDFOPTDEBUG-dPDFWRDEBUG -dSETPDDEBUG -dSTRESDEBUG -dTTFDEBUG -dVGIFDEBUG - dVJPGDEBUG -sDEVICE=ljet4 -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl -c save pop -f XXPO_PRINT_739386_1.PDF > XXPO_PRINT_739386_1.debug.1057.ljet4.log $ gs -q -dNOPAUSE -dBATCH -dSAFER -dPDFDEBUG -dCCFONTDEBUG -dCFFDEBUG - dCMAPDEBUG -dDOCIEDEBUG -dEPSDEBUG -dFAPIDEBUG -dINITDEBUG -dPDFDEBUG - dPDFOPTDEBUG-dPDFWRDEBUG -dSETPDDEBUG -dSTRESDEBUG -dTTFDEBUG -dVGIFDEBUG - dVJPGDEBUG -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.1059.laserjet.pcl -c save pop -f XXPO_PRINT_739386_1.PDF > XXPO_PRINT_739386_1.debug.1059.laserjet.log 1) Uploaded the original PDF file XXPO_PRINT_739386_1.PDF. 2) Uploaded the final PCL file XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl and XXPO_PRINT_739386_1.PDF.1059.laserjet.pcl . 3) Uploaded the gostscript debug logs XXPO_PRINT_739386_1.debug.1057.ljet4.log and XXPO_PRINT_739386_1.debug.1059.laserjet.log 4) Uploaded the scanning copy of hardcopy of execute command 'lp -c <printer> XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl' which named scan0002_hardcopy_XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl.pdf 2. In the test, if I used device tiffg the PCL file which generated by gs8.60 can not be read. I can only see some characters via PCLReader. 1) Uploaded the final PCL file XXPO_PRINT_739386_1.PDF.1054.tiffg4.pcl. Thanks, Amanda Supplied above test... The command I used for device tiffg is $ gs -q -dNOPAUSE -dBATCH -dSAFER -dPDFDEBUG -dCCFONTDEBUG -dCFFDEBUG - dCMAPDEBUG -dDOCIEDEBUG -dEPSDEBUG -dFAPIDEBUG -dINITDEBUG -dPDFDEBUG - dPDFOPTDEBUG-dPDFWRDEBUG -dSETPDDEBUG -dSTRESDEBUG -dTTFDEBUG -dVGIFDEBUG - dVJPGDEBUG -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.1054.tiffg4.pcl -c save pop -f XXPO_PRINT_739386_1.PDF > XXPO_PRINT_739386_1.debug.1054.tiffg4.log 2) Uploaded the gostscript debug logs XXPO_PRINT_739386_1.debug.1054.tiffg4.log Thanks, Amanda Created attachment 4150 [details]
XXPO_PRINT_739386_1.PDF
The target PDF file which we used to test converting PDF to PCL and landscape
origination.
Created attachment 4151 [details]
XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl
The PCL file which generated by via gs8.60 using device ljet4
Created attachment 4152 [details]
XXPO_PRINT_739386_1.debug.1057.ljet4.log
The gostscript debug logs.
Created attachment 4153 [details]
scan0002_hardcopy_XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl.pdf
The scanning copy of hardcopy printed via printer.
Created attachment 4154 [details]
XXPO_PRINT_739386_1.PDF.1059.laserjet.pcl
Test2: The PCL file which generated by via gs8.60 using device laserjet.
Created attachment 4155 [details]
XXPO_PRINT_739386_1.debug.1059.laserjet.log
Test2: The gostscript debug logs.
Created attachment 4156 [details]
XXPO_PRINT_739386_1.PDF.1054.tiffg4.pcl
Test3: The PCL file which generated by via gs8.60 using device tiffg4
Created attachment 4157 [details]
XXPO_PRINT_739386_1.debug.1054.tiffg4.log
Test3: The gostscript debug logs.
Dear Sir/Lady, I also tested below commands referring http://bugs.ghostscript.com/show_bug.cgi?id=629335, but the issue still exists. Following are my test commands: $ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.laserjet.595.842.0.pcl - c "<< /InputAttributes << 0 << /PageSize [ 595 842 ] >> >> >> setpagedevice " save pop -f XXPO_PRINT_739386_1.PDF $ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.laserjet.595.842.90.pcl - c "<< /InputAttributes << 90 << /PageSize [ 595 842 ] >> >> >> setpagedevice " save pop -f XXPO_PRINT_739386_1.PDF $ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.laserjet.842.595.0.pcl - c "<< /InputAttributes << 0 << /PageSize [ 842 595 ] >> >> >> setpagedevice " save pop -f XXPO_PRINT_739386_1.PDF $ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.laserjet.842.595.90.pcl - c "<< /InputAttributes << 90 << /PageSize [ 842 595 ] >> >> >> setpagedevice " save pop -f XXPO_PRINT_739386_1.PDF Thanks, Amanda Comment on attachment 4152 [details]
XXPO_PRINT_739386_1.debug.1057.ljet4.log
This file must have high security.
Comment on attachment 4153 [details]
scan0002_hardcopy_XXPO_PRINT_739386_1.PDF.1057.ljet4.pcl.pdf
This file must have high security. It cannot be shared on the internet.
Dear Sir/Laday, I also tested following commands, but landscape orientation always can not get. $ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sPAPERSIZE=a4 - sOutputFile=XXPO_PRINT_739386_1.PDF.laserjet.Orientation.3.pcl - c "<</Orientation 3>> setpagedevice" save pop -f XXPO_PRINT_739386_1.PDF Thanks, This is not a bug but a configuration issue.
By default Ghostscript is configured to support any paper size i.e. behaves
as a roll-feed device with a very wide media. This works fine for device-
independent file generation but is not compatible with real devices.
To activate auto-rotation we need to take away the choices of output media
Ghostscript has. When Ghostscript deals with a number of predefined
media sizes it employs media matching policies as they are documented in the
PLRN. Media matching includes auto-rotation,
Please execute the following program before running your file.
<< /InputAttributes <<
currentpagedevice /InputAttributes get {
pop null
} forall
>>
% dup 1 << /PageSize [ 612 792 ] >> put % uncomment if needed
dup 0 << /PageSize [ 595 842 ] >> put
>> setpagedevice
Dear Sir/Lady,
Would you please kindly give some hint at how to execute this program?
I really don't know how to perform it.
>>>>>>>>Qoute:
>> Please execute the following program before running your file.
>> << /InputAttributes <<
>> currentpagedevice /InputAttributes get {
>> pop null
>> } forall
>> >>
>> % dup 1 << /PageSize [ 612 792 ] >> put % uncomment if needed
>> dup 0 << /PageSize [ 595 842 ] >> put
>> >> setpagedevice
Thanks a lot,
You can stuff the file into a string and execute it from -c option in the same way as you do now. Alternatively, save the file somewhere in the file system and run it before your print job. $ gs ... -sPAPERSIZE=a4 ... -f prefix.ps XXPO_PRINT_739386_1.PDF Thanks for handling this Alex. I'm going ahead and closing this. If there are any other questions from this fairly inexperienced user, I'll handle them. Dear Alex, According to your advice, the PCL printer can print PDF and landscape format now. Thank you very much. But there has a minor defect, that is as more as about 1 cm the left margin size in .PCL file than in .PDF file. So some content lost on the righ of the .PCL file. Would you please kindly give me some hints about this issue? Need I open a new bug about left-margin issue? Thanks, Please try to narrow the issue. - Does this happen with every PS file ? Try to run the following file. The file draws a diagonal lines on A4 paper in portrait orientation. The lines may not reach the corners because of the hardware margins but should point to the corners. %! <</PageSize [ 595 842 ]>> setpagedevice 0 0 moveto 595 842 lineto 595 0 moveto 0 842 lineto stroke showpage - Try to do the same with the landscape file and the prefix. %! <</PageSize [ 842 595 ]>> setpagedevice 0 0 moveto 842 595 lineto 0 595 moveto 842 0 lineto stroke showpage - Does this happen with every PDF file ? Convert the above programs to PDF using ps2pdf and print. Dear Alex, I'd like to explain that when we use pdf2ps to print the .PDF formated landscape on HP Laserjet printer, I get correct hard copies. More, I never need to change the gs command in the pdf2ps, it always works fine. But when I use pdf2pcl, at previously, I can only get portriat hard copies even when the .PDF file is landscape. Then, very thanks for your advices that make me can get landscape hard copies. But the data position on the hard copies move about one centimeter right comparing with the copies printed by pdf2ps. And the data position right moving cause some content in the right lost on the hard copies, so we have to move data 1 centimeter to the left. I guess while data moving one centimeter back to the left, PCL can print as same hard copies as PS, but that haven't come true. Then, answer your questions. 1. %! <</PageSize [ 595 842 ]>> setpagedevice This printed hard copies formated landscape via PCL, but the data on the hard copies moves right about one centimeter. It happens with every PDF and PCL file. Below is my test command: #### test command 1 : ##### gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A.pcl - c "<< /InputAttributes << currentpagedevice /InputAttributes get { pop null } forall >> dup 0 << /PageSize [ 595 842 ] >> put >> setpagedevice" save pop -f A.PDF #### test command 2 : ##### gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A.pcl - c "<< /InputAttributes << currentpagedevice /InputAttributes get { pop null } forall >> dup 0 %! << /PageSize [ 595 842 ] >> put >> setpagedevice" save pop -f A.PDF Using command 2, Gostscript return 'Unrecoverable error, exit code 1' 2. %! <</PageSize [ 842 595 ]>> setpagedevice This printed hard copies formated portrait via PCL, but the data on the hard copies moves right about one centimeter. It happens with every PDF and PCL file. Below is my test command: ######## gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A.pcl - c "<< /InputAttributes << currentpagedevice /InputAttributes get { pop null } forall >> dup 0 << /PageSize [ 842 595 ] >> put >> setpagedevice" save pop -f A.PDF 3. In my test, if printed PDF via PS, below command can print both landscape and portrait format. Never needs to change. It happens with every PDF and PS file. ######## gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite -sOutputFile=A.ps -c save pop -f A.PDF 4. Above testing results happen with every PDF and PCL file. Best Regards, Dear Alex, The issue is fixed now. I'd like to close this issue. Thanks for your strong support. Best Regards, |