Using Xps Common Scenarios in Xps. Overview PrintingLoadingSerializingManipulating.
-
Upload
savana-parmley -
Category
Documents
-
view
253 -
download
0
Transcript of Using Xps Common Scenarios in Xps. Overview PrintingLoadingSerializingManipulating.
Using XpsUsing Xps
Common Scenarios in XpsCommon Scenarios in Xps
OverviewOverview
PrintingPrintingLoadingLoadingSerializingSerializingManipulatingManipulating
Session GoalsSession Goals
Outline Common ScenariosOutline Common Scenarios
Highlight Developer ChoicesHighlight Developer Choices
Warn of Common MistakesWarn of Common Mistakes
PrintingPrinting
PrintDialogPrintDialog XpsDocumentWriterXpsDocumentWriter
SimpleSimple Controlled/AdvancedControlled/Advanced
SynchronousSynchronous AsynchronousAsynchronous
Works in Partial TrustWorks in Partial Trust Special Case for Special Case for Partial TrustPartial Trust
No Access to Print No Access to Print TicketsTickets Access to Print TicketsAccess to Print Tickets
Print QueuePrint Queue
Entry point to advanced printingEntry point to advanced printing
Can be accessed from the Print Can be accessed from the Print DialogDialog
Access to Print CapabilitiesAccess to Print Capabilities
Access to StatusAccess to Status
Access to default Print TicketAccess to default Print Ticket
Asynchronous PrintingAsynchronous Printing
Progress call backsProgress call backs
Cancel call backsCancel call backs
Completion callbacksCompletion callbacks
Print TicketPrint Ticket
Reading user settings from Print Reading user settings from Print TicketsTickets
Associating print tickets during Associating print tickets during printingprinting
Acquiring default Print ticketsAcquiring default Print tickets
No Print Ticket in Partial TrustNo Print Ticket in Partial Trust
De-serialization does not maintain De-serialization does not maintain print ticketsprint tickets
Orientation and LayoutOrientation and Layout
Objects may need to be translated to Objects may need to be translated to fit in the visible area.fit in the visible area.
XPS Serialization does not re-layout XPS Serialization does not re-layout based on orientationbased on orientation
The drawing is clipped to the union of The drawing is clipped to the union of the viewable area and the rectangle the viewable area and the rectangle defined by the fixed page size.defined by the fixed page size.
Some OptionsSome OptionsTransform the Fixed PageTransform the Fixed Page
Re-Layout the Fixed PageRe-Layout the Fixed Page
Loading XpsLoading Xps
Deferred LoadingDeferred Loading
Using the Package StoreUsing the Package Store
Using Xaml ParserUsing Xaml Parser
Deferred LoadingDeferred Loading
Documents and Pages are loaded on Documents and Pages are loaded on accessaccess
The Fixed Class maintain only weak The Fixed Class maintain only weak referencesreferences
Package StorePackage Store
The Package Store prevents the need to The Package Store prevents the need to continually re-open the Package to access continually re-open the Package to access the internal parts.the internal parts.
Keep documents open until though Keep documents open until though displaying them.displaying them.
Creating an Xps Document with a stream Creating an Xps Document with a stream requires the user to manage the Package requires the user to manage the Package StoreStore
Loading Xps Documents with out the Loading Xps Documents with out the package in the Package store works but is package in the Package store works but is very slow.very slow.
SerializationSerialization
Write once “Fixed” contentWrite once “Fixed” content
Fonts are sub-setFonts are sub-set
Some Fonts are restrictedSome Fonts are restricted
Documents can be interleaved for Documents can be interleaved for simultaneous production and simultaneous production and consumptionconsumption
Font SubsettingFont Subsetting
All the needed fonts are stored in the All the needed fonts are stored in the document.document.
Only the needed glyphs are stored in Only the needed glyphs are stored in the fonts.the fonts.
Printing might need different levels of Printing might need different levels of granularity on sub-settinggranularity on sub-setting
Restricted FontsRestricted Fonts
Licensing Right IntentLicensing Right IntentInstallable embeddingInstallable embeddingRestricted license embedding Restricted license embedding –– Relationship RelationshipPreview and print embedding - ObfuscatedPreview and print embedding - ObfuscatedEditable embeddingEditable embeddingNo subsetting No subsetting Bitmap embedding only Bitmap embedding only –– glyphs converted to images glyphs converted to images
InterleavingInterleaving
Triggered by opening document with Triggered by opening document with Write access.Write access.
Used for simultaneous generation and Used for simultaneous generation and consumption.consumption.
““Image Last” option designed for Web Image Last” option designed for Web consumptionconsumption
Processing Xps DocumentsProcessing Xps Documents
DisplayingDisplaying
SigningSigning
MergingMerging
Generating ThumbnailsGenerating Thumbnails
Displaying Xps Displaying Xps ComponentsComponents
Simple – DocumentViewerSimple – DocumentViewer
Pages are Visuals that can be Pages are Visuals that can be displayed through visual brushesdisplayed through visual brushes
SigningSigning
Acquiring a certificateAcquiring a certificate
Iterating the Signature DefinitionsIterating the Signature Definitions
Effectively using IsSignableEffectively using IsSignable
Testing if a signature is validTesting if a signature is valid
MergingMerging
New documents can be created from New documents can be created from other documentsother documents
This technique only works if the This technique only works if the source documents are serialized (not source documents are serialized (not formed in memory)formed in memory)
Generating ThumbnailsGenerating Thumbnails
Create a bitmap of a page by render Create a bitmap of a page by render to targetto target
Encode the bitmap to a jpeg using Encode the bitmap to a jpeg using encodersencoders
Write the stream to an Xps ThumbnailWrite the stream to an Xps Thumbnail
© 2006 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.