Rendering PDF content in Windows Store apps

21

description

Rendering PDF content in Windows Store apps. Chetan Parulekar Principal Development Manager 3-175. Agenda. Introduction to the PDF APIs Rendering PDF as images Customizing your PDF rendering Best practices Rendering PDF to a DirectX surface. Introduction to the PDF APIs. Demo. - PowerPoint PPT Presentation

Transcript of Rendering PDF content in Windows Store apps

Page 1: Rendering PDF content in Windows Store apps
Page 2: Rendering PDF content in Windows Store apps

Rendering PDF content in Windows Store apps

Chetan ParulekarPrincipal Development Manager3-175

Page 3: Rendering PDF content in Windows Store apps

Introduction to the PDF APIsRendering PDF as imagesCustomizing your PDF renderingBest practicesRendering PDF to a DirectX surface

Agenda

Page 4: Rendering PDF content in Windows Store apps

Introduction to the PDF APIs

Page 5: Rendering PDF content in Windows Store apps

Introduction to the PDF APIs – a magazine app

Demo

Page 6: Rendering PDF content in Windows Store apps

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

Page 7: Rendering PDF content in Windows Store apps

Rendering PDF as images in your app

Page 8: Rendering PDF content in Windows Store apps

Rendering a PDF page in a Windows Store app

Demo

Page 9: Rendering PDF content in Windows Store apps

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

Page 10: Rendering PDF content in Windows Store apps

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

Page 11: Rendering PDF content in Windows Store apps

Customizing PDF rendering

Page 12: Rendering PDF content in Windows Store apps

Rendering PDF content at various zoom levels

Demo

Page 13: Rendering PDF content in Windows Store apps

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

Page 14: Rendering PDF content in Windows Store apps

Best practices when using PDF APIs

Page 15: Rendering PDF content in Windows Store apps

A sample app that demonstrates some best practices when using the PDF APIs

Demo

Page 16: Rendering PDF content in Windows Store apps

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

Page 17: Rendering PDF content in Windows Store apps

Rendering PDF to a DirectX surface

Page 18: Rendering PDF content in Windows Store apps

Rendering PDF content to a DirectX surface using SurfaceImageSource

Demo

Page 19: Rendering PDF content in Windows Store apps

ResourcesWindows 8.1 Preview SamplesWindows 8.1 Preview: New APIs and features for developers

Page 20: Rendering PDF content in Windows Store apps

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!

Page 21: Rendering PDF content in Windows Store apps

© 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.