Class UtilityFunctions
Inheritance
System.Object
UtilityFunctions
Assembly: pdftron.PDF.Tools.dll
public static class UtilityFunctions : object
Fields
Declaration
public static string KeyIRT
Field Value
Type |
Description |
System.String |
|
Declaration
public static string KeyNM
Field Value
Type |
Description |
System.String |
|
Declaration
public static string KeyRT
Field Value
Type |
Description |
System.String |
|
Declaration
public static uint PCM_AUDIO_BITS_PER_SAMPLE
Field Value
Type |
Description |
System.UInt32 |
|
Declaration
public static uint PCM_AUDIO_NUM_CHANNELS
Field Value
Type |
Description |
System.UInt32 |
|
Declaration
public static uint PCM_AUDIO_SAMPLE_RATE
Field Value
Type |
Description |
System.UInt32 |
|
Declaration
public static string PDFTronId
Field Value
Type |
Description |
System.String |
|
Declaration
public static string ValueGroup
Field Value
Type |
Description |
System.String |
|
Methods
Adds a popup to a markup annotation.
Assumes we already have a write lock, and that the annot does not have a popup already.
Declaration
public static Annots.Popup AddPopupToAnnot(PDFDoc doc, Annots.IMarkup markup, string text)
Parameters
Type |
Name |
Description |
PDFDoc |
doc |
the document the annotation is in
|
Annots.IMarkup |
markup |
the annotation
|
System.String |
text |
the text to add
|
Returns
Type |
Description |
Annots.Popup |
|
Declaration
public static bool AreFilesEqual(StorageFile file1, StorageFile file2)
Parameters
Type |
Name |
Description |
Windows.Storage.StorageFile |
file1 |
|
Windows.Storage.StorageFile |
file2 |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static void CloseAllOpenPopups()
ConvertFromCanvasPointToPagePoint(Point, Int32, PDFViewCtrl)
Declaration
public static Point ConvertFromCanvasPointToPagePoint(Point point, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
point |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Point ConvertFromCanvasPointToScreenPoint(Point point, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
point |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Point ConvertFromCanvasPointToScreenPoint(double x, double y, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
System.Double |
x |
|
System.Double |
y |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Rect ConvertFromCanvasRectToPageRect(Rect rect, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
Declaration
public static Rect ConvertFromCanvasRectToScreenRect(Rect rect, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
ConvertFromPagePointToCanvasPoint(Point, Int32, PDFViewCtrl)
Declaration
public static Point ConvertFromPagePointToCanvasPoint(Point point, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
point |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Rect ConvertFromPageRectToCanvasRect(Rect rect, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
Declaration
public static Rect ConvertFromPageRectToScreenRect(Rect rect, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
Declaration
public static Point ConvertFromScreenPointToCanvasPoint(Point point, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
point |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Point ConvertFromScreenPointToCanvasPoint(double x, double y, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
System.Double |
x |
|
System.Double |
y |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Point |
|
Declaration
public static Rect ConvertFromScreenRectToAnnotationCanvasRect(PDFViewCtrl ctrl, Rect rect)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
ctrl |
|
Rect |
rect |
|
Returns
Declaration
public static Rect ConvertFromScreenRectToCanvasRect(Rect rect, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
Declaration
public static Rect ConvertFromScreenRectToPageRect(Rect rect, int pageNum, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
pdftron.PDF.Rect |
rect |
|
System.Int32 |
pageNum |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
pdftron.PDF.Rect |
|
Declaration
public static Color ConvertToColor(SettingsColor color)
Parameters
Returns
Type |
Description |
Windows.UI.Color |
|
Declaration
public static Task<InMemoryRandomAccessStream> ConvertToPngStreamAsync(byte[] buffer, int w, int h)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
System.Int32 |
w |
|
System.Int32 |
h |
|
Returns
Type |
Description |
Task<Windows.Storage.Streams.InMemoryRandomAccessStream> |
|
Convert a MemoryStream to IRandomAccessStream with cloning support
Declaration
public static Task<IRandomAccessStream> ConvertToRandomAccessStreamAsync(MemoryStream memoryStream)
Parameters
Type |
Name |
Description |
MemoryStream |
memoryStream |
The memory stream
|
Returns
Type |
Description |
Task<Windows.Storage.Streams.IRandomAccessStream> |
IRandomAccessStream with cloning support
|
Declaration
public static SettingsColor ConvertToSettingsColor(Color color)
Parameters
Type |
Name |
Description |
Windows.UI.Color |
color |
|
Returns
CopySelectedTextToClipBoard(String)
Declaration
public static void CopySelectedTextToClipBoard(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
Declaration
public static bool CopyToClipBoard(DataPackage dataPackage)
Parameters
Type |
Name |
Description |
Windows.ApplicationModel.DataTransfer.DataPackage |
dataPackage |
|
Returns
Type |
Description |
System.Boolean |
|
Creates a group of annotations
Declaration
public static void CreateAnnotationGroup(PDFViewCtrl pdfViewCtrl, IAnnot primaryAnnotation, List<IAnnot> allAnnotationsInGroup)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
pdfViewCtrl |
PDFViewCtrl object which contains the current document
|
IAnnot |
primaryAnnotation |
the primary annotation
|
List<IAnnot> |
allAnnotationsInGroup |
all annotations to be added to this group
|
Create a new temp file in the local app's folder to be accessed with full permission
Declaration
public static Task<StorageFile> CreateTemporaryAccessFileAsync(string newName, bool cleanTempfolder = true)
Parameters
Type |
Name |
Description |
System.String |
newName |
File name
|
System.Boolean |
cleanTempfolder |
Choose whether or not we delete temp files that are no longer used by ViewerControl
|
Returns
Type |
Description |
Task<Windows.Storage.StorageFile> |
Temp file created
|
DoesAnnotHaveContent(Annots.IMarkup)
Declaration
public static bool DoesAnnotHaveContent(Annots.IMarkup markup)
Parameters
Type |
Name |
Description |
Annots.IMarkup |
markup |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool DoesAnnotHavePopup(Annots.IMarkup markup)
Parameters
Type |
Name |
Description |
Annots.IMarkup |
markup |
|
Returns
Type |
Description |
System.Boolean |
|
Check if file is in the recent list of accessed documents
Declaration
public static bool DoesFileBelongInRecentList(StorageFile file)
Parameters
Type |
Name |
Description |
Windows.Storage.StorageFile |
file |
The file to be checked
|
Returns
Type |
Description |
System.Boolean |
Returns true if we can add the file to the recent list safely.
|
Declaration
public static IEnumerable<T> FindAllVisualChildren<T>(DependencyObject depObj)
where T : DependencyObject
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.DependencyObject |
depObj |
|
Returns
Type |
Description |
IEnumerable<T> |
|
Type Parameters
Declaration
public static T FindVisualChild<T>(DependencyObject depObj)
where T : DependencyObject
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.DependencyObject |
depObj |
|
Returns
Type Parameters
GenerateDSEntry(Annots.FreeText, UtilityFunctions.FontBundle)
Declaration
public static void GenerateDSEntry(Annots.FreeText freeText, UtilityFunctions.FontBundle fontBundle = null)
Parameters
Gets the annotation creation date in local date time; if it fails then UTC time is returned
Declaration
public static DateTime GetAnnotationLocalCreationDate(IAnnot annotation)
Parameters
Type |
Name |
Description |
IAnnot |
annotation |
the annotation
|
Returns
Type |
Description |
DateTime |
the date
|
Returns all annotations in this group if the annotation passed in is in an annotation group
Declaration
public static List<IAnnot> GetAnnotationsInGroup(PDFViewCtrl pdfViewCtrl, IAnnot annotation, int pageNumber)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
pdfViewCtrl |
PDFViewCtrl object which contains the current document
|
IAnnot |
annotation |
the annotation.
|
System.Int32 |
pageNumber |
page number of page that contains the annotations
|
Returns
Type |
Description |
List<IAnnot> |
returns all annotations in this group if the annotation passed in is in an annotation group
|
GetAnnotationsOnPage(PDFViewCtrl, Int32)
Gets the list of annotations on a given page.
Declaration
public static List<IAnnot> GetAnnotationsOnPage(PDFViewCtrl pdfViewCtrl, int pageNumber)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
pdfViewCtrl |
PDFViewCtrl object which contains the current document.
|
System.Int32 |
pageNumber |
Page number on which to search for annotations.
|
Returns
Type |
Description |
List<IAnnot> |
List of annotations on a given page.
|
GetAnnotContent(Annots.IMarkup)
Declaration
public static string GetAnnotContent(Annots.IMarkup markup)
Parameters
Type |
Name |
Description |
Annots.IMarkup |
markup |
|
Returns
Type |
Description |
System.String |
|
Get annotation description from Annotation Enum Type
Declaration
public static string GetAnnotDescriptionFromEnum(AnnotType annotType)
Parameters
Type |
Name |
Description |
AnnotType |
annotType |
Annotation Type
|
Returns
Type |
Description |
System.String |
Description in case it exists otherwise "Unknown"
|
GetAnnotIdexForAddingTextMarkup(Page)
Declaration
public static int GetAnnotIdexForAddingTextMarkup(Page page)
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.Controls.Page |
page |
|
Returns
Type |
Description |
System.Int32 |
|
Declaration
public static Color GetColorAtPoint(Grid grid, Point thePoint)
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.Controls.Grid |
grid |
|
Windows.Foundation.Point |
thePoint |
|
Returns
Type |
Description |
Windows.UI.Color |
|
Declaration
public static Task<Tuple<DateTimeOffset, ulong>> GetDateModifiedAndSizeAsync(StorageFile file)
Parameters
Type |
Name |
Description |
Windows.Storage.StorageFile |
file |
|
Returns
Type |
Description |
Task<Tuple<DateTimeOffset, System.UInt64>> |
|
Declaration
public static DeviceFormFactorType GetDeviceFormFactorType()
Returns
Declaration
public static Rect GetElementRect(FrameworkElement element, FrameworkElement target = null)
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.FrameworkElement |
element |
|
Windows.UI.Xaml.FrameworkElement |
target |
|
Returns
Type |
Description |
Windows.Foundation.Rect |
|
GetFontFromAnnot(Annots.FreeText)
Declaration
public static UtilityFunctions.FontBundle GetFontFromAnnot(Annots.FreeText freeText)
Parameters
Type |
Name |
Description |
Annots.FreeText |
freeText |
|
Returns
GetFontNameFromAnnot(Annots.FreeText)
Declaration
public static string GetFontNameFromAnnot(Annots.FreeText freeText)
Parameters
Type |
Name |
Description |
Annots.FreeText |
freeText |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static Tuple<double, double, double> GetHSVFromRGB(Color color)
Parameters
Type |
Name |
Description |
Windows.UI.Color |
color |
|
Returns
Type |
Description |
Tuple<System.Double, System.Double, System.Double> |
|
Gets the unique Id of the IRT parent annotation of this annotation
Declaration
public static string GetIRTAsString(IAnnot annotation)
Parameters
Type |
Name |
Description |
IAnnot |
annotation |
The annotation
|
Returns
Type |
Description |
System.String |
The unique id of the IRT parent annotation of this annotation
|
Declaration
public static List<UtilityFunctions.FontBundle> GetListOfSystemFonts()
Returns
Declaration
public static int GetLuminance(Color color)
Parameters
Type |
Name |
Description |
Windows.UI.Color |
color |
|
Returns
Type |
Description |
System.Int32 |
|
Declaration
public static string GetMaximalAvailablePath(StorageFile file)
Parameters
Type |
Name |
Description |
Windows.Storage.StorageFile |
file |
|
Returns
Type |
Description |
System.String |
|
GetPagePresentationModeName(PDFViewCtrlPagePresentationMode)
Declaration
public static string GetPagePresentationModeName(PDFViewCtrlPagePresentationMode mode)
Parameters
Type |
Name |
Description |
PDFViewCtrlPagePresentationMode |
mode |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static Point GetPointCloserToLine(Point basePoint, Point tipPoint, Point target)
Parameters
Type |
Name |
Description |
Windows.Foundation.Point |
basePoint |
|
Windows.Foundation.Point |
tipPoint |
|
Windows.Foundation.Point |
target |
|
Returns
Type |
Description |
Windows.Foundation.Point |
|
GetPostProcessedColor(Color, PDFViewCtrl)
Declaration
public static Color GetPostProcessedColor(Color inColor, PDFViewCtrl ctrl)
Parameters
Type |
Name |
Description |
Windows.UI.Color |
inColor |
|
PDFViewCtrl |
ctrl |
|
Returns
Type |
Description |
Windows.UI.Color |
|
Declaration
public static Color GetRGBFromHSV(double h, double s, double v)
Parameters
Type |
Name |
Description |
System.Double |
h |
|
System.Double |
s |
|
System.Double |
v |
|
Returns
Type |
Description |
Windows.UI.Color |
|
GetSelectedTextOnPage(PDFViewCtrl, Int32)
Declaration
public static String GetSelectedTextOnPage(PDFViewCtrl ctrl, int pageNum)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
ctrl |
|
System.Int32 |
pageNum |
|
Returns
Get the temporary folder used to save temporary access files
Declaration
public static Task<StorageFolder> GetTemporaryAccessFilefolderAsync(bool cleanTempfolder = true)
Parameters
Type |
Name |
Description |
System.Boolean |
cleanTempfolder |
Choose whether or not we delete temp files that are no longer used by ViewerControl
|
Returns
Type |
Description |
Task<Windows.Storage.StorageFolder> |
Temp folder
|
Declaration
public static ToolType GetToolTypeFromAnnotType(IAnnot annot)
Parameters
Type |
Name |
Description |
IAnnot |
annot |
|
Returns
Declaration
public static Size GetUniformStretch(double maxWidth, double maxHeight, double width, double height)
Parameters
Type |
Name |
Description |
System.Double |
maxWidth |
|
System.Double |
maxHeight |
|
System.Double |
width |
|
System.Double |
height |
|
Returns
Type |
Description |
Windows.Foundation.Size |
|
Declaration
public static Color GetViewerBackgroundColor(Color pageColor)
Parameters
Type |
Name |
Description |
Windows.UI.Color |
pageColor |
|
Returns
Type |
Description |
Windows.UI.Color |
|
Declaration
public static void HideElement(FrameworkElement element)
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.FrameworkElement |
element |
|
Declaration
public static UtilityFunctions.RGB HSVtoRGB(UtilityFunctions.HSV hsv)
Parameters
Returns
Declaration
public static string IconNameToFontIconFill(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static string IconNameToFontIconOutline(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
This returns a magic number to multiply the font size of an icon in order to
make it match the icon for the sticky note pushed into the document.
Declaration
public static double IconNameToFontSizeMultiplier(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Double |
|
Declaration
public static bool IsArrow(Annots.Line line)
Parameters
Type |
Name |
Description |
pdftron.PDF.Annots.Line |
line |
|
Returns
Type |
Description |
System.Boolean |
|
Check if a audio capture device (Microphone) is available / installed on the computer
Declaration
public static bool IsAudioCaptureAvailable()
Returns
Type |
Description |
System.Boolean |
True if microphone is available, false otherwise
|
Declaration
public static bool IsBox(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
IsContinuous(PDFViewCtrlPagePresentationMode)
Declaration
public static bool IsContinuous(PDFViewCtrlPagePresentationMode presentationMode)
Parameters
Type |
Name |
Description |
PDFViewCtrlPagePresentationMode |
presentationMode |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsDropBox(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsFullScreen()
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsLeftTurn(Point p0, Point p1, Point p2)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
p0 |
|
pdftron.PDF.Point |
p1 |
|
pdftron.PDF.Point |
p2 |
|
Returns
Type |
Description |
System.Boolean |
|
Returns true if the annotation was created with PDFTron SDK
Declaration
public static bool IsMadeByPDFTron(IAnnot annotation)
Parameters
Type |
Name |
Description |
IAnnot |
annotation |
the annotation
|
Returns
Type |
Description |
System.Boolean |
true if created by PDFTron SDK; false otherwise
|
Declaration
public static bool IsOneDrive(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsOneDriveTempFile(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
Checks if point is inside quad,
Assumes the quad is convex
Declaration
public static bool IsPointInSideQuad(QuadPoint quad, Point point, double inflate)
Parameters
Type |
Name |
Description |
QuadPoint |
quad |
A convex quad
|
pdftron.PDF.Point |
point |
|
System.Double |
inflate |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsRemoteStorage(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
Checks if the annotation is part of a group annotation.
Declaration
public static bool IsReplyTypeGroup(IAnnot annotation)
Parameters
Type |
Name |
Description |
IAnnot |
annotation |
The annotation.
|
Returns
Type |
Description |
System.Boolean |
True if it is part of a group annotation, false otherwise.
|
Checks if the annotation is an annotation reply
Declaration
public static bool IsReplyTypeReply(IAnnot annot)
Parameters
Type |
Name |
Description |
IAnnot |
annot |
the annotation
|
Returns
Type |
Description |
System.Boolean |
true if it is an annotation reply, false otherwise
|
MatchesColorPostProcessMode(PDFViewCtrl, PDFRasterizerColorPostProcessMode, Color, Color)
Declaration
public static bool MatchesColorPostProcessMode(PDFViewCtrl ctrl, PDFRasterizerColorPostProcessMode mode, Color newWhite, Color newblack)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
ctrl |
|
PDFRasterizerColorPostProcessMode |
mode |
|
Windows.UI.Color |
newWhite |
|
Windows.UI.Color |
newblack |
|
Returns
Type |
Description |
System.Boolean |
|
Check if the value of an "enum instance" contains more than one flag (enum value)
Declaration
public static bool MoreThanOneFlag<TValue>(TValue flag)
where TValue : Enum
Parameters
Type |
Name |
Description |
TValue |
flag |
Enum instance value
|
Returns
Type |
Description |
System.Boolean |
True if more than one flag, false otherwise
|
Type Parameters
Name |
Description |
TValue |
Enum class
|
Declaration
public static double PointToLineDistance(Point basePoint, Point tipPoint, Point target)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
basePoint |
|
pdftron.PDF.Point |
tipPoint |
|
pdftron.PDF.Point |
target |
|
Returns
Type |
Description |
System.Double |
|
Remove ReadOnly and Temporary flags from the StorageFile properties
Declaration
public static Task RemoveReadOnlyAndTemporaryFlagsAsync(StorageFile file)
Parameters
Type |
Name |
Description |
Windows.Storage.StorageFile |
file |
The file to be processed
|
Returns
Declaration
public static UtilityFunctions.HSV RGBtoHSV(UtilityFunctions.RGB rgb)
Parameters
Returns
Run a Func async calling the Corewindow Dispatcher
Declaration
public static Task RunAsyncSaferAsync(CoreWindow coreWindow, Func<Task> T)
Parameters
Type |
Name |
Description |
Windows.UI.Core.CoreWindow |
coreWindow |
The CoreWindow which will run the Func using its Dispatcher
|
Func<Task> |
T |
Func to be run
|
Returns
Run a Dispatchedhandler async calling the Corewindow Dispatcher
Declaration
public static Task RunAsyncSaferAsync(CoreWindow coreWindow, DispatchedHandler agileCallback)
Parameters
Type |
Name |
Description |
Windows.UI.Core.CoreWindow |
coreWindow |
The CoreWindow which will run the Func using its Dispatcher
|
Windows.UI.Core.DispatchedHandler |
agileCallback |
DispatchedHandler to be run
|
Returns
Removes invalid characters from a file name. Will return temp.ext if there are no valid characters left.
Declaration
public static string SanitizeFileName(string filename)
Parameters
Type |
Name |
Description |
System.String |
filename |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static void SetCursor(CoreCursorType cursorType)
Parameters
Type |
Name |
Description |
Windows.UI.Core.CoreCursorType |
cursorType |
|
SetFontFromBundle(Annots.FreeText, PDFDoc, UtilityFunctions.FontBundle)
Declaration
public static void SetFontFromBundle(Annots.FreeText freeText, PDFDoc doc, UtilityFunctions.FontBundle bundle)
Parameters
SetFreeTextDefaultAppearanceWithFont(Annots.FreeText)
Declaration
public static void SetFreeTextDefaultAppearanceWithFont(Annots.FreeText freeText)
Parameters
Type |
Name |
Description |
Annots.FreeText |
freeText |
|
SetFreeTextDefaultAppearanceWithoutFont(Annots.FreeText)
Declaration
public static void SetFreeTextDefaultAppearanceWithoutFont(Annots.FreeText freeText)
Parameters
Type |
Name |
Description |
Annots.FreeText |
freeText |
|
Declaration
public static Task SetFullScreenModeAsync(bool fullScreen)
Parameters
Type |
Name |
Description |
System.Boolean |
fullScreen |
|
Returns
Declaration
public static void SetFullScreenModeDontWait(bool fullscreen)
Parameters
Type |
Name |
Description |
System.Boolean |
fullscreen |
|
Sets the unique identifier for the specified annotation, if possible.
This method does not lock the document, so a write lock should be acquired outside.
Declaration
public static void SetUniqueId(IAnnot annotation, string id)
Parameters
Type |
Name |
Description |
IAnnot |
annotation |
the annotation
|
System.String |
id |
the unique identifier
|
Declaration
public static string ShortenFileName(string fileName)
Parameters
Type |
Name |
Description |
System.String |
fileName |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static void ShowElement(FrameworkElement element, double width)
Parameters
Type |
Name |
Description |
Windows.UI.Xaml.FrameworkElement |
element |
|
System.Double |
width |
|
Display a toast notification on the bottom right to let
users know about Xodo activities
Declaration
public static void ShowToastNotification(string title, string content, string extraInfo, uint expirationTime = null, TypedEventHandler<ToastNotification, object> typedEvent = null)
Parameters
Type |
Name |
Description |
System.String |
title |
the title
|
System.String |
content |
the content text
|
System.String |
extraInfo |
|
System.UInt32 |
expirationTime |
how long the toast should be displayed in seconds
|
Windows.Foundation.TypedEventHandler<Windows.UI.Notifications.ToastNotification, System.Object> |
typedEvent |
|
Snaps a point to the specified rectangle
Declaration
public static void SnapPointToRect(Point point, Rect rect)
Parameters
Type |
Name |
Description |
pdftron.PDF.Point |
point |
the resulted point snapped to the rectangle
|
pdftron.PDF.Rect |
rect |
the rectangle
|
Helper method to swap the byte array for the audio stream since PDFTron SDK
requires it to be Big Endian
Declaration
public static byte[] SwapByteArray(byte[] a)
Parameters
Type |
Name |
Description |
System.Byte[] |
a |
|
Returns
Type |
Description |
System.Byte[] |
|
Declaration
public static void UngroupAnnotations(PDFViewCtrl pdfViewCtrl, List<IAnnot> allAnnotationsInGroup)
Parameters
Type |
Name |
Description |
PDFViewCtrl |
pdfViewCtrl |
PDFViewCtrl object which contains the current document
|
List<IAnnot> |
allAnnotationsInGroup |
the annotations in the group
|