#2 setpagedevice with rotated pdf

open-fixed
nobody
None
8
2001-08-02
2001-07-05
Jack Moffitt
No

Customer #680

When the test file is rendered, things look normal,
when rotated the right side of the rectangle is
clipped. Run the pdf using the following postscript to
reproduce the problem:

<< /InputAttributes << 0 << /PageSize [613 487] >> >>
/PageSize [613 487]
/Policies << /PageSize 5>>
>> setpagedevice

<< /ViewerPreProcess { dup length dict copy
dup /PageSize undef
dup /InputAttributes undef
dup /Install undef
dup /BeginPage undef
dup /Policies undef
dup /HWResolution undef }
>> setpagedevice

(new_rect.pdf) run

The pdf is attached.

The problem was original reported with gs6.12, but I
also see this behavior on HEAD from CVS.

Discussion

  • Jack Moffitt
    Jack Moffitt
    2001-07-05

     
    Attachments
    • labels: 101039 -->
    • milestone: 102536 -->
    • assigned_to: rayjj --> nobody
    • status: open --> open-fixed
     
  • Logged In: YES
    user_id=11206

    The match_page_size logic does not honor Orientation requests
    that would rotate the page in a way that the PageSize request
    does not match an available PageSize in the InputAttributes
    list.

    The ViewerPreProcess procedure that this user applied was
    removing the /PageSize entry from the request dictionary so
    the match_page_size function assumed that the orientation
    was correct and no rotation was appropriate.

    The workaround is to modify the ViewerPreProcess logic so
    that if /Orientation is defined in the request, and is an
    odd value (1 or 3) exchange the page dimensions.

    A modified VewerPreProcess that seems to take care of
    the customer's needs is:

    <<
    /ViewerPreProcess {
    dup length dict copy
    dup /PageSize undef
    dup /InputAttributes undef
    dup /Install undef
    dup /BeginPage undef
    dup /Policies undef
    dup /HWResolution undef
    dup /Orientation .knownget {
    dup type /nulltype eq 1 index 0 lt or 1 index 3 gt or not {
    2 index /PageSize get
    aload pop
    [
    {
    2 array astore 2 index exch /PageSize exch put
    }
    {
    exch 2 array astore 2 index exch /PageSize exch put
    }
    ]
    3 index 1 and get exec
    pop
    }
    { pop }
    ifelse
    } if
    }
    >>
    setpagedevice