RayCraftDocs
v1.0.3 raycraft.dev
On this page

PdfViewer

Complete

A viewer for every PDF version up to 2.0 (ISO 32000-2): continuous pages, zoom and rotation, thumbnails, bookmarks, search, text selection, links, annotations, form fields, layers, attachments, passwords (RC4 and AES-256), printing and spelling, grammar and logic checks. The parser, renderer and writer are part of RayCraft.Blazor.Office and have no third-party parts. _No live image: this control is described by text and the API table only._

Parameters

ParameterTypeDescription
AllowEditingbool
AllowFileTransferboolShows the buttons that open and download a file and accepts dropped files (default true).
AllowFormFillingboolShows form fields as inputs; the download button and GetFilledDocumentAsync then include the entered values (default true).
AllowPrintboolShows the print button; printing is also refused when the document does not allow it (default true).
AllowSearchboolShows the search button (default true).
AuthorNamestring
ClassstringExtra CSS classes added to the root element.
DataByte[]The PDF file content to show. Setting a new array loads it.
FileNamestringThe name used when the file is downloaded.
HeightstringHeight of the control as a CSS length (default 40rem).
IgnoredWordsIReadOnlyCollection<string>Words that are never reported as misspelled, such as names and product terms.
InitialPageintThe page shown first (1 is the first page).
LabelstringAccessible name of the viewer. Defaults to a localized PDF viewer.
MaxFileSizeInt64Largest file that can be opened, in bytes (default 150,000,000).
OcrEngineIPdfOcrEngine
OcrLanguagesIReadOnlyList<string>
PasswordstringThe password of a protected document. When empty or wrong, the viewer asks for it.
PdfFontsPdfFontSet
ProofingboolOffers checking the text for spelling, grammar and logic problems in English and Bulgarian (default true).
ShowMenuBarbool
ShowSidebarboolStarts with the side panel (thumbnails, bookmarks, attachments, layers) open.
ShowToolbarboolShows the toolbar (default true).
SignatureCaptionstring
SignatureProviderFunc<Task<IReadOnlyList<PdfSignaturePicture>>>
SigningCertificateX509Certificate2
SigningLocationstring
SigningReasonstring
SourcestringAddress of a PDF file, fetched by the browser (for example docs/sample.pdf).
StylestringInline style added to the root element.
ZoomstringThe start zoom: auto, fit-width (default), fit-page or a percentage such as 125.

Events

EventTypeDescription
OnEditedEventCallback<Byte[]>
OnFormChangedEventCallback<PdfFieldChange>Raised with the field name and the new value when a form field changes.
OnLoadedEventCallback<PdfDocument>Raised with the PdfDocument when a document has been opened.
OnNewEventCallback
OnPageChangedEventCallback<int>Raised with the visible page (1-based) when it changes.
OnSaveEventCallback<OfficeFileSave>
OnSaveAsEventCallback<OfficeFileSave>
OnSignatureDrawnEventCallback<Byte[]>Raised with the PNG of a drawn or typed signature (without the caption) when the user places it, so the application can keep it as the saved signature. OpenSignatureAsync() opens the signature dialog from outside.
OnSignedEventCallback<Byte[]>

Package

PdfViewer is part of RayCraft Complete. Package: RayCraft.Blazor.Complete. It comes from the private RayCraft feed and needs an active license. See Getting started.