Bug 689935 - Larger left margin after converting .PDF to .PCL
Summary: Larger left margin after converting .PDF to .PCL
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.60
Hardware: Other AIX
: P4 critical
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-04 02:59 UTC by Amanda
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amanda 2008-07-04 02:59:32 UTC
Dear Sir/Lady,

The left margin margin is more larger in .PCL file than in .PDF file after 
converting .PDF to PCL. So some content lost on the righ of the .PCL file.

I used below commands, and the left-margin in .PCL files they generated looks 
is exactly the same.

###### Commands: ########
$ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -
sOutputFile=XXPO_PRINT_1.PDF.pcl -c "<< /InputAttributes <<     
currentpagedevice /InputAttributes get {       pop null     } forall   >>  dup 
0 << /PageSize [ 595 842 ]  >> put dup 1 << /Margins [0 0] >> put dup 1 
<< /.HWMargins [0 0 0 0] >> put  >> setpagedevice" save pop -f 
XXPO_PRINT_739386_1.PDF

$ gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -
sOutputFile=XXPO_PRINT_1.PDF.pcl -c "<< /InputAttributes <<     
currentpagedevice /InputAttributes get {       pop null     } forall   >>  dup 
0 << /PageSize [ 595 842 ]  /Margins [-20 -20] /.HWMargins [0 0 0 0] >> put  
>> setpagedevice" save pop -f XXPO_PRINT_1.PDF

I don't know is left-margin can be recovered in command?
Would you please kindly give me some hints about this issue?


Thanks,
Comment 1 Alex Cherepanov 2008-07-04 17:25:27 UTC
You do everything right except that the margins are defined in the device
coordinate system. 20 pixels at 300 dpi corresponds to 1.7 mm.
Try to use large values.
Comment 2 Alex Cherepanov 2008-07-11 19:38:15 UTC
I don't know why this bug report get marked as REMIND.
Please confirm that large values of /Margins work.
Comment 3 Ray Johnston 2008-07-11 20:52:46 UTC
REMIND was a 'mis-click' I intended to close it as 'WORKSFORME'
Comment 4 eric 2008-07-22 02:00:16 UTC
Dear Sir/Lady,
    I have some issue, the pcl report lost 3 letter on the right of the .PCL 
file . i used below command,and the printer output can't change anything.
### Commands: #####
 
exec "$GS_EXECUTABLE" $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER  -sDEVICE=laserjet -
dORIENT1=true  "-sOutputFile=$outfile" $OPTIONS -c "<< /Input
Attributes <<     currentpagedevice /InputAttributes get {       pop null     } 
forall   >>  dup 0 << /PageSize [ 597.5 842.4 ]>> put dup 1<<
 /Margins [60 80]>> put dup 1 << /.HWMargins [0 0 0 0] >> put >> setpagedevice" 
save pop -f "$1"

 
How can i move the .PCL file to 3 letter left-margin ?

Thanks,
Comment 5 Ray Johnston 2008-07-22 08:11:03 UTC
In PostScript, Margins establish an 'unprintable' area on the page, but
this does NOT cause any shift of the image on the page. The default PostScript
[0,0] is the lower left hand corner of the page.

To shift the data you need to modify the 'initial matrix' using the Install
setpagedevice procedure. For example:

  << /Install { 15 20 translate } bind >> setpagedevice

will shift the data to the right by 15/72 inch and upwards by 20/72 inch.

This will allow you to shift the data on the page. If you need to also shrink
the pages, you can combine this with the 'scale' operator as in:

  << /Install { 15 20 translate .95 .90 scale } bind >> setpagedevice

Comment 6 eric 2008-07-22 20:59:10 UTC
Dear Sir/Lady,
   I change the command ,but the printer output can't change any,please check 
the my command.
#####command###
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A_T3.pdf.pcl -
c "<< /InputAttributes <<  currentpagedevice /InputAttributes get {       pop 
null     } forall   >>  dup 0 << /PageSize [ 595 842 ]>> put dup 1  <</Install 
{ 100 120 translate .50 .50 scale } bind >> put >> setpagedevice"   save pop -f 
A.pdf

Can you help me modify the command?

Thanks,
Comment 7 eric 2008-07-24 19:01:31 UTC
Dear Ray,
    Please help me check the command.

Thanks.
Comment 8 Amanda 2008-07-27 21:12:53 UTC
Dear Ray,

I met this issue as well and tested blow command, but didn't take effect.
The data never be transfer position no matter I set which value. 
#### e.g. ####
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A.pcl -c "-
sOutputFile=$outfile" $OPTIONS -c "  << /InputAttributes <<     
currentpagedevice /InputAttributes get {       pop null     } forall   >>  dup 
0 << /PageSize [ 597.5 842.4 ]>> put dup 1 << /Install { 1 1 translate } bind 
>> put >> setpagedevice" save pop -f A.PDF

Would you please give me some advices? 

Thanks a lot,
Comment 9 Amanda 2008-07-28 08:33:23 UTC
Dear Ray,

As you mentioned value "<< /Install { 15 20 translate } bind >> setpagedevice" 
would shift the data to the right by 15/72 inch and upwards by 20/72 inch.

If I need to shift the data to the left and downwards, how can I do? Set the 
value to be negative value? e.g " << /Install { -15 -20 translate } bind >> 
setpagedevice"
Is that right?

But I don't why in my test the data couldn't be shifted no matter which number 
I setted. I indeed could not see any data shift from the hard copy when I 
changed 'initial matrix' using the Install setpagedevice procedure.
#### e.g. one of my testing commands ####
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=laserjet -sOutputFile=A.pcl -c "-
sOutputFile=$outfile" $OPTIONS -c "  << /InputAttributes <<     
currentpagedevice /InputAttributes get {       pop null     } forall   >>  dup 
0 << /PageSize [ 597.5 842.4 ]>> put dup 1 << /Install { 72 100 translate } 
bind 
>> put >> setpagedevice" save pop -f A.PDF


Could you please tell me if my command incorrect? 
Or is there other parameter to control .PDF's data shift insteading 
of 'initial matrix'?

Best Regards,

Comment 10 Amanda 2008-07-29 18:31:01 UTC
Dear Alex,

Do you have any more advise for this issue?  Really thanks.

Best Regards,

Comment 11 Amanda 2008-07-30 18:43:04 UTC
Dear Ray, Alex,

You are right. According to your advices, the issue is fixed now. Thanks for 
your strong support.

Best Regards,