PdfViewer

Overview

PdfViewer is a class in Aspose.PDF FOSS for .NET. Inherits from: IFacade, System.IDisposable.

Façade for viewing / printing a PDF document.

This class provides 35 methods for working with PdfViewer objects in .NET programs. Available methods include: BindPdf, Close, ClosePdfFile, DecodeAllPages, DecodePage, Dispose, GetDefaultPageSettings, GetDefaultPrinterSettings, OpenPdfFile, PdfViewer, PrintDocument, PrintDocumentWithSettings, and 4 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: AutoResize, AutoRotate, AutoRotateMode, CoordinateType, FormPresentationMode, HorizontalAlignment, and 13 more.

Properties

NameTypeAccessDescription
AutoResizeboolRead/WriteGets or sets the auto resize.
AutoRotateboolRead/WriteGets or sets the auto rotate.
AutoRotateModeAutoRotateModeRead/WriteGets or sets the auto rotate mode.
CoordinateTypePageCoordinateTypeRead/WriteGets or sets the coordinate type.
FormPresentationModeFormPresentationModeRead/WriteGets or sets the form presentation mode.
HorizontalAlignmentHorizontalAlignmentRead/WriteGets or sets the horizontal alignment.
VerticalAlignmentVerticalAlignmentRead/WriteGets or sets the vertical alignment.
PageCountintReadNumber of pages in the bound document, or 0 when nothing is bound.
PasswordstringRead/WriteOwner password used when opening encrypted documents via OpenPdfFile(string).
PrintAsGrayscaleboolRead/WriteGets or sets the print as grayscale.
PrintAsImageboolRead/WriteGets or sets the print as image.
PrintPageDialogboolRead/WriteWhen true, PrintDocumentWithSetup would surface the OS print dialog.
PrintStatusobjectReadAlways returns null in this build; printing is not implemented.
PrinterJobNamestringRead/WriteGets or sets the printer job name.
RenderingOptionsAspose.Pdf.RenderingOptionsRead/WriteGets or sets the rendering options.
ResolutionintRead/WriteTarget rasterisation DPI consulted by viewer-level rendering (the Decode methods throw, so this is currently configuration-only).
ScaleFactorfloatRead/WriteGets or sets the scale factor.
ShowHiddenAreasboolRead/WriteGets or sets the show hidden areas.
UseIntermidiateImageboolRead/WriteGets or sets the use intermidiate image.

Methods

SignatureDescription
PdfViewer()Calls PdfViewer on this PdfViewer instance.
PdfViewer(document: Document)Calls PdfViewer(document) on this PdfViewer instance.
BindPdf(srcDoc: Document)Loads a PDF from a file path into the viewer
BindPdf(srcFile: string)Calls BindPdf(srcFile) on this PdfViewer instance.
BindPdf(srcStream: Stream)Calls BindPdf(srcStream) on this PdfViewer instance.
OpenPdfFile(filePath: string)Calls OpenPdfFile(filePath) on this PdfViewer instance.
OpenPdfFile(inputStream: Stream)Calls OpenPdfFile(inputStream) on this PdfViewer instance.
Close()Calls Close on this PdfViewer instance.
ClosePdfFile()Calls ClosePdfFile on this PdfViewer instance.
Dispose()Calls Dispose on this PdfViewer instance.
Save(destFile: string)Calls Save(destFile) on this PdfViewer instance.
Save(destStream: Stream)Calls Save(destStream) on this PdfViewer instance.
DecodePage(pageNumber: int)Always throws: the viewer does not produce Bitmap objects; render via ImageDevice (SkiaSharp-backed) instead.
DecodeAllPages()Always throws: see DecodePage(int).
GetDefaultPageSettings()Returns a fresh, empty PageSettings.
GetDefaultPrinterSettings()Returns a fresh, empty PrinterSettings.
PrintDocument()Sends the currently bound PDF to the default printer
PrintDocumentWithSettings(printerSettings: PrinterSettings)Calls PrintDocumentWithSettings(printerSettings) on this PdfViewer instance.
PrintDocumentWithSettings(pageSettings: PageSettings, printerSettings: PrinterSettings)Calls PrintDocumentWithSettings(pageSettings, printerSettings) on this PdfViewer instance.
PrintDocumentWithSetup()Calls PrintDocumentWithSetup on this PdfViewer instance.
PrintDocuments(documents: Document[])Calls PrintDocuments(documents) on this PdfViewer instance.
PrintDocuments(filePaths: string[])Calls PrintDocuments(filePaths) on this PdfViewer instance.
PrintDocuments(documentStreams: Stream[])Calls PrintDocuments(documentStreams) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, documents: Document[])Calls PrintDocuments(printerSettings, documents) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, filePaths: string[])Calls PrintDocuments(printerSettings, filePaths) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, documentStreams: Stream[])Calls PrintDocuments(printerSettings, documentStreams) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, pageSettings: PageSettings, documents: Document[])Calls PrintDocuments(printerSettings, pageSettings, documents) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, pageSettings: PageSettings, filePaths: string[])Calls PrintDocuments(printerSettings, pageSettings, filePaths) on this PdfViewer instance.
PrintDocuments(printerSettings: PrinterSettings, pageSettings: PageSettings, documentStreams: Stream[])Calls PrintDocuments(printerSettings, pageSettings, documentStreams) on this PdfViewer instance.
PrintLargePdf(filePath: string)Calls PrintLargePdf(filePath) on this PdfViewer instance.
PrintLargePdf(inputStream: Stream)Calls PrintLargePdf(inputStream) on this PdfViewer instance.
PrintLargePdf(filePath: string, printerSettings: PrinterSettings)Calls PrintLargePdf(filePath, printerSettings) on this PdfViewer instance.
PrintLargePdf(inputStream: Stream, printerSettings: PrinterSettings)Calls PrintLargePdf(inputStream, printerSettings) on this PdfViewer instance.
PrintLargePdf(filePath: string, pageSettings: PageSettings, printerSettings: PrinterSettings)Calls PrintLargePdf(filePath, pageSettings, printerSettings) on this PdfViewer instance.
PrintLargePdf(inputStream: Stream, pageSettings: PageSettings, printerSettings: PrinterSettings)Calls PrintLargePdf(inputStream, pageSettings, printerSettings) on this PdfViewer instance.

See Also