Foxit PDF SDK  9.1
<FSPageOrganizerDelegate> Protocol Reference

The page organizer delegate, which handles moving/deleting/inserting pages..etc. More...

Inheritance diagram for <FSPageOrganizerDelegate>:
FSPDFViewCtrl

Instance Methods

(BOOL) - deletePagesAtIndexes:
 Delete the specifed pages. More...
 
(BOOL) - flattenPageAtIndex:display:options:
 Flatten the specifed page. More...
 
(NSString *) - getDocumentFilePath
 get file path to use in thumbnail More...
 
(BOOL) - insertPageFromImage:atIndex:
 Insert a new page from a specified image, the image will be converted to the new page. More...
 
(BOOL) - insertPages:pageSize:style:color:rotation:count:
 
(BOOL) - insertPages:width:height:style:color:rotation:count:
 
(void) - insertPagesFromDocument:withSourceIndexes:flags:layerName:atIndex:success:error:
 Insert multiple new pages to the current document with the pdf pages copied from the source pdf document. More...
 
(BOOL) - movePagesFromIndexes:toIndex:
 Move the specifed pages to the destination page, the moved pages will be inserted after the destination page. More...
 
(BOOL) - rotatePagesAtIndexes:clockwise:
 Rotate the specifed pages by 90 degree or -90 degree. More...
 

Detailed Description

The page organizer delegate, which handles moving/deleting/inserting pages..etc.

Method Documentation

◆ deletePagesAtIndexes:

- (BOOL) deletePagesAtIndexes: (NSArray< NSNumber * > *)  pageIndexes

Delete the specifed pages.

Parameters
[in]pageIndexesThe specified pages index array to be deleted.
Returns
YES means success, while NO means fail.

◆ flattenPageAtIndex:display:options:

- (BOOL) flattenPageAtIndex: (int)  pageIndex
display: (BOOL)  display
options: (FSPDFPageFlattenOptions options 

Flatten the specifed page.

Parameters
[in]pageIndexThe specified page index to be flattened.
[in]displayDecide the purpose of the flattened result: true means the flatten result is used for display only, and false means the flatten result is used for print only.
[in]optionsThe flatten options. Please refer to values starting from FSPDFPageFlattenAll and this should one or a combination of them.
Specially, if FSPDFPageFlattenNoAnnot and FSPDFPageFlattenNoFormControl are used together, that means nothing is to be flatten to page and this function will return true directly. Default value: FSPDFPageFlattenAll.
Returns
YES means success, while NO means fail.

◆ getDocumentFilePath

- (NSString *) getDocumentFilePath

get file path to use in thumbnail

Returns
filepath

◆ insertPageFromImage:atIndex:

- (BOOL) insertPageFromImage: (UIImage *__nonnull)  image
atIndex: (NSUInteger)  pageIndex 

Insert a new page from a specified image, the image will be converted to the new page.

Parameters
[in]imageThe specified image.
[in]pageIndexThe page index for new page.
If parameter pageIndex is equal to or less than 0, the new page will be inserted to the first.
If parameter pageIndex is equal to or larger than current page count, the new page will be inserted to the end.
Returns
YES means success, while NO means fail.

◆ insertPages:pageSize:style:color:rotation:count:

- (BOOL) insertPages: (int)  index
pageSize: (FSPDFPageSize pageSize
style: (PDF_PAGE_STYLE_TYPE style
color: (unsigned int)  color
rotation: (FSRotation rotation
count: (int)  count 

Insert new blank PDF pages to document, by index.

Parameters
indexA page index in current PDF document. This is used to specify where the imported pages will be inserted.
If parameter index is less than 0, the new page will be inserted to the first.
If parameter index is equal to or larger than current page count, the new page will be inserted to the end.
pageSizePageSize type of new page. Please refer to values starting from FSPDFObjC::FSPDFPageSize#FSPDFPageSizeLetterand this should be one of these values.
styleThe syle of new page.Please refer to values starting from FSPDFViewCtrl#PDF_PAGE_STYLE_TYPE_XXXand this should be one of these values.
colorColor of new page.Format: 0xAARRGGBB.
rotationNew page rotation value. Please refer to values starting from FSPDFObjC::FSRotation#FSRotation0 and this should be one of these values except FSPDFObjC::FSRotation#FSRotationUnknown
countThe count of new pages to be inserted(count is greater than 0).
Returns
YES means success, while NO means failure.

◆ insertPages:width:height:style:color:rotation:count:

- (BOOL) insertPages: (int)  index
width: (float)  width
height: (float)  height
style: (PDF_PAGE_STYLE_TYPE style
color: (unsigned int)  color
rotation: (FSRotation rotation
count: (int)  count 

Insert new blank PDF pages to document, by index.

Parameters
indexA page index in current PDF document. This is used to specify where the imported pages will be inserted.
If parameter index is less than 0, the new page will be inserted to the first.
If parameter index is equal to or larger than current page count, the new page will be inserted to the end.
widthWidth of new page (unit is 1/72 inch,width is greater than 0).
heightHeight of new page (unit is 1/72 inch,height is greater than 0).
styleThe syle of new page.Please refer to values starting from FSPDFViewCtrl#PDF_PAGE_STYLE_TYPE_XXXand this should be one of these values.
colorColor of new page.Format: 0xAARRGGBB.
rotationNew page rotation value. Please refer to values starting from FSPDFObjC::FSRotation#FSRotation0 and this should be one of these values except FSPDFObjC::FSRotation#FSRotationUnknown
countThe count of new pages to be inserted(count is greater than 0).
Returns
YES means success, while NO means failure.

◆ insertPagesFromDocument:withSourceIndexes:flags:layerName:atIndex:success:error:

- (void) insertPagesFromDocument: (FSPDFDoc *)  document
withSourceIndexes: (NSArray< NSNumber * > *)  sourcePagesIndexes
flags: (FSPDFDocImportPageFlags flags
layerName: (NSString *_Nullable)  layerName
atIndex: (NSUInteger)  destinationIndex
success: (void(^)(NSString *result))  success
error: (void(^)(NSString *errorInfo))  error 

Insert multiple new pages to the current document with the pdf pages copied from the source pdf document.

Parameters
[in]documentThe source pdf document.
[in]sourcePagesIndexesThe specified pages index array to be copied.
[in]flagsOptions for importing pages. Please refer to FSPDFDocImportPageFlags::FSPDFDocImportFlagXXX and this can be one or a combination of them.
[in]layerNameThe name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application, in UTF-8 encoding. If parameter flags contains FSPDFDocImportPageFlags::FSPDFDocImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain FSPDFDocImportPageFlags::FSPDFDocImportFlagWithLayers, this string will be ignored.
  • If all the pages of source PDF document is to be imported to current document, all layers from source document will be grouped under a non-selectable label, and this string will be directly used as the label.
  • If only part of pages of source PDF document is to be imported to current document, layers in the same page will be grouped under a single non-selectable label, and this string will be used as the prefix name of the label. The label will be like "layerName_Page_X".
[in]pageIndexThe specified page to be inserted before. If parameter pageIndex is equal to or less than 0, the new page will be inserted to the first.
If parameter pageIndex is equal to or larger than current page count, the new page will be inserted to the end.
[in]successThe callback will be called when the page insertion is successful.
[in]errorThe callback will be called when page insertion fails and error message info is thrown.

◆ movePagesFromIndexes:toIndex:

- (BOOL) movePagesFromIndexes: (NSArray< NSNumber * > *)  sourcePageIndexes
toIndex: (NSUInteger)  pageIndex 

Move the specifed pages to the destination page, the moved pages will be inserted after the destination page.

Parameters
[in]sourcePageIndexesThe specified pages index array to be moved.
[in]pageIndexThe page index to be inserted before.
Returns
YES means success, while NO means fail.

◆ rotatePagesAtIndexes:clockwise:

- (BOOL) rotatePagesAtIndexes: (NSArray< NSNumber * > *)  pageIndexes
clockwise: (BOOL)  clockwise 

Rotate the specifed pages by 90 degree or -90 degree.

Parameters
[in]pageIndexesThe specified pages index array to be rotated.
[in]clockwiseIf yes, the pages will be rotated by 90 degree, if no, the pages will be rotated by -90 degree.
Returns
YES means success, while NO means fail.