Class PDFViewWPF
Inheritance
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class PDFViewWPF : ContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IDisposable
Constructors
PDFViewWPF()
default PDFViewWPF
constructor
Declaration
public PDFViewWPF()
Fields
CurrentDocumentProperty
Indicates the CurrentDocument property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty CurrentDocumentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentPageNumberProperty
Indicates the CurrentPageNumber property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty CurrentPageNumberProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentPagePresentationModeProperty
Indicates the CurrentPagePresentationMode property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty CurrentPagePresentationModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentPageViewModeProperty
Indicates the CurrentPageViewMode property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty CurrentPageViewModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DefaultPageColorProperty
Indicates the DefaultPageColor property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty DefaultPageColorProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DrawAnnotationsProperty
Indicates the DrawAnnotations property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty DrawAnnotationsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FitThinLinesToPixelGridProperty
Indicates the FitThinLinesToPixelGrid property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty FitThinLinesToPixelGridProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
GammaFactorExponentProperty
Indicates the GammaFactorExponent property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty GammaFactorExponentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HighlightFieldsProperty
Indicates the HighlightFields property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty HighlightFieldsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HorizontalScrollBarVisibilityProperty
Indicates the HorizontalScrollBarVisibility property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty HorizontalScrollBarVisibilityProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HorizontalScrollPositionProperty
Indicates the HorizontalScrollPosition property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty HorizontalScrollPositionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsPageBorderVisibileProperty
Indicates the IsPageBorderVisible property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty IsPageBorderVisibileProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ProgressiveRenderingIntervalProperty
Indicates the ProgressiveRenderingInterval property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty ProgressiveRenderingIntervalProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
StrokeAdjustThinLinesProperty
Indicates the StrokeAdjustThinLines property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty StrokeAdjustThinLinesProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseAntiAliasingProperty
Indicates the UseAntiAliasing property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseAntiAliasingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseCachingProperty
Indicates the UseCaching property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseCachingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseImageSmoothingProperty
Indicates the UseImageSmoothing property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseImageSmoothingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UsePageTransperencyGridProperty
Indicates the UsePageTransperencyGrid property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UsePageTransperencyGridProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UsePathHintingProperty
Indicates the UsePathHinting property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UsePathHintingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseProgressiveRenderingProperty
Indicates the UseProgressiveRendering property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseProgressiveRenderingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseRightToLeftLanguageProperty
Indicates the UseRightToLeftLanguage property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseRightToLeftLanguageProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
UseURLExtractionProperty
Indicates the UseURLExtraction property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty UseURLExtractionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
VerticalScrollBarVisibilityProperty
Indicates the VerticalScrollBarVisibility property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty VerticalScrollBarVisibilityProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
VerticalScrollPositionProperty
Indicates the VerticalScrollPosition property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty VerticalScrollPositionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
VisualScrollBarWidthProperty
This property is used by the PDFViewWPF to do some internal calculations relating converting between screen and page coordinates. Set this only if you have changed the implicit style so that the width of a ScrollBar in a ScrollViewer has changed. Provide the PDFViewWPF with the new value so that calculations are correct.
Declaration
public static readonly DependencyProperty VisualScrollBarWidthProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ZoomProperty
Indicates the Zoom property of the PDFViewWPF object.
Declaration
public static readonly DependencyProperty ZoomProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
ConvertedPages
Gets the number of pages that have been converted since starting the conversion with OpenUniversalDocument
Declaration
public int ConvertedPages { get; }
Property Value
Type | Description |
---|---|
int |
CurrentDocument
Gets or sets the current document as a PDFDoc object..
Declaration
public PDFDoc CurrentDocument { get; set; }
Property Value
Type | Description |
---|---|
PDFDoc |
CurrentPageNumber
Gets or sets the currently active page number.
Declaration
public int CurrentPageNumber { get; set; }
Property Value
Type | Description |
---|---|
int |
CurrentPagePresentationMode
Declaration
public PDFViewWPF.PagePresentationMode CurrentPagePresentationMode { get; set; }
Property Value
Type | Description |
---|---|
PDFViewWPF.PagePresentationMode |
CurrentPageViewMode
Declaration
public PDFViewWPF.PageViewMode CurrentPageViewMode { get; set; }
Property Value
Type | Description |
---|---|
PDFViewWPF.PageViewMode |
DefaultPageColor
Declaration
public Color DefaultPageColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
DesiredLinearDeceleration
Gets or sets the rate the linear movement slows in device-independent units (1/96th inch per unit) per squared millisecond.
Declaration
public double DesiredLinearDeceleration { get; set; }
Property Value
Type | Description |
---|---|
double |
DrawAnnotations
Gets or sets a boolean value indicating whether annotation objects are drawn or not.
Declaration
public bool DrawAnnotations { get; set; }
Property Value
Type | Description |
---|---|
bool |
FitThinLinesToPixelGrid
Gets or sets a value indicating whether thin lines will be fit to the pixel grid.
Declaration
public bool FitThinLinesToPixelGrid { get; set; }
Property Value
Type | Description |
---|---|
bool |
GammaFactorExponent
Declaration
public double GammaFactorExponent { get; set; }
Property Value
Type | Description |
---|---|
double |
HighlightFields
Gets or sets a boolean value indicating whether fields will be highlighted in the display.
Declaration
public bool HighlightFields { get; set; }
Property Value
Type | Description |
---|---|
bool |
HorizontalScrollBarVisibility
Declaration
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisibility |
HorizontalScrollPosition
Declaration
public double HorizontalScrollPosition { get; set; }
Property Value
Type | Description |
---|---|
double |
IsConverting
Gets whether or not the PDFViewWPF is currently converting a document to PDF. Use the OnConversionChanged event to detect changes to this property
Declaration
public bool IsConverting { get; }
Property Value
Type | Description |
---|---|
bool |
IsPageBorderVisible
Gets or sets a boolean indicating whether the page border is visible.
Declaration
public bool IsPageBorderVisible { get; set; }
Property Value
Type | Description |
---|---|
bool |
PixelsPerUnitWidth
Gets or sets the number of pixels per unit width or height. This will be used to determine the resolution of the PDFViewWPF in order to make sure that the PDF document is rasterized at a resolution that corresponds to the device's pixel density, as opposed to the device-independent size of the PDFViewWPF.
For example, if shape with width 96 covers 120 pixels on the screen, then set this value to 120/96 = 1.25.
Declaration
public double PixelsPerUnitWidth { get; set; }
Property Value
Type | Description |
---|---|
double |
ProgressiveRenderingInterval
Gets or sets the interval in milliseconds, at which progressive rendering is performed. This property is effective only when UseProgressiveRendering is set to true.
Declaration
public int ProgressiveRenderingInterval { get; set; }
Property Value
Type | Description |
---|---|
int |
StrokeAdjustThinLines
Gets or sets a boolean value indicating whether the stroke will be adjusted for thin lines.
Declaration
public bool StrokeAdjustThinLines { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseAntiAliasing
Gets or sets a boolean indicating whether anti-aliasing is used while rendering the document.
Declaration
public bool UseAntiAliasing { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseCaching
Gets or sets a boolean value indicating whether caching is used.
Declaration
public bool UseCaching { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseImageSmoothing
Gets or sets a boolean value indicating whether image smoothing will be applied to images.
Declaration
public bool UseImageSmoothing { get; set; }
Property Value
Type | Description |
---|---|
bool |
UsePageTransperencyGrid
Gets or sets a boolean value indicating whether a page transparency grid will be used.
Declaration
public bool UsePageTransperencyGrid { get; set; }
Property Value
Type | Description |
---|---|
bool |
UsePathHinting
Gets or sets a boolean value indicating whether path hinting will be used.
Declaration
public bool UsePathHinting { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseProgressiveRendering
Gets or sets a boolean value to indicating whether progressive rendering will be used or not.
Declaration
public bool UseProgressiveRendering { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseRightToLeftLanguage
Gets or sets a boolean value indicating whether right-to-left is turned on for the current document.
Declaration
public bool UseRightToLeftLanguage { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseURLExtraction
Declaration
public bool UseURLExtraction { get; set; }
Property Value
Type | Description |
---|---|
bool |
VerticalScrollBarVisibility
Declaration
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisibility |
VerticalScrollPosition
Declaration
public double VerticalScrollPosition { get; set; }
Property Value
Type | Description |
---|---|
double |
VisualScrollBarWidth
This property is used by the PDFViewWPF to do some internal calculations relating converting between screen and page coordinates. Set this only if you have changed the implicit style so that the width of a ScrollBar in a ScrollViewer has changed. Provide the PDFViewWPF with the new value so that calculations are correct.
Declaration
public double VisualScrollBarWidth { get; set; }
Property Value
Type | Description |
---|---|
double |
Zoom
Declaration
public double Zoom { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
Activate()
Reactivates the PDFViewWPF after a call to Deactivate. Rendering, FindText, thumbnail requests, etc, will not work until the PDFViewWPF has been reactivated.
Declaration
public void Activate()
CanViewerScrollDown()
Returns whether or not the viewer can scroll downward.
Declaration
public bool CanViewerScrollDown()
Returns
Type | Description |
---|---|
bool | true if there is space below the view port. |
CanViewerScrollLeft()
Returns whether or not the viewer can scroll left.
Declaration
public bool CanViewerScrollLeft()
Returns
Type | Description |
---|---|
bool | true if there is space to the left of the view port. |
CanViewerScrollRight()
Returns whether or not the viewer can scroll right.
Declaration
public bool CanViewerScrollRight()
Returns
Type | Description |
---|---|
bool | true if there is space to the right of the view port. |
CanViewerScrollUp()
Returns whether or not the viewer can scroll upward.
Declaration
public bool CanViewerScrollUp()
Returns
Type | Description |
---|---|
bool | true if there is space above the view port. |
CancelAllThumbRequests()
Cancels all thumbnail requests initiated by GetThumbAsync(int pageNum). See GetThumbAsync(int pageNum) for more information.
Declaration
public void CancelAllThumbRequests()
CancelFindText()
Cancels the current find text job, if there is one.
Declaration
public void CancelFindText()
CancelRendering()
Cancels rendering in progress. If PDFViewCtrl is not busy rendering the page, the function has no side effects.
Declaration
public void CancelRendering()
ClearSelection()
Remove any text selection.
Declaration
public void ClearSelection()
ClearThumbCache()
Remove all thumbnails from the persistent disk cache.
Declaration
public void ClearThumbCache()
CloseDoc()
Closes the document currently opened in PDFViewWPF.
Declaration
public void CloseDoc()
ConvCanvasPtToPagePt(ref double, ref double, int)
Converts a point expressed in canvas space to a point on a page space.
Declaration
public void ConvCanvasPtToPagePt(ref double x, ref double y, int page_num)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of the canvas point |
double | y | x coordinate of the canvas point |
int | page_num | the page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one. |
ConvCanvasPtToScreenPt(ref double, ref double)
Converts a point expressed in canvas space to a point in sceen space.
Declaration
public void ConvCanvasPtToScreenPt(ref double x, ref double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of canvas point. |
double | y | x coordinate of canvas point. |
ConvPagePtToCanvasPt(ref double, ref double, int)
Converts a point expressed in a page space to a point in canvas space.
Declaration
public void ConvPagePtToCanvasPt(ref double x, ref double y, int page_num)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of the page point |
double | y | y coordinate of the page point |
int | page_num | the page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one. |
ConvPagePtToScreenPt(ref double, ref double, int)
Converts a point in a page space to a point in screen space.
Declaration
public void ConvPagePtToScreenPt(ref double x, ref double y, int page_num)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of the page point |
double | y | y coordinate of the page point |
int | page_num | the page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one. |
ConvScreenPtToCanvasPt(ref double, ref double)
Converts a point expressed in screen space to a point in canvas space.
Declaration
public void ConvScreenPtToCanvasPt(ref double x, ref double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of screen point. |
double | y | y coordinate of screen point. |
ConvScreenPtToPagePt(ref double, ref double, int)
Converts a point in screen space to a point in a page space.
Declaration
public void ConvScreenPtToPagePt(ref double x, ref double y, int page_num)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of the screen point |
double | y | y coordinate of the screen point |
int | page_num | the page number for the page used as the origin of the destination coordinate system. Negative values are used to represent the current page. Pages are indexed starting from one. |
CopySelectedTextToClipboardAsUnicode()
Copys the text current selected text to clipboard as unicode.
Declaration
public void CopySelectedTextToClipboardAsUnicode()
Deactivate()
This will stop rendering and then remove any content that is not visible on the screen. Use Activate to reactivate the PDFViewWPF.
Declaration
public void Deactivate()
Dispose()
Declaration
public override sealed void Dispose()
Dispose(bool)
Declaration
protected virtual void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
DocLock(bool)
Locks the PDFDoc instance used by PDFViewCtrl.
Simultaneous access to a PDFDoc instance is not allowed. Since PDFViewCtrl renders a PDFDoc in a rendering thread, UI access to the same PDFDOc instance should lock the document first and then unlock it with DocUnlock afterwards.
Declaration
public void DocLock(bool cancel_rendering)
Parameters
Type | Name | Description |
---|---|---|
bool | cancel_rendering | If true, rendering thread is canceled first before trying to lock the document. This ensures a quick return from this function. Otherwise, this function can halt the UI and the app may be unresponsive before the rendering thread finishes. If the rendering thread is canceled, unlocking the document DocUnlock will restart the rendering thread. |
DocLockRead()
Locks the PDFDoc instance used by PDFViewCtrl to prevent competing write threads (using Lock()) from accessing the document at the same time. Other reader threads however, will be allowed to access the document. Threads attempting to obtain write access to the document will wait in suspended state until the thread that owns the lock calls doc.UnlockRead().
Declaration
public void DocLockRead()
Remarks
To avoid deadlocks obtaining a write lock while holding a read lock is not permitted and will throw an exception. If this situation is encountered please either unlock the read lock before the write lock is obtained or acquire a write lock (rather than read lock) in the first place.
DocTryLock()
Tries to lock the PDFDoc instance used by PDFViewCtrl in non-blocking manner.
Declaration
public bool DocTryLock()
Returns
Type | Description |
---|---|
bool | true if the lock was successfully acquired, false otherwise |
DocTryLock(int)
Tries to lock the PDFDoc instance used by PDFViewCtrl in non-blocking manner.
Declaration
public bool DocTryLock(int milliseconds)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | The maximum amount of time in milliseconds to wait for the lock to become available. The default is 0. |
Returns
Type | Description |
---|---|
bool | true if the lock was successfully acquired, false otherwise |
DocTryLockRead()
Tries to obtain a read lock for the PDFDoc instance used by PDFViewCtrl for reading in non-blocking manner.
Declaration
public bool DocTryLockRead()
Returns
Type | Description |
---|---|
bool | true if the lock was successfully acquired, false otherwise |
DocTryLockRead(int)
Tries to obtain a read lock for the PDFDoc instance used by PDFViewCtrl for reading in non-blocking manner.
Declaration
public bool DocTryLockRead(int milliseconds)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | The maximum amount of time in milliseconds to wait for the lock to become available. The default is 0. |
Returns
Type | Description |
---|---|
bool | true if the lock was successfully acquired, false otherwise |
DocUnlock()
Unlocks the PDFDoc instance used by PDFViewCtrl and restarts the rendering thread if it was canceled by calling DocLock.
Declaration
public void DocUnlock()
DocUnlockRead()
Removes the read lock from the PDFDoc instance used by PDFViewCtrl
Declaration
public void DocUnlockRead()
DragResizeAnnot(Annot, uint, double, double, double, double)
Moves and resizes the specified annotation, using the given parameters. This method is for UI manipulation only. Calling this method will not modify the underlying document.
Declaration
public void DragResizeAnnot(Annot annot, uint pageNumber, double width, double height, double deltaX, double deltaY)
Parameters
Type | Name | Description |
---|---|---|
Annot | annot | The Annot object whose corresponding UI element needs to be manipulated. |
uint | pageNumber | The page number on whuch the annotation is located. |
double | width | The new width of the annotation. |
double | height | The new height of the annotation. |
double | deltaX | The change in the X coordinate of the position of the left edge of the annotation bounding box The new position is calculated as the sum of the old position and the delta value. |
double | deltaY | The change in the Y coordinate of the position of the left edge of the annotation bounding box The new position is calculated as the sum of the old position and the delta value. |
ExecuteAction(Action)
Requests action object to be executed by PDFViewCtrl. Action must belong to the document currently displayed in PDFViewCtrl.
Declaration
public void ExecuteAction(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | object that is to be executed. |
ExecuteAction(ActionParameter)
Requests action object to be executed by PDFViewCtrl. Action must belong to the document currently displayed in PDFViewCtrl.
Declaration
public void ExecuteAction(ActionParameter action_param)
Parameters
Type | Name | Description |
---|---|---|
ActionParameter | action_param | Action bound with its related information, such as field. |
FindText(string, bool, bool, bool, bool)
Selects text by searching for a given string of text.
Declaration
public void FindText(string str, bool match_case, bool match_whole_word, bool search_up, bool reg_exp)
Parameters
Type | Name | Description |
---|---|---|
string | str | the text to be found |
bool | match_case | specify whether to match case |
bool | match_whole_word | specify whether to match the whole word |
bool | search_up | specify whether to search from the end towards the begining |
bool | reg_exp | specify whether to use regular expression |
Remarks
This function runs in asynchronous mode: it launches a search thread and returns immediately. The result of a text search will be raised in the
GetAnnotationAt(double, double)
Gets the annotation at the (x, y) position expressed in screen coordinates.
Declaration
public Obj GetAnnotationAt(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate of the screen point |
double | y | y coordinate of the screen point |
Returns
Type | Description |
---|---|
Obj | The annotation closest to the point. If no annotation was found, it returns a null pointer. |
GetCanvas()
Gets a canvas that is hosted in the main scrolling window of the PDFViewWPF This lets you add shapes or widgets on top of the PDFViewWPF content
Declaration
public Canvas GetCanvas()
Returns
Type | Description |
---|---|
Canvas | The current active Canvas |
GetCanvasHeight()
Gets the height of the space occupied by pages.
Declaration
public double GetCanvasHeight()
Returns
Type | Description |
---|---|
double | The height of the space occupied by pages. |
GetCanvasWidth()
Gets the width of the space occupied by pages.
Declaration
public double GetCanvasWidth()
Returns
Type | Description |
---|---|
double | The width of the space occupied by pages. |
GetColorPostProcessMode()
Declaration
public PDFRasterizer.ColorPostProcessMode GetColorPostProcessMode()
Returns
Type | Description |
---|---|
PDFRasterizer.ColorPostProcessMode | the current color post processing mode. |
GetCurrentPage()
Gets the current page displayed in the view.
Declaration
public int GetCurrentPage()
Returns
Type | Description |
---|---|
int | the current page displayed in the view. |
GetDoc()
Gets Currently associated document with this PDFViewWPF.
Declaration
public PDFDoc GetDoc()
Returns
Type | Description |
---|---|
PDFDoc | Currently associated document with this PDFViewWPF. |
GetExtendedCanvasHeight()
Gets the height of the Canvas, including gray space.
Declaration
public double GetExtendedCanvasHeight()
Returns
Type | Description |
---|---|
double | the height of the Canvas, including gray space. |
GetExtendedCanvasWidth()
Gets the width of the Canvas, including gray space.
Declaration
public double GetExtendedCanvasWidth()
Returns
Type | Description |
---|---|
double | the width of the Canvas, including gray space. |
GetFindTextProgress()
Returns the progress of the FindTextAsync
Declaration
public int GetFindTextProgress()
Returns
Type | Description |
---|---|
int | A number between 0 and 100, indicating the progress |
GetHScrollPos()
Gets the current horizontal scroll position in scrollable space.
Declaration
public double GetHScrollPos()
Returns
Type | Description |
---|---|
double | the current horizontal scroll position. |
GetLinkAt(int, int)
Gets the link info at a given point, specified in client space.
Declaration
public PDFViewWPF.LinkInfo GetLinkAt(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | the x position in client space |
int | y | the y position in client space |
Returns
Type | Description |
---|---|
PDFViewWPF.LinkInfo | link information or null if no link is found in the queried location. |
Remarks
To get valid links, Url extraction must be set to true before setting the document.
GetOCGContext()
Declaration
public Context GetOCGContext()
Returns
Type | Description |
---|---|
Context |
GetPageCount()
Gets the total number of pages in the document.
Declaration
public int GetPageCount()
Returns
Type | Description |
---|---|
int | the total number of pages in the document. |
GetPageNumberFromScreenPt(double, double)
Gets the number of the page given point in space. The positive number indicates a valid page, whereas number less than 1 means that no page was found.
Declaration
public int GetPageNumberFromScreenPt(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | x coordinate under the given screen coordinate |
double | y | y coordinate under the given screen coordinate |
Returns
Type | Description |
---|---|
int | the number of the page located under the given screen coordinate |
GetPagePresentationMode()
Gets the current page presentation mode.
Declaration
public PDFViewWPF.PagePresentationMode GetPagePresentationMode()
Returns
Type | Description |
---|---|
PDFViewWPF.PagePresentationMode | the current page presentation mode. |
GetPageRefViewMode()
Gets the reference page view mode. See more details about reference page view mode in SetPageRefViewMode(PageViewMode).
Declaration
public PDFViewWPF.PageViewMode GetPageRefViewMode()
Returns
Type | Description |
---|---|
PDFViewWPF.PageViewMode | The current reference page view mode. |
GetPageViewMode()
Gets the current page viewing mode
Declaration
public PDFViewWPF.PageViewMode GetPageViewMode()
Returns
Type | Description |
---|---|
PDFViewWPF.PageViewMode | the current page viewing mode |
GetProgressiveRendering()
Gets whether the control will render progressively or will just draw once the entire view has been rendered.
Declaration
public bool GetProgressiveRendering()
Returns
Type | Description |
---|---|
bool | true if progressive rendering is enabled, false otherwise. |
GetRotation()
Gets the current rotation
Declaration
public Page.Rotate GetRotation()
Returns
Type | Description |
---|---|
Page.Rotate | the current rotation of this PDFViewWPF |
GetScreenRectForAnnot(Annot, int)
Return the annotation rect in screen points
Declaration
public Rect GetScreenRectForAnnot(Annot annot, int page_num)
Parameters
Type | Name | Description |
---|---|---|
Annot | annot | annotation object |
int | page_num | given page number |
Returns
Type | Description |
---|---|
Rect | The annotation rect in screen points |
GetSelection(int)
Gets the current text selection for a given page.
Declaration
public PDFViewWPF.Selection GetSelection(int page)
Parameters
Type | Name | Description |
---|---|---|
int | page | the page number |
Returns
Type | Description |
---|---|
PDFViewWPF.Selection | Current text selection for a given page. If there is only selection on one page, then page number does not need to be provided. |
GetSelectionBeginPage()
Gets the first page number that has text selection on it.
Declaration
public int GetSelectionBeginPage()
Returns
Type | Description |
---|---|
int | the first page number that has text selection on it. Useful when there are selections on multiple pages at the same time. |
GetSelectionEndPage()
Gets the last page number that has text selection on it.
Declaration
public int GetSelectionEndPage()
Returns
Type | Description |
---|---|
int | the last page number that has text selection on it. |
Remarks
Useful when there are selections on multiple pages at the same time.
GetThumbAsync(int)
This will request a thumbnail for the page given by pageNum. When the thumbnail is ready, the OnThumbnailGenerated event will be raised with the finished thumbnail. If multiple requests are made, the thumbnail requests will be processed starting with the last request. The exception is that the current thumbnail being rendered will always finish.
It is recommended to cancel all thumbnail requests once they are not needed any more, using PDFViewCtrl.CancelAllThumbRequests();
If caching is enabled, this request will be much faster once the thumb has been rendered once. You can enable caching by using pdftron.PDFNet.SetViewerCache and pdftron.PDFNet.SetDefaultDiskCachingEnabled(true);
Declaration
public void GetThumbAsync(int pageNum)
Parameters
Type | Name | Description |
---|---|---|
int | pageNum | The page which we want to receive a thumbnail for. |
GetVScrollPos()
Gets the current vertical scroll position in scrollable space.
Declaration
public double GetVScrollPos()
Returns
Type | Description |
---|---|
double | Gets the current vertical scroll position. |
GetViewHeight()
Gets the height of the main view in pixels.
Declaration
public int GetViewHeight()
Returns
Type | Description |
---|---|
int | the height of the main view in pixels. |
GetViewWidth()
Gets the width of the main view in pixels.
Declaration
public int GetViewWidth()
Returns
Type | Description |
---|---|
int | the width of the main view in pixels. |
GetVisiblePages()
Gets the pages that are currently visible on the screen
Declaration
public int[] GetVisiblePages()
Returns
Type | Description |
---|---|
int[] | An array of pages visible on the screen |
GetZoom()
Gets current zoom (or scaling) component used to display the page content.
Declaration
public double GetZoom()
Returns
Type | Description |
---|---|
double | current zoom (or scaling) component used to display the page content. |
GotoFirstPage()
Sets the current page to the first page in the document.
Declaration
public bool GotoFirstPage()
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
GotoLastPage()
Sets the current page to the last page in the document.
Declaration
public bool GotoLastPage()
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
GotoNextPage()
Sets the current page to the next page in the document.
Declaration
public bool GotoNextPage()
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
GotoPreviousPage()
Sets the current page to the previous page in the document.
Declaration
public bool GotoPreviousPage()
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
HasSelection()
Checks whether there is a text selection.
Declaration
public bool HasSelection()
Returns
Type | Description |
---|---|
bool | return true if there is selection, false otherwise. |
HasSelectionOnPage(int)
Check whether a given page has any text selection on it.
Declaration
public bool HasSelectionOnPage(int page)
Parameters
Type | Name | Description |
---|---|---|
int | page | the given page number |
Returns
Type | Description |
---|---|
bool | true if given page number has any text selection on it, false otherwise. |
Remarks
Useful when there are selections on multiple pages at the same time.
HideAnnotation(Annot)
Disable rendering of a particular annotation. This does not change the annotation itself, just how it is displayed in this viewer instance.
Declaration
public void HideAnnotation(Annot annot)
Parameters
Type | Name | Description |
---|---|---|
Annot | annot | The annotation object to cease drawing for. |
IsFinishedRendering()
checks if the rendering thread has finished.
Declaration
public bool IsFinishedRendering()
Returns
Type | Description |
---|---|
bool | true if the rendering thread has finished, false otherwise. |
OpenURLAsync(string)
Open a PDF file at the given url. This works best with PDF's that are linearized, as pages can be downloaded and viewed in random access order, without the need to download the entire document.
Declaration
public void OpenURLAsync(string url)
Parameters
Type | Name | Description |
---|---|---|
string | url | the url to open |
Remarks
Use SetDownloadReportHandler to track the download events.
OpenURLAsync(string, string, string)
Open a PDF file at the given url. This works best with PDF's that are linearized, as pages can be downloaded and viewed in random access order, without the need to download the entire document. A viewing session can also be persisted across multiple viewing/application sessions to remove redundant downloads and improve overall performance by using the optional cache_file parameter.
Declaration
public void OpenURLAsync(string url, string cache_file, string password)
Parameters
Type | Name | Description |
---|---|---|
string | url | the url to open |
string | cache_file | the cache file to be used. By default a temporary file will be created and no caching will occur. Note that if disk caching is disabled this file will not be used. Using cache_file can increase overall performance. |
string | password | The PDF document password to use if the PDF itself is password protected. |
Remarks
Use SetDownloadReportHandler to track the download events.
OpenURLAsync(string, string, string, HTTPRequestOptions)
Open a PDF file at the given url. This works best with PDF's that are linearized, as pages can be downloaded and viewed in random access order, without the need to download the entire document. A viewing session can also be persisted across multiple viewing/application sessions to remove redundant downloads and improve overall performance by using the optional cache_file parameter.
Declaration
public void OpenURLAsync(string url, string cache_file, string password, HTTPRequestOptions options)
Parameters
Type | Name | Description |
---|---|---|
string | url | the url to open |
string | cache_file | the cache file to be used. By default a temporary file will be created and no caching will occur. Note that if disk caching is disabled this file will not be used. Using cache_file can increase overall performance. |
string | password | The PDF document password to use if the PDF itself is password protected. |
HTTPRequestOptions | options | Optional HTTP request options to use with every HTTP request. |
Remarks
Use SetDownloadReportHandler to track the download events.
OpenUniversalDocument(DocumentConversion)
Sets the PDF document to be displayed.
Declaration
public void OpenUniversalDocument(DocumentConversion conversion)
Parameters
Type | Name | Description |
---|---|---|
DocumentConversion | conversion | A document conversion to open |
Remarks
This method acquires a write lock on the current document, so the document must be unlocked when this method is called.
RefreshAndUpdate(ViewChangeCollection)
Helper function that will refresh annotation and/or field appearance if needed, and then render modified page areas, all based on the content of the view_change parameter.
Declaration
public void RefreshAndUpdate(ViewChangeCollection view_change)
Parameters
Type | Name | Description |
---|---|---|
ViewChangeCollection | view_change | contains all the updated fields and rectangles. |
RequestRendering()
Requests that PDFViewCtrl start rendering, if necessary.
Declaration
public void RequestRendering()
Remarks
Invalidate() simply causes the window to be repainted at the system level. It does not make PDFViewWPF to render anything new. RequestRendering() tells PDFViewWPF to check if there are regions (both visible and invisible) that have not been rendered; if so a background rendering thread will be started. This function should be called if CancelRendering() was called to stop the ongoing rendering thread. Update() tells PDFViewWPF to discard the rendered content and start a rendering thread. This function should be used if the content of the PDF is modified.
RequestRenderingAsync()
Declaration
public void RequestRenderingAsync()
RotateClockwise()
Rotates all pages in the document 90 degrees clockwise.
Declaration
public void RotateClockwise()
RotateCounterClockwise()
Rotates all pages in the document 90 degrees counter-clockwise.
Declaration
public void RotateCounterClockwise()
Select(bool, bool, TextSelectionMode, double, double, double, double)
Selects texts
Declaration
public bool Select(bool select_all, bool select_one_line, PDFViewWPF.TextSelectionMode tm, double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
bool | select_all | true if select all is on |
bool | select_one_line | true if select one line is on |
PDFViewWPF.TextSelectionMode | tm | the text selection mode |
double | x1 | the x coordinate of the first selection point |
double | y1 | the y coordinate of the first selection point |
double | x2 | the x coordinate of the second selection point |
double | y2 | the y coordinate of the second selection point |
Returns
Type | Description |
---|---|
bool | true if some text was selected, false otherwise. |
Select(double, double, double, double)
Selects text within the given region using the current text selection mode.
Declaration
public bool Select(double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
double | x1 | the x coordinate of the first corner defining the selection rectangle. |
double | y1 | the y coordinate of the first corner defining the selection rectangle. |
double | x2 | the x coordinate of the opposite corner defining the selection rectangle. |
double | y2 | the y coordinate of the opposite corner corner defining the selection rectangle. |
Returns
Type | Description |
---|---|
bool | true if some text was selected, false otherwise. |
Select(double, double, int, double, double, int)
Selects texts using structural mode.
Declaration
public bool Select(double x1, double y1, int page1, double x2, double y2, int page2)
Parameters
Type | Name | Description |
---|---|---|
double | x1 | the x coordinate of the first selection point |
double | y1 | the y coordinate of the first selection point |
int | page1 | the first page number |
double | x2 | the x coordinate of the second selection point |
double | y2 | the y coordinate of the second selection point |
int | page2 | the second page number |
Returns
Type | Description |
---|---|
bool | true if some text was selected, false otherwise. |
Select(Highlights)
Declaration
public bool Select(Highlights highlights)
Parameters
Type | Name | Description |
---|---|---|
Highlights | highlights |
Returns
Type | Description |
---|---|
bool |
Select(Selection)
Selects a region according to a PDFViewWPF::Selection object.
Declaration
public bool Select(PDFViewWPF.Selection selection)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.Selection | selection | An instance of the Selection class |
Returns
Type | Description |
---|---|
bool | True if some text was selected, false otherwise. |
SelectAll()
Selects all text on the page.
Declaration
public void SelectAll()
SetAntiAliasing(bool)
Enable or disable anti-aliasing. Anti-Aliasing is a technique used to improve the visual quality of images when displaying them on low resolution devices (for example, low DPI computer monitors).
Declaration
public void SetAntiAliasing(bool enable_aa)
Parameters
Type | Name | Description |
---|---|---|
bool | enable_aa | whether to enable Anti-aliasing |
Remarks
Anti-aliasing is enabled by default.
SetBackgroundColor(Color)
Sets the default background color used to paint the area surrounding each page.
Declaration
public void SetBackgroundColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | color specifying the default background color |
SetCaching(bool)
Enables of disables caching of images, fonts, and other resources. Disabling caching can lower memory requirements at the expense of rendering speed.
Declaration
public void SetCaching(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | if true caching is enabled, if false caching is disabled. by default caching is enabled |
SetColorPostProcessMode(ColorPostProcessMode)
Draws the page into a given memory buffer. Set the color post processing transformation. This transform is applied to the rasterized bitmap as the final step in the rasterization process, and is applied directly to the resulting bitmap (disregarding any color space information). Color post processing only supported for RGBA output.
Declaration
public void SetColorPostProcessMode(PDFRasterizer.ColorPostProcessMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFRasterizer.ColorPostProcessMode | mode | mode is the specific transform to be applied. |
SetCurrentPage(int)
Sets the current page to the given page.
Declaration
public bool SetCurrentPage(int page_num)
Parameters
Type | Name | Description |
---|---|---|
int | page_num | new page number |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SetDefaultPageColor(Color)
Sets the default 'paper' color used to draw background of each page.
Declaration
public void SetDefaultPageColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | color specifying the default page color |
SetDelayForTilesAfterResize(int)
Sets the time before new tiles are made visible once the viewer is resized. Will not affect rendering
Declaration
public void SetDelayForTilesAfterResize(int milliseconds)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | The time to wait in milliseconds |
SetDoc(PDFDoc)
Associates this PDFViewWPF with a given PDF document.
Declaration
public void SetDoc(PDFDoc doc)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | doc | A document to be displayed in the view. |
SetDownloadReportHandler(PDFViewDownloadDelegate, object)
Sets the download report handling function to be called on download events, such as when a new page or thumbnail is available, and any download related errors.
Declaration
public void SetDownloadReportHandler(PDFViewDownloadDelegate download_proc, object data)
Parameters
Type | Name | Description |
---|---|---|
PDFViewDownloadDelegate | download_proc | Download report handling callback function (or delegate in .NET) |
object | data | Custom data to be passed as a parameter to 'download_proc'. |
SetDrawAnnotations(bool)
Enable or disable annotation and forms rendering. By default, annotations and forms are rendered.
Declaration
public void SetDrawAnnotations(bool render_annots)
Parameters
Type | Name | Description |
---|---|---|
bool | render_annots | True to draw annotations, false otherwise. |
SetGamma(double)
Sets the gamma factor used for anti-aliased rendering.
Declaration
public void SetGamma(double exp)
Parameters
Type | Name | Description |
---|---|---|
double | exp | exponent value of gamma function. Typical values are in the range from 0.1 to 3. |
Remarks
Gamma correction can be used to improve the quality of anti-aliased image output and can (to some extent) decrease the appearance common anti-aliasing artifacts (such as pixel width lines between polygons). Gamma correction is used only in the built-in rasterizer.
SetHScrollPos(double)
Sets the horizontal scroll position in scrollable space.
Declaration
public void SetHScrollPos(double pos)
Parameters
Type | Name | Description |
---|---|---|
double | pos | new horizontal scroll position. |
SetHighlightFields(bool)
Enable or disable highlighting form fields. Default is disabled.
Declaration
public void SetHighlightFields(bool highlight_fields)
Parameters
Type | Name | Description |
---|---|---|
bool | highlight_fields | true to highlight, false otherwise. |
SetHorizontalAlign(int)
Sets the horizontal alignment used for rendering pages within the view.
Declaration
public void SetHorizontalAlign(int align)
Parameters
Type | Name | Description |
---|---|---|
int | align | an integer specifying the horizontal alignment. Depending of whether align is positive, negative, or zero - pages will be right, left or center aligned. |
SetImageSmoothing(bool)
Enable or disable image smoothing. The rasterizer allows a tradeoff between rendering quality and rendering speed. This function can be used to indicate the preference between rendering speed and quality.image smoothing is enabled by default.
Declaration
public void SetImageSmoothing(bool smoothing_enabled)
Parameters
Type | Name | Description |
---|---|---|
bool | smoothing_enabled | whether to enable image smoothing |
Remarks
image smoothing option has effect only if the source image has higher resolution that the output resolution of the image on the rasterized page. PDFNet automatically controls at what resolution/zoom factor, 'image smoothing' needs to take effect.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetOCGContext(Context)
Declaration
public void SetOCGContext(Context ctx)
Parameters
Type | Name | Description |
---|---|---|
Context | ctx |
SetOverprint(OverprintPreviewMode)
Enable or disable support for overprint. Overprint is a device dependent feature and the results will vary depending on the output color space and supported colorants (i.e. CMYK, CMYK+spot, RGB, etc). By default overprint is enabled for only PDF/X files.
Declaration
public void SetOverprint(PDFViewWPF.OverprintPreviewMode op)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.OverprintPreviewMode | op | e_op_on: always enabled; e_op_off: always disabled; e_op_pdfx_on: enabled for PDF/X files only. |
SetPageBorderVisibility(bool)
Enables or disables drawing of a thin border around each page.
Declaration
public void SetPageBorderVisibility(bool border_visible)
Parameters
Type | Name | Description |
---|---|---|
bool | border_visible | if true, the border will be visible |
SetPagePresentationMode(PagePresentationMode)
Sets the current page presentation mode.
Declaration
public void SetPagePresentationMode(PDFViewWPF.PagePresentationMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.PagePresentationMode | mode | the new page presentation mode. The default PagePresentationMode is e_single_continuous. |
SetPageRefViewMode(PageViewMode)
Sets the reference page view mode. In a non-continous page presentation mode, the reference page view mode is used to determine the page view mode upon a page change event. For example, if the reference page view mode is set to e_fit_width, the new page coming in will be displayed with width-fit mode.
Declaration
public void SetPageRefViewMode(PDFViewWPF.PageViewMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.PageViewMode | mode | The reference page view mode to set. |
SetPageSpacing(int, int, int, int)
Sets the vertical and horizontal padding and column spacing between adjacent pages in the view.
Declaration
public void SetPageSpacing(int horizSpace, int vertSpace, int horizPad, int vertPad)
Parameters
Type | Name | Description |
---|---|---|
int | horizSpace | horizontal column spacing (represented in pixels) between adjacent pages in the view. Default is 10. |
int | vertSpace | vertical column spacing (represented in pixels) between adjacent pages in the view. Default is 10. |
int | horizPad | horizontal padding (represented in pixels) on the left and right side of the view. Default is 10. |
int | vertPad | vertical padding (represented in pixels) on the top and bottom side of the view. Default is 10. |
SetPageTransparencyGrid(bool)
Enables or disables the transparency grid (check board pattern) to reflect page transparency.
Declaration
public void SetPageTransparencyGrid(bool trans_grid_visible)
Parameters
Type | Name | Description |
---|---|---|
bool | trans_grid_visible | if true, the grid is turned on |
SetPageViewMode(PageViewMode)
the new page viewing mode. The default PageView mode is e_fit_width.
Declaration
public void SetPageViewMode(PDFViewWPF.PageViewMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.PageViewMode | mode | Sets the page viewing mode. |
SetPathHinting(bool)
Enable or disable path hinting. Path hinting is used to slightly adjust paths in order to avoid or alleviate artifacts of hair line cracks between certain graphical elements. This option is turned on by default.
Declaration
public void SetPathHinting(bool enable)
Parameters
Type | Name | Description |
---|---|---|
bool | enable | whether to enable path hinting. |
SetProgressiveRendering(bool)
Sets whether the control will render progressively or will just draw once the entire view has been rendered. Progressive rendering is useful when a PDF page contain lots of elements (e.g. many vector paths, text, or many little images). When progressive rendering is enabled PDFNet will use painter algorithm to draw the page. This way user may be able to see partially rendered page. If a page contains only a single large image, there would be no visible benefit from progressive rendering.
Declaration
public void SetProgressiveRendering(bool progressive)
Parameters
Type | Name | Description |
---|---|---|
bool | progressive | if true the view will be rendered progressively |
SetProgressiveRenderingInterval(int)
Sets the interval at which the rendering will be updated
Declaration
public void SetProgressiveRenderingInterval(int milliseconds)
Parameters
Type | Name | Description |
---|---|---|
int | milliseconds | The time between updates in units milliseconds. Default is 750, or 0.75 seconds. |
SetRasterizerType(Type)
Sets the core graphics library used for rasterization and rendering. Using this method it is possible to quickly switch between different implementations. By default, PDFNet uses a built-in, high-quality, and platform independent rasterizer.
Declaration
public void SetRasterizerType(PDFRasterizer.Type type)
Parameters
Type | Name | Description |
---|---|---|
PDFRasterizer.Type | type | Rasterizer type. |
SetRenderedContentCacheSize(ulong)
Sets the suggested memory size of rendered content.
PDFViewWPF keeps invisible content in order to achieve smoother viewing experience; however, this increases memory usage. Based on the memory footprint of your app, you may want to customize it.
Note that this limit refers to the underlying buffers of rendered content, and does not include space used by the operating system when creating images and maintaining the ScrollViewer
Setting this size to 0 will cause only rendering if directly visible content.
Declaration
public void SetRenderedContentCacheSize(ulong allowed_max)
Parameters
Type | Name | Description |
---|---|---|
ulong | allowed_max | the allowed heap memory usage in MB (default 96) |
SetRightToLeftLanguage(bool)
Tells PDFViewCtrl the content in the viewed PDF document reads from right to left.
Declaration
public void SetRightToLeftLanguage(bool flag)
Parameters
Type | Name | Description |
---|---|---|
bool | flag | Set to true for right to left languages. |
SetSnappingMode(uint)
Set the snapping mode for the SnapToNearestInDoc method. The default is snap to line endpint, midpoints and intersections
Declaration
public void SetSnappingMode(uint mode_flags)
Parameters
Type | Name | Description |
---|---|---|
uint | mode_flags | A bitwise combination of modes from the GeometryCollection.SnappingMode enumeration |
SetTextSelectionMode(TextSelectionMode)
Sets the selection mode used for text highlighting.
Declaration
public void SetTextSelectionMode(PDFViewWPF.TextSelectionMode tm)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.TextSelectionMode | tm | the text selection mode |
SetThinLineAdjustment(bool, bool)
Set thin line adjustment parameters.
Declaration
public void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust)
Parameters
Type | Name | Description |
---|---|---|
bool | pixel_grid_fit | if true (horizontal/vertical) thin lines will be snapped to integer pixel positions. This helps make thin lines look sharper and clearer. This option is turned off by default and it only works if path hinting is enabled. |
bool | stroke_adjust | if true auto stroke adjustment is enabled. Currently, this would make lines with sub-pixel width to be one-pixel wide. This option is turned on by default. |
SetUrlExtraction(bool)
Enables or disables URL extraction. Default is disabled.
Declaration
public void SetUrlExtraction(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | true to enable URL extraction, false to disable. |
Remarks
If set to enabled when the document is already opened, it may not find links on pages that were already rendered. It is suggested to set this flag before opening the document.
SetVScrollPos(double)
Sets the vertical scroll position in scrollable space.
Declaration
public void SetVScrollPos(double pos)
Parameters
Type | Name | Description |
---|---|---|
double | pos | new vertical scroll position. |
SetVerticalAlign(int)
Sets the vertical alignment used for rendering pages within the view.
Declaration
public void SetVerticalAlign(int align)
Parameters
Type | Name | Description |
---|---|---|
int | align | an integer specifying the vertical alignment. Depending of whether align is positive, negative, or zero - pages will be bottom, top or center aligned. |
SetViewerCache(SDFDoc, uint, bool)
Sets the cache parameters of the page cache on disk (which caches content streams and mipmapped images) for this specific document. These parameters will override the default cache parameters. Note that if this function is called after the document has been rasterized, it has no effect.
Declaration
public static void SetViewerCache(SDFDoc document, uint max_cache_size, bool on_disk)
Parameters
Type | Name | Description |
---|---|---|
SDFDoc | document | The document whose settings will be modified |
uint | max_cache_size | The maximum size, in bytes, of the entire document's page cache. Set to zero to disable the viewer cache. |
bool | on_disk | If set to 'true', cache will be stored on the local filesystem. If set to 'false', cache will be stored in heap memory. |
Remarks
Default Desktop: max_cache_size = 512 MB, on_disk = true | Default Mobile: max_cache_size = 100 MB, on_disk = false
SetZoom(double)
Sets the zoom factor to a new value. The function zooms to a point at the center of the screen.
Declaration
public bool SetZoom(double zoom)
Parameters
Type | Name | Description |
---|---|---|
double | zoom | new scaling component used to display the page content. |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SetZoom(double, bool)
Sets the zoom factor to a new value. The function zooms to a point at the center of the screen.
Declaration
public bool SetZoom(double zoom, bool isPartOfChain)
Parameters
Type | Name | Description |
---|---|---|
double | zoom | new scaling component used to display the page content. |
bool | isPartOfChain | If true, this zoom is taken to be part of a chain of zoom actions. Set this to true if your zoom action is part of a chain of zoom events, such as ctrl + mosue wheel or a pinch manipulation |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SetZoom(int, int, double)
Sets the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center, which will stay fixed on the screen. The zoom point (x,y) is represented in the screen coordinate system, which starts in the upper-left corner of the client window. Should you want to move (x, y) to the center of the client window, you can use the OnScroll() subsequently:
Declaration
public bool SetZoom(int x, int y, double zoom)
Parameters
Type | Name | Description |
---|---|---|
int | x | the horizontal coordinate to zoom in. |
int | y | the vertical coordinate to zoom in. |
double | zoom | new scaling component used to display the page content. |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SetZoom(int, int, double, bool)
Sets the zoom factor to a new value using the given pixel coordinate (x,y) as a zoom center, which will stay fixed on the screen. The zoom point (x,y) is represented in the screen coordinate system, which starts in the upper-left corner of the client window. Should you want to move (x, y) to the center of the client window, you can use the OnScroll() subsequently:
Declaration
public bool SetZoom(int x, int y, double zoom, bool isPartOfChain)
Parameters
Type | Name | Description |
---|---|---|
int | x | the horizontal coordinate to zoom in. |
int | y | the vertical coordinate to zoom in. |
double | zoom | new scaling component used to display the page content. |
bool | isPartOfChain | If true, this zoom is taken to be part of a chain of zoom actions. Set this to true if your zoom action is part of a chain of zoom events, such as ctrl + mouse wheel or a pinch manipulation |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SetupThumbnails(bool, bool, bool, int, int, double)
Enables or disables thumbnail view features. Thumbnail view is used before a PDF page is fully rendered. If runtime thumb view generation is enabled, PDFViewCtrl generates thumbnail views at runtime. If a PDF file already contains the thumbnail views, runtime thumb view generation can be turned off, which is more efficient.
It is recommended that this not be called after SetDoc in order to avoid clearing cached thumbnails. Calling this method with different parameters will also clear the persistent disk cache if it is in use.
If runtime thumb view generation is enabled, the thumbMaxSideLength will be used as a reference to calculate the thumbnail resolution.
Declaration
public void SetupThumbnails(bool use_embedded_thumbs, bool generate_thumbs_at_runtime, bool use_disk_cache, int thumb_max_side_length, int max_abs_cache_size, double max_perc_cache_size)
Parameters
Type | Name | Description |
---|---|---|
bool | use_embedded_thumbs | Enables or disables using thumbnails embedded in the PDF document as a preview of the rendered page. This flag is currently ignored, but functionality may be added to support embedded thumbnails in the future. |
bool | generate_thumbs_at_runtime | Enables or disables generating thumbnails at runtime. Default is enabled. |
bool | use_disk_cache | Enables or disables storing thumbnails in a cache file on disk. default is enabled. |
int | thumb_max_side_length | The maximum size, in pixels, of a dimension of generated thumbnails. |
int | max_abs_cache_size | The maximum absolute size, in bytes, the thumbnail cache file may take up on disk. |
double | max_perc_cache_size | The maximum percentage of free disk space, in the range 0 - 1.0, the thumbnail cache file may take up. |
ShowAnnotation(Annot)
Enable rendering of a particular annotation. Only has an effect if HideAnnotation() has previously been called on the same annot.
Declaration
public void ShowAnnotation(Annot annot)
Parameters
Type | Name | Description |
---|---|---|
Annot | annot | The annotation object to resume rendering. |
ShowRect(int, Rect)
Changes the viewing area to fit a rectangle rect on page page_num. Rectangle must be specified in page coordinates. This will adjust current page and zoom appropriately.
Declaration
public bool ShowRect(int page_num, Rect rect)
Parameters
Type | Name | Description |
---|---|---|
int | page_num | given page number |
Rect | rect | rectangle specifies the region to show in view |
Returns
Type | Description |
---|---|
bool | true if successful, false otherwise. |
SmartZoom(int, int)
Sets the zoom factor to a new value using the given pixel coordinate (x,y) to find an intersecting paragraph. The width of the paragraph helps to determine the zoom value, center of the paragraph is used as a zoom center. Paragraph has to contain more than one line and be wider than 1/5th of a page width. When called on a paragraph wider than current zoom level the new zoom level is set to fit the entire page(zoom out).
Declaration
public bool SmartZoom(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | the horizontal coordinate to look for a paragraph. |
int | y | the vertical coordinate to look for a paragraph. |
Returns
Type | Description |
---|---|
bool | true if successful, false if no paragraph intersects the given point. |
SnapToNearestInDoc(Point)
Declaration
public Point SnapToNearestInDoc(Point screen_coord)
Parameters
Type | Name | Description |
---|---|---|
Point | screen_coord |
Returns
Type | Description |
---|---|
Point |
Update()
Redraws the contents in the visible region.
Declaration
public void Update()
Update(bool)
Redraws the contents.
Declaration
public void Update(bool all)
Parameters
Type | Name | Description |
---|---|---|
bool | all | If true, all the rendered contents are discarded and re-rendered; otherwise, only the visible region will be re-rendered. |
Update(Annot, int)
Redraws the area covered with a given annotation.
Declaration
public void Update(Annot annot, int pageNum)
Parameters
Type | Name | Description |
---|---|---|
Annot | annot | The annotation to update. |
int | pageNum | The page number on which the annotation is located. |
Update(Field)
Redraws all instances (Widgets) of the field.
Declaration
public void Update(Field field)
Parameters
Type | Name | Description |
---|---|---|
Field | field | he field for which to update all occurances. |
Update(Rect)
Redraws the given area in the buffer.
Declaration
public void Update(Rect updateRect)
Parameters
Type | Name | Description |
---|---|---|
Rect | updateRect | The rectangle to update expressed in screen coordinates. |
UpdatePageLayout()
Updates the page layout withing the view. This function must be called after document page sequence is modified (such as when a page is being added to or removed from a document) or after changes to page dimensions (e.g. after a page is rotated or resized).
Declaration
public void UpdatePageLayout()
raise_CurrentPageNumberChanged(PDFViewWPF, int, int)
Declaration
protected void raise_CurrentPageNumberChanged(PDFViewWPF value0, int value1, int value2)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 | |
int | value1 | |
int | value2 |
raise_CurrentScrollChanged(PDFViewWPF, ScrollChangedEventArgs)
Declaration
protected void raise_CurrentScrollChanged(PDFViewWPF value0, ScrollChangedEventArgs value1)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 | |
ScrollChangedEventArgs | value1 |
raise_CurrentZoomChanged(PDFViewWPF)
Declaration
protected void raise_CurrentZoomChanged(PDFViewWPF value0)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 |
raise_FindTextFinished(PDFViewWPF, bool, Selection)
Declaration
protected void raise_FindTextFinished(PDFViewWPF value0, bool value1, PDFViewWPF.Selection value2)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 | |
bool | value1 | |
PDFViewWPF.Selection | value2 |
raise_LayoutChanged(PDFViewWPF)
Declaration
protected void raise_LayoutChanged(PDFViewWPF value0)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 |
raise_OnAction(PDFViewWPF, ActionEventArgs)
Declaration
protected void raise_OnAction(PDFViewWPF value0, PDFViewWPF.ActionEventArgs value1)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 | |
PDFViewWPF.ActionEventArgs | value1 |
raise_OnConversionChanged(PDFViewWPFConversionType, int)
Declaration
protected void raise_OnConversionChanged(PDFViewWPF.PDFViewWPFConversionType value0, int value1)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF.PDFViewWPFConversionType | value0 | |
int | value1 |
raise_OnRenderFinished(PDFViewWPF)
Declaration
protected void raise_OnRenderFinished(PDFViewWPF value0)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 |
raise_OnSetDoc(PDFViewWPF)
Declaration
protected void raise_OnSetDoc(PDFViewWPF value0)
Parameters
Type | Name | Description |
---|---|---|
PDFViewWPF | value0 |
raise_OnThumbnailGenerated(int, byte[], int, int)
Declaration
protected void raise_OnThumbnailGenerated(int value0, byte[] value1, int value2, int value3)
Parameters
Type | Name | Description |
---|---|---|
int | value0 | |
byte[] | value1 | |
int | value2 | |
int | value3 |
Events
CurrentPageNumberChanged
Raised when the current page changes
Declaration
public event PDFViewWPF.CurrentPageNumberChangedHandler CurrentPageNumberChanged
Event Type
Type | Description |
---|---|
PDFViewWPF.CurrentPageNumberChangedHandler |
CurrentScrollChanged
Raised when the current zoom level changes
Declaration
public event PDFViewWPF.CurrentScrollChangedHandler CurrentScrollChanged
Event Type
Type | Description |
---|---|
PDFViewWPF.CurrentScrollChangedHandler |
CurrentZoomChanged
Raised when the current zoom level changes
Declaration
public event PDFViewWPF.CurrentZoomChangedHandler CurrentZoomChanged
Event Type
Type | Description |
---|---|
PDFViewWPF.CurrentZoomChangedHandler |
FindTextFinished
Raised when a text search is finished
Declaration
public event PDFViewWPF.FindTextFinsihedHandler FindTextFinished
Event Type
Type | Description |
---|---|
PDFViewWPF.FindTextFinsihedHandler |
LayoutChanged
Raised when the layout changes This event is used to notify any subscriber that the layout has changes, so that they can adjust their content on the screen to line up with the document. Use this in conjunction with CurrentZoomChanged to cover all cases where the PDFViewWPF might change appearance.
Declaration
public event PDFViewWPF.LayoutChangedHandler LayoutChanged
Event Type
Type | Description |
---|---|
PDFViewWPF.LayoutChangedHandler |
OnAction
Occurs when the PDFViewCtrl is about to execute an action. In order to prevent the viewer from executing the action internally, you can set ActionEventArgs.Handled to true;
Declaration
public event PDFViewWPF.OnActionEventHandler OnAction
Event Type
Type | Description |
---|---|
PDFViewWPF.OnActionEventHandler |
OnConversionChanged
Called when an update is available.
Note that the DocumentConversion passed in as a parameter might be ahead of the PDFViewWPF in terms of how many pages are converted. This event reports how many pages the PDFViewWPF is currently aware of.
Declaration
public event PDFViewWPF.OnConversionEventHandler OnConversionChanged
Event Type
Type | Description |
---|---|
PDFViewWPF.OnConversionEventHandler |
OnRenderFinished
Raised when the PDFViewWPF has finished rendering a region of the PDF Document This does not include progressive rendering.
Declaration
public event PDFViewWPF.OnRenderFinishedEventHandler OnRenderFinished
Event Type
Type | Description |
---|---|
PDFViewWPF.OnRenderFinishedEventHandler |
OnSetDoc
Raised when the current document is set and ready
Declaration
public event PDFViewWPF.OnSetdocHandler OnSetDoc
Event Type
Type | Description |
---|---|
PDFViewWPF.OnSetdocHandler |
OnThumbnailGenerated
Occurs when a thumbnail that was requested though GetThumbAsync(int pageNum) is ready. See GetThumbAsync(int pageNum) for more information.
Declaration
public event PDFViewWPF.OnThumbnailGeneratedEventHandler OnThumbnailGenerated
Event Type
Type | Description |
---|---|
PDFViewWPF.OnThumbnailGeneratedEventHandler |