locked
Print problem in SematicZoom with FlipView

All replies

  • I would guess no one else would have this problem since it seems something you modified causes the crash.

    Where is it crashing?  How can we reproduce the issue?

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, September 6, 2012 1:13 PM
    Moderator
  • Hi, jpsanders.

    Here is the flipview code

    // Custom timeline control
    
    var ZoomableView = WinJS.Class.define(function (flipview) {
        // Constructor
    
        this._flipview = flipview;
    }, {
        // Public methods
    
        getPanAxis: function () {
            return this._flipview._getPanAxis();
        },
    
        configureForZoom: function (isZoomedOut, isCurrentView, triggerZoom, prefetchedPages) {
            this._flipview._configureForZoom(isZoomedOut, isCurrentView, triggerZoom, prefetchedPages);
        },
    
        setCurrentItem: function (x, y) {
            this._flipview._setCurrentItem(x, y);
        },
    
        getCurrentItem: function () {
            return this._flipview._getCurrentItem();
        },
    
        beginZoom: function () {
            this._flipview._beginZoom();
        },
    
        positionItem: function (/*@override*/item, position) {
            return this._flipview._positionItem(item, position);
        },
    
        endZoom: function (isCurrentView) {
            this._flipview._endZoom(isCurrentView);
        },
    
        handlePointer: function (pointerId) {
            this._flipview._handlePointer(pointerId);
        }
    });
    
    WinJS.Namespace.define("HP", {
        FlipView: WinJS.Class.define(function (element, options) {
            this._element = element;
            this._flipview = document.createElement('div');
            this._flipview_wincontrol = new WinJS.UI.FlipView(this._flipview);
            this._element.appendChild(this._flipview);
    
            this._element.winControl = this;
        }, {
            zoomableView: {
                get: function () {
                    if (!this._zoomableView) {
                        this._zoomableView = new ZoomableView(this);
                    }
                    return this._zoomableView;
                }
            },
            _getPanAxis: function () {},
            _configureForZoom: function (isZoomedOut, isCurrentView, triggerZoom, prefectchedPages) {},
            _setCurrentItem: function (x, y) {},
            _beginZoom: function () {},
            _getCurrentItem: function () {},
            _positionItem: function (/*@override*/item, position) {},
            _endZoom: function (isCurrentView, setFocus) {},
            _handlePointer: function (pointerId) {}
        })
    });

    and i set it to the html page:

                        <div id="-SlideShow-sezoDiv"
                            data-win-control="WinJS.UI.SemanticZoom"
                            data-win-options="{ zoomFactor: 0.5, initiallyZoomedOut: false ,enableButton :true}">
                            <div id="-SlideShow-Container-zi" class="flipView" data-win-control="HP.FlipView">
                            </div>
                            <div id="-SlideShow-Container-zo" class="flipView" data-win-control="HP.FlipView">
                            </div>
                        </div>


    Last , i have register a print function in js code.

            var printManager = Windows.Graphics.Printing.PrintManager.getForCurrentView();
            printManager.onprinttaskrequested = onPrintTaskRequested;
    
        function onPrintTaskRequested(printEvent) {
           var printTask = printEvent.request.createPrintTask("Print", function (args) {
                args.setSource(MSApp.getHtmlPrintDocumentSource(document));
            });
            printTask.options.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.copies);
            printTask.options.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.mediaSize);
            printTask.options.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.orientation);
            printTask.options.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.duplex);
    
            printTask.options.mediaSize = Windows.Graphics.Printing.PrintMediaSize.isoA4;
        }

    When i want to print the page , the app will crash.

    I can send you the code .

    Friday, September 7, 2012 6:53 AM
  • Please contact me here and we can arrange for you repro project (if you can get it to me today)

    http://blogs.msdn.com/jpsanders/contact.aspx


    Jeff Sanders (MSFT)

    Friday, September 7, 2012 11:46 AM
    Moderator