Other Functions
The following functions are available globally.
-
Creates a new
See moreNSErrorobject from aPTPDFNetException.Declaration
Objective-C
extern NSError *_Nonnull PTPDFNetExceptionToError( PTPDFNetException *_Nonnull exception)Swift
func PTPDFNetExceptionToError(_ exception: PTPDFNetException) -> any ErrorParameters
exceptionThe exception.
Return Value
A new
NSErrorobject initialized with the exception’s information.
-
Returns the extended annotation type for the given name.
See moreDeclaration
Objective-C
extern PTExtendedAnnotType PTExtendedAnnotTypeFromName(PTExtendedAnnotName _Nullable name)Swift
func PTExtendedAnnotTypeFromName(_ name: PTExtendedAnnotName?) -> PTExtendedAnnotTypeParameters
namethe annotation type name
Return Value
the corresponding extended annotation type, or
PTExtendedAnnotTypeUnknownif the name is not known -
Returns the annotation name for the given extended annotation type.
See moreDeclaration
Objective-C
extern PTExtendedAnnotName _Nullable PTExtendedAnnotNameFromType( PTExtendedAnnotType type)Swift
func PTExtendedAnnotNameFromType(_ type: PTExtendedAnnotType) -> PTExtendedAnnotName?Parameters
typethe extended annotation type
Return Value
the corresponding annotation name, or
nilif the annotation type is not known -
Returns a localized display name for the given extended annotation type.
See moreDeclaration
Objective-C
extern NSString *_Nullable PTLocalizedAnnotationNameFromType( PTExtendedAnnotType type)Swift
func PTLocalizedAnnotationNameFromType(_ type: PTExtendedAnnotType) -> String?Parameters
typethe extended annotation type
Return Value
the localized display name, or
nilif the annotation type is not known -
Declaration
Objective-C
extern Class _Nullable PTAnnotClassForAnnot(PTAnnot *_Nonnull annotation)Swift
func PTAnnotClassForAnnot(_ annotation: PTAnnot) -> AnyClass?Parameters
annotationthe annotation
Return Value
the most derived
PTAnnotsubclass for the specified annotation, ornilif the class cannot be determined -
Declaration
Objective-C
extern Class _Nullable PTWidgetClassForWidgetAnnot(PTWidget *_Nonnull widget)Swift
func PTWidgetClassForWidgetAnnot(_ widget: PTWidget) -> AnyClass?Parameters
widgetthe widget annotation
Return Value
the most derived
PTWidgetsubclass for the specified widget annotation, ofnilif the class cannot be determined -
Undocumented
See moreDeclaration
Objective-C
static inline BOOL PTPDFPageNumberIsValid(PTPDFPageNumber pageNumber) { return pageNumber != PTInvalidPDFPageNumber; }Swift
func PTPDFPageNumberIsValid(_ pageNumber: PTPDFPageNumber) -> Bool
-
Use the default
See morePTAnalyticsManagerto log the given exception.Declaration
Objective-C
extern void PTLogException(NSException *_Nonnull exception, NSDictionary<id, id> *_Nullable extraData)Swift
func PTLogException(_ exception: NSException, _ extraData: [AnyHashable : Any]?)Parameters
exceptionthe exception to log
extraDataextra information to pass along with the exception
-
Use the default
See morePTAnalyticsManagerto log the given event.Declaration
Objective-C
extern void PTLogAnalyticsEvent(PTAnalyticsEventCategory _Nullable category, NSString *_Nonnull eventDescription, ...)Parameters
eventDescriptionThe format-string for the event description.
...A comma-separated list of arguments to substitute into
eventDescription. -
Converts a
See moreCGLineJoinenumeration value to the correspondingPTLineJoinvalue.Declaration
Objective-C
extern PTLineJoin PTLineJoinFromCGLineJoin(CGLineJoin lineJoin)Swift
func PTLineJoinFromCGLineJoin(_ lineJoin: CGLineJoin) -> PTLineJoinParameters
lineJoinThe value to be converted
Return Value
the corresponding
PTLineJoinvalue -
Returns a localized version of a string, using the Tools bundle.
See moreDeclaration
Objective-C
extern NSString *_Nonnull PTLocalizedString(NSString *_Nonnull key, NSString *_Nullable comment)Swift
func PTLocalizedString(_ key: String, _ comment: String?) -> String -
Returns a localized version of a string from the specified table, using the Tools bundle.
See moreDeclaration
Objective-C
extern NSString *_Nonnull PTLocalizedStringFromTable( NSString *_Nonnull key, NSString *_Nullable table, NSString *_Nullable comment)Swift
func PTLocalizedString(key: String, table: String?, comment: String?) -> String -
Returns the corresponding non-continuous page presentation mode for the given mode. If the mode is already non-continuous then the input mode is returned.
See moreDeclaration
Objective-C
extern TrnPagePresentationMode PTPagePresentationModeGetBaseMode(TrnPagePresentationMode mode)Swift
func PTPagePresentationModeGetBaseMode(_ mode: TrnPagePresentationMode) -> TrnPagePresentationModeParameters
modethe page presentation mode
Return Value
the corresponding non-continuous page presentation mode
-
Returns whether the given page presentation mode is continuous.
See moreDeclaration
Objective-C
extern BOOL PTPagePresentationModeIsContinuous(TrnPagePresentationMode mode)Swift
func PTPagePresentationModeIsContinuous(_ mode: TrnPagePresentationMode) -> BoolParameters
modethe page presentation mode
Return Value
YESif the page presentation mode is continuous,NOotherwise -
This function is used to toggle the continuous aspect of a page presentation mode. For the specified page presentation mode, a corresponding mode will be returned with the continuous aspect added or removed according to the
See morecontinuousparameter.Declaration
Objective-C
extern TrnPagePresentationMode PTPagePresentationModeGetEffectiveMode(TrnPagePresentationMode mode, BOOL continuous)Swift
func PTPagePresentationModeGetEffectiveMode(_ mode: TrnPagePresentationMode, _ continuous: Bool) -> TrnPagePresentationModeParameters
modethe page presentation mode
continuousYESif the resulting page presentation mode should be continuous,NOotherwiseReturn Value
the corresponding page presentation mode with the continuous aspect added or removed according to the
continuousparameter.
Other Functions Reference