locked
How to fit photo to the page when user changes the orientation?

    Question

  • Hi 

    I am implementing an app in WinJS, which needs to print photos with one photo per page, and the photo needs to be fit with the page's width/height, and be in the middle of the page with no margin.

    Problems:

    1. There are margins around the photo in photo preview in print charm bar. I did not find any solution to set the margins.

    2. If I choose the orientation(or change the media size) from Portrait to Landscape, some big photos are cut and divided into 2 pages or more.

    I tried 2 ways to implement it.

    One is normal HTML+CSS+WinJS, the other one is by printing template.

    For the first way, i did not find any function that can refresh the preview. It refreshes automatically when user changes the orientation or media size. The photo is cut and divided into 2 pages.

    For the second way, I found a function called "printer.invalidatePreview()", but it did not work. 

    I also tried the print sample. There is a scenario called App Options Customization, users can choose "Pictures only" option, but the preview does not response as well. 

    Any solution for this?

    Thanks!



    Sun Bin


    • Edited by Bin.Sun Tuesday, October 09, 2012 6:11 AM
    Tuesday, October 09, 2012 6:09 AM

All replies