Rendering PDF content in Windows Store apps
description
Transcript of Rendering PDF content in Windows Store apps
Rendering PDF content in Windows Store apps
Chetan ParulekarPrincipal Development Manager3-175
Introduction to the PDF APIsRendering PDF as imagesCustomizing your PDF renderingBest practicesRendering PDF to a DirectX surface
Agenda
Introduction to the PDF APIs
Introduction to the PDF APIs – a magazine app
Demo
OverviewImplementation derives from the ISO 32000-1 standards
Abstracts away all the format complexity from the developer
Focus is on rendering of PDF content as an image
APIs enable reading scenarios such as magazines
PDF APIs in Windows 8.1 Preview
Rendering PDF as images in your app
Rendering a PDF page in a Windows Store app
Demo
In summaryThe PDF APIs allow you to render individual pages of a PDF document into streams as images
The default rendering occurs with:• 100% page size• White as the page background color• PNG as the image encoding format
Rendering PDF as images in your app
Working with password-protected PDF files
Use the LoadFromFileAsync(file, password) or LoadFromStreamAsync(stream, password) APIs with the password string parameter
Rest of your code remains the same
Rendering PDF as images in your app
Customizing PDF rendering
Rendering PDF content at various zoom levels
Demo
In summaryUse PDFPageRenderingOptions along with the RenderToStreamAsync API
Customization options include:• Output resolution• High contrast• Page region to be rendered• Image encoding format• Background color
Customizing the rendering
Best practices when using PDF APIs
A sample app that demonstrates some best practices when using the PDF APIs
Demo
Best practicesUse techniques such as UI virtualization to render only pages in and around the view
Hold on to rendered pages if one needs to re-render them
Release pages that are no longer needed
Cancel page renderings that are superseded
Render only required portions of the page
Best practices when using PDF APIs
Rendering PDF to a DirectX surface
Rendering PDF content to a DirectX surface using SurfaceImageSource
Demo
ResourcesWindows 8.1 Preview SamplesWindows 8.1 Preview: New APIs and features for developers
Evaluate this session
Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.