Split xps document to a4 pages to view in document viewer

Отвечено Split xps document to a4 pages to view in document viewer

  • 31 июля 2012 г. 10:00
     
     

    Hi,

    I have a large xps document i.e. 3000px by 3000px I want to be able to split this xps document in to a4 size pages and then merge in to one document so when loaded in to document viewer they are viewed as separate pages but of the same document.

    A4 paper = width: 1122px and height:793

    I have read up on pagination and fixed document but not quite sure on how to do this.

    Any code or tutorials on how to do this?

    Thanks

Все ответы

  • 1 августа 2012 г. 8:28
    Модератор
     
     Отвечено

    Hi Taus,

    I think this can be accomplished with the following steps, if you have problem in any of these steps, please feel free to let me know.

    1. Retrieve pages from the XPS.

    2. Create a FixedDocument.

    3. Create a FixedPage, add it to the FixedDocument.

    4. Add an A4-size Rectangle into the FixedPage.

    5. Create VisualBrush and use the first page of the XPS as a Visual.

    6  Set the VisualBrush's Viewbox to a A4-size rect and use it to paint the Rectangle element.

    7. Repeat Step 3-6 with different Viewbox until all sections in the first XPS page are painted.

    8. Repeat Step 3-7 for the rest of the XPS pages, until the entire document is converted.

    Best regards,

    Min


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us


  • 7 августа 2012 г. 7:02
    Модератор
     
     

    Hi Taus,
     
    I am marking your issue as "Answered", if you have new findings about your issue, please let me know.


    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.