Class PdfFileEditor

PdfFileEditor class

Implements operations with PDF file: concatenation, splitting, extracting pages, making booklet, etc.

public sealed class PdfFileEditor

Constructors

NameDescription
PdfFileEditor()The default constructor.

Properties

NameDescription
AttachmentName { get; set; }Gets or sets name of attachment when result of operation is stored into HttpResponse objects as attachment.
CloseConcatenatedStreams { get; set; }If set to true, streams are closed after operation.
ConcatenationPacketSize { get; set; }Number of documents concatenated before new incremental update was made during concatenation when UseDiskBuffer is set to true.
ContentDisposition { get; set; }Gets or sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
ConversionLog { get; }Gets log of conversion process.
ConvertTo { set; }Sets PDF file format. Result file will be saved in specified file format. If this property is not specified then file will be save in default PDF format without conversion.
CopyLogicalStructure { get; set; }If true then logical structure of the file is copied when concatenation is performed.
CopyOutlines { get; set; }If true then outlines will be copied.
CorruptedFileAction { get; set; }This property defines behavior when concatenating process met corrupted file. Possible values are: StopWithError and ConcatenateIgnoringCorrupted.
CorruptedItems { get; }Array of encountered problems when concatenation was performed. For every corrupted document from passed to Concatenate() function new CorruptedItem entry is created. This property may be used only when CorruptedFileAction is ConcatenateIgnoringCorrupted.
IncrementalUpdates { get; set; }If true, incremental updates are made during concatenation.
KeepActions { get; set; }If true actions will be copied from source documents. Defaulkt value : true.
KeepFieldsUnique { get; set; }If true then field names will be made unique when forms are concatenated. Suffixes will be added to field names, suffix template may be specified in UniqueSuffix property.
LastException { get; }Gets last occured exception. May be used to check the reason of failure.
MergeDuplicateLayers { get; set; }Optional contents of concatentated documents with equal names will be merged into one layer in resulstant document if this property is true. Else, layers with equal names will be save as different layers in resultant document.
MergeDuplicateOutlines { get; set; }If true, duplicate outlines are merged.
OptimizeSize { get; set; }Gets or sets optimization flag. Equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false.
OwnerPassword { get; set; }Sets owner’s password if the source input Pdf file is encrypted. This property is not implemented yet.
PreserveUserRights { get; set; }If true, user rights of first document are applied to concatenated document. User rights of all other documents are ignored.
RemoveSignatures { get; set; }If true, all signatures will be removed from fields (fields will remain); otherwise, you can get invalid signatures.
SaveOptions { get; set; }Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
UniqueSuffix { get; set; }Format of the suffix which is added to field name to make it unique when forms are concatenated. This string must contain %NUM% substring which will be replaced with numbers. For example if UniqueSuffix = “ABC%NUM%” then for field “fieldName” names will be: fieldNameABC1, fieldNameABC2, fieldNameABC3 etc.
UseDiskBuffer { get; set; }If this option used then destination document will be saved on disk periodically and further concatenation will appllied to it as incremental updates.

Methods

NameDescription
AddMargins(Stream, Stream, int[], double, double, double, double)Resizes page contents and add specifed margins. Margins are specified in default space units.
AddMargins(string, string, int[], double, double, double, double)Resizes page contents and add specifed margins. Margins are specified in default space units.
AddMarginsPct(Stream, Stream, int[], double, double, double, double)Resizes page contents and add specified margins. Margins are specified in percents of intitial page size.
AddMarginsPct(string, string, int[], double, double, double, double)Resizes page contents and add specified margins. Margins are specified in percents of intitial page size.
AddPageBreak(Document, Document, PageBreak[])Adds page breaks into document pages.
AddPageBreak(Stream, Stream, PageBreak[])Adds page breaks into document pages.
AddPageBreak(string, string, PageBreak[])Adds page breaks into document pages.
Append(Stream, Stream, int, int, Stream)Appends pages,which are chosen from portStream within the range from startPage to endPage, in portStream at the end of firstInputStream.
Append(Stream, Stream[], int, int, HttpResponse)Appends documents to source document and saves result into response object.
Append(Stream, Stream[], int, int, Stream)Appends pages, which are chosen from array of documents in portStreams. The result document includes firstInputFile and all portStreams documents pages in the range startPage to endPage.
Append(string, string, int, int, string)Appends pages, which are chosen from portFile within the range from startPage to endPage, in portFile at the end of firstInputFile.
Append(string, string[], int, int, HttpResponse)Appends documents to source document and saves result into HttpResponse object.
Append(string, string[], int, int, string)Appends pages, which are chosen from portFiles documents. The result document includes firstInputFile and all portFiles documents pages in the range startPage to endPage.
Concatenate(Document[], Document)Concatenates documents.
Concatenate(Stream[], HttpResponse)Concatenates files and stores result into HttpResponse object.
Concatenate(Stream[], Stream)Concatenates files
Concatenate(string[], HttpResponse)Concatenates files and saves reslt into HttpResposnse object.
Concatenate(string[], string)Concatenates files into one file.
Concatenate(Stream, Stream, Stream)Concatenates two files.
Concatenate(string, string, string)Concatenates two files.
Concatenate(Stream, Stream, Stream, Stream)Merges two Pdf documents into a new Pdf document with pages in alternate ways and fill the blank places with blank pages. e.g.: document1 has 5 pages: p1, p2, p3, p4, p5. document2 has 3 pages: p1’, p2’, p3’. Merging the two Pdf document will produce the result document with pages:p1, p1’, p2, p2’, p3, p3’, p4, blankpage, p5, blankpage.
Concatenate(string, string, string, string)Merges two Pdf documents into a new Pdf document with pages in alternate ways and fill the blank places with blank pages. e.g.: document1 has 5 pages: p1, p2, p3, p4, p5. document2 has 3 pages: p1’, p2’, p3’. Merging the two Pdf document will produce the result document with pages:p1, p1’, p2, p2’, p3, p3’, p4, blankpage, p5, blankpage.
Delete(Stream, int[], HttpResponse)Deletes specified pages from document and saves result into HttpResponse object.
Delete(Stream, int[], Stream)Deletes pages specified by number array from input file, saves as a new Pdf file.
Delete(string, int[], HttpResponse)Deletes specified pages from document and stores result into HttpResponse object.
Delete(string, int[], string)Deletes pages specified by number array from input file, saves as a new Pdf file.
Extract(Stream, int[], HttpResponse)Extracts specified pages form source file and stores result into HttpResponse object.
Extract(Stream, int[], Stream)Extracts pages specified by number array, saves as a new Pdf file.
Extract(string, int[], HttpResponse)Extracts specified pages from source file and stores result into HttpResponse object.
Extract(string, int[], string)Extracts pages specified by number array, saves as a new PDF file.
Extract(Stream, int, int, Stream)Extracts pages from input file,saves as a new Pdf file.
Extract(string, int, int, string)Extracts pages from input file,saves as a new Pdf file.
Insert(Stream, int, Stream, int[], HttpResponse)Inserts document into other document and stores result into response object.
Insert(Stream, int, Stream, int[], Stream)Inserts pages from an other file into the input Pdf file.
Insert(string, int, string, int[], HttpResponse)Inserts contents of file into source file and stores result into HttpResponse object.
Insert(string, int, string, int[], string)Inserts pages from an other file into the input Pdf file.
Insert(Stream, int, Stream, int, int, Stream)Inserts pages from an other file into the input Pdf file.
Insert(string, int, string, int, int, string)Inserts pages from an other file into the Pdf file at a position.
MakeBooklet(Stream, Stream)Makes booklet from the InputStream to outputStream.
MakeBooklet(string, string)Makes booklet from the input file to output file.
MakeBooklet(Stream, PageSize, HttpResponse)Makes booklet from source file and stores result into HttpResponse.
MakeBooklet(Stream, Stream, PageSize)Makes booklet from the input stream and save result into output stream.
MakeBooklet(string, PageSize, HttpResponse)Makes booklet from source file and stores result into HttpResponse objects.
MakeBooklet(string, string, PageSize)Makes booklet from the inputFile to outputFile.
MakeBooklet(Stream, Stream, int[], int[])Makes customized booklet from the firstInputStream to outputStream.
MakeBooklet(string, string, int[], int[])Makes customized booklet from the firstInputFile to outputFile.
MakeBooklet(Stream, PageSize, int[], int[], HttpResponse)Make booklet from PDF file and stores it into HttpResponse.
MakeBooklet(Stream, Stream, PageSize, int[], int[])Makes booklet from the firstInputStream to outputStream.
MakeBooklet(string, PageSize, int[], int[], HttpResponse)Makes booklet from source file and stores result into HttpResponse objects.
MakeBooklet(string, string, PageSize, int[], int[])Makes customized booklet from the firstInputFile to outputFile.
MakeNUp(Stream, Stream, Stream)Makes N-Up document from the two input PDF streams to outputStream.
MakeNUp(Stream[], Stream, bool)Makes N-Up document from the multi input PDF streams to outputStream. Each page of outputStream will contain multi pages, which are combination with pages in the input streams of the same page number. The multi-pages piled up horizontally if isSidewise is true and piled up vertically if isSidewise is false.
MakeNUp(string, string, string)Makes N-Up document from the two input PDF files to outputFile. Each page of outputFile will contain two pages, one page is from the first input file and another is from the second input file. The two pages are piled up horizontally.
MakeNUp(string[], string, bool)Makes N-Up document from the multi input PDF files to outputFile. Each page of outputFile will contain multi pages, which are combination with pages in the input files of the same page number. The multi pages piled up horizontally if isSidewise is true and piled up vertically if isSidewise is false.
MakeNUp(Stream, int, int, HttpResponse)Makes N-up document and stores result into HttpResponse.
MakeNUp(Stream, Stream, int, int)Makes N-Up document from the input stream and saves result into output stream.
MakeNUp(string, int, int, HttpResponse)Makes N-up document and stores result into HttpResponse.
MakeNUp(string, string, int, int)Makes N-Up document from the firstInputFile to outputFile.
MakeNUp(Stream, int, int, PageSize, HttpResponse)Makes N-up document and stores result into HttpResponse object.
MakeNUp(Stream, Stream, int, int, PageSize)Makes N-Up document from the first input stream to output stream.
MakeNUp(string, int, int, PageSize, HttpResponse)Makes N-up document and stores result into HttpResponse object.
MakeNUp(string, string, int, int, PageSize)Makes N-Up document from the input file to outputFile.
ResizeContents(Document, ContentsResizeParameters)Resizes pages of document. Blank margins are added around of shrinked page.
ResizeContents(Document, int[], ContentsResizeParameters)Resizes pages of document. Blank margins are added around of shrinked page.
ResizeContents(Stream, int[], ContentsResizeParameters, HttpResponse)Resizes contents of pages in document. If page is shrinked blank margins are added around the page. Result is stored into HttpResponse object.
ResizeContents(Stream, Stream, int[], ContentsResizeParameters)Resizes contents of pages of the document.
ResizeContents(string, int[], ContentsResizeParameters, HttpResponse)Resizes contents of pages in document. If page is shrinked blank margins are added around the page. Result is stored into HttpResponse object.
ResizeContents(string, string, int[], ContentsResizeParameters)Resizes contents of pages in document. If page is shrinked blank margins are added around the page.
ResizeContents(Stream, Stream, int[], double, double)Resizes contents of document pages. Shrinks contents of page and adds margins. New size of contents is specified in default space units.
ResizeContents(string, string, int[], double, double)Resizes contents of document pages. Shrinks contents of page and adds margins. New size of contents is specified in default space units.
ResizeContentsPct(Stream, Stream, int[], double, double)Resizes contents of document pages. Shrinks contents of page and adds margins. New contents size is specified in percents.
ResizeContentsPct(string, string, int[], double, double)Resizes contents of document pages. Shrinks contents of page and adds margins. New contents size is specified in percents.
SplitFromFirst(Stream, int, HttpResponse)Splits document from start to specified location and stores result into HttpResponse object.
SplitFromFirst(Stream, int, Stream)Splits from start to specified location,and saves the front part in output Stream.
SplitFromFirst(string, int, HttpResponse)Splits document from first page to location and saves result into HttpResponse objects.
SplitFromFirst(string, int, string)Splits Pdf file from first page to specified location,and saves the front part as a new file.
SplitToBulks(Stream, int[][])Splits the Pdf file into several documents.The documents can be single-page or multi-pages.
SplitToBulks(string, int[][])Splits the Pdf file into several documents.The documents can be single-page or multi-pages.
SplitToEnd(Stream, int, HttpResponse)Splits from specified location, and saves the rear part into HttpResponse object.
SplitToEnd(Stream, int, Stream)Splits from specified location, and saves the rear part as a new file Stream.
SplitToEnd(string, int, HttpResponse)Splits from specified location, and saves the rear part into HttpResponse object.
SplitToEnd(string, int, string)Splits from location, and saves the rear part as a new file.
SplitToPages(Stream)Splits the Pdf file into single-page documents.
SplitToPages(string)Splits the PDF file into single-page documents.
SplitToPages(Stream, string)Split the Pdf file into single-page documents and saves it into specified path. Path is specifield by field name temaplate.
SplitToPages(string, string)Split the Pdf file into single-page documents and saves it into specified path. Path is specifield by field name temaplate.
TryAppend(Stream, Stream[], int, int, HttpResponse)Appends documents to source document and saves result into response object.
TryAppend(Stream, Stream[], int, int, Stream)Appends pages, which are chosen from array of documents in portStreams. The result document includes firstInputFile and all portStreams documents pages in the range startPage to endPage.
TryAppend(string, string[], int, int, HttpResponse)Appends documents to source document and saves result into HttpResponse object.
TryAppend(string, string[], int, int, string)Appends pages, which are chosen from portFiles documents. The result document includes firstInputFile and all portFiles documents pages in the range startPage to endPage.
TryConcatenate(Document[], Document)Concatenates documents.
TryConcatenate(Stream[], HttpResponse)Concatenates files and stores result into HttpResponse object.
TryConcatenate(Stream[], Stream)Concatenates files
TryConcatenate(string[], HttpResponse)Concatenates files and saves reslt into HttpResposnse object.
TryConcatenate(string[], string)Concatenates files into one file.
TryConcatenate(string, string, string)Concatenates two files.
TryConcatenate(Stream, Stream, Stream, Stream)Merges two Pdf documents into a new Pdf document with pages in alternate ways and fill the blank places with blank pages. e.g.: document1 has 5 pages: p1, p2, p3, p4, p5. document2 has 3 pages: p1’, p2’, p3’. Merging the two Pdf document will produce the result document with pages:p1, p1’, p2, p2’, p3, p3’, p4, blankpage, p5, blankpage.
TryConcatenate(string, string, string, string)Merges two Pdf documents into a new Pdf document with pages in alternate ways and fill the blank places with blank pages. e.g.: document1 has 5 pages: p1, p2, p3, p4, p5. document2 has 3 pages: p1’, p2’, p3’. Merging the two Pdf document will produce the result document with pages:p1, p1’, p2, p2’, p3, p3’, p4, blankpage, p5, blankpage.
TryDelete(Stream, int[], HttpResponse)Deletes specified pages from document and saves result into HttpResponse object.
TryDelete(Stream, int[], Stream)Deletes pages specified by number array from input file, saves as a new Pdf file.
TryDelete(string, int[], HttpResponse)Deletes specified pages from document and stores result into HttpResponse object.
TryDelete(string, int[], string)Deletes pages specified by number array from input file, saves as a new Pdf file.
TryExtract(Stream, int[], HttpResponse)Extracts specified pages form source file and stores result into HttpResponse object.
TryExtract(Stream, int[], Stream)Extracts pages specified by number array, saves as a new Pdf file.
TryExtract(string, int[], HttpResponse)Extracts specified pages from source file and stores result into HttpResponse object.
TryExtract(string, int[], string)Extracts pages specified by number array, saves as a new PDF file.
TryExtract(string, int, int, string)Extracts pages from input file,saves as a new Pdf file.
TryInsert(Stream, int, Stream, int[], HttpResponse)Inserts document into other document and stores result into response object.
TryInsert(Stream, int, Stream, int[], Stream)Inserts pages from an other file into the input Pdf file.
TryInsert(string, int, string, int[], HttpResponse)Inserts contents of file into source file and stores result into HttpResponse object.
TryInsert(string, int, string, int[], string)Inserts pages from an other file into the input Pdf file.
TryMakeBooklet(Stream, Stream)Makes booklet from the InputStream to outputStream.
TryMakeBooklet(string, string)Makes booklet from the input file to output file.
TryMakeBooklet(Stream, PageSize, HttpResponse)Makes booklet from source file and stores result into HttpResponse.
TryMakeBooklet(Stream, Stream, PageSize)Makes booklet from the input stream and save result into output stream.
TryMakeBooklet(string, PageSize, HttpResponse)Makes booklet from source file and stores result into HttpResponse objects.
TryMakeBooklet(string, string, PageSize)Makes booklet from the inputFile to outputFile.
TryMakeBooklet(Stream, Stream, int[], int[])Makes customized booklet from the firstInputStream to outputStream.
TryMakeBooklet(string, string, int[], int[])Makes customized booklet from the firstInputFile to outputFile.
TryMakeBooklet(Stream, PageSize, int[], int[], HttpResponse)Make booklet from PDF file and stores it into HttpResponse.
TryMakeBooklet(Stream, Stream, PageSize, int[], int[])Makes booklet from the firstInputStream to outputStream.
TryMakeBooklet(string, PageSize, int[], int[], HttpResponse)Makes booklet from source file and stores result into HttpResponse objects.
TryMakeBooklet(string, string, PageSize, int[], int[])Makes customized booklet from the firstInputFile to outputFile.
TryMakeNUp(Stream, Stream, Stream)Makes N-Up document from the two input PDF streams to outputStream.
TryMakeNUp(Stream[], Stream, bool)Makes N-Up document from the multi input PDF streams to outputStream. Each page of outputStream will contain multi pages, which are combination with pages in the input streams of the same page number. The multi-pages piled up horizontally if isSidewise is true and piled up vertically if isSidewise is false.
TryMakeNUp(string, string, string)Makes N-Up document from the two input PDF files to outputFile. Each page of outputFile will contain two pages, one page is from the first input file and another is from the second input file. The two pages are piled up horizontally.
TryMakeNUp(string[], string, bool)Makes N-Up document from the multi input PDF files to outputFile. Each page of outputFile will contain multi pages, which are combination with pages in the input files of the same page number. The multi pages piled up horizontally if isSidewise is true and piled up vertically if isSidewise is false.
TryMakeNUp(Stream, int, int, HttpResponse)Makes N-up document and stores result into HttpResponse.
TryMakeNUp(Stream, Stream, int, int)Makes N-Up document from the input stream and saves result into output stream.
TryMakeNUp(string, int, int, HttpResponse)Makes N-up document and stores result into HttpResponse.
TryMakeNUp(string, string, int, int)Makes N-Up document from the firstInputFile to outputFile.
TryMakeNUp(Stream, int, int, PageSize, HttpResponse)Makes N-up document and stores result into HttpResponse object.
TryMakeNUp(Stream, Stream, int, int, PageSize)Makes N-Up document from the first input stream to output stream.
TryMakeNUp(string, int, int, PageSize, HttpResponse)Makes N-up document and stores result into HttpResponse object.
TryMakeNUp(string, string, int, int, PageSize)Makes N-Up document from the input file to outputFile.
TryResizeContents(Stream, int[], ContentsResizeParameters, HttpResponse)Resizes contents of pages in document. If page is shrinked blank margins are added around the page. Result is stored into HttpResponse object.
TryResizeContents(Stream, Stream, int[], ContentsResizeParameters)Resizes contents of pages of the document.
TryResizeContents(string, int[], ContentsResizeParameters, HttpResponse)Resizes contents of pages in document. If page is shrinked blank margins are added around the page. Result is stored into HttpResponse object.
TryResizeContents(string, string, int[], ContentsResizeParameters)Resizes contents of pages in document. If page is shrinked blank margins are added around the page.
TryResizeContents(Stream, Stream, int[], double, double)Resizes contents of document pages. Shrinks contents of page and adds margins. New size of contents is specified in default space units.
TrySplitFromFirst(Stream, int, HttpResponse)Splits document from start to specified location and stores result into HttpResponse object.
TrySplitFromFirst(Stream, int, Stream)Splits from start to specified location,and saves the front part in output Stream.
TrySplitFromFirst(string, int, HttpResponse)Splits document from first page to location and saves result into HttpResponse objects.
TrySplitFromFirst(string, int, string)Splits Pdf file from first page to specified location,and saves the front part as a new file.
TrySplitToEnd(Stream, int, HttpResponse)Splits from specified location, and saves the rear part into HttpResponse object.
TrySplitToEnd(Stream, int, Stream)Splits from specified location, and saves the rear part as a new file Stream.
TrySplitToEnd(string, int, HttpResponse)Splits from specified location, and saves the rear part into HttpResponse object.
TrySplitToEnd(string, int, string)Splits from location, and saves the rear part as a new file.

Other Members

NameDescription
enum ConcatenateCorruptedFileActionAction performed when corrupted file was met in concatenation process.
class ContentsResizeParametersClass for specifing page resize parameters. Allow to set the following parameters: Size of result page (width, height) in default space units or in percents of initial pages size; Left, Top, Bottom and Right margins in default space units or in percents of initial page size; Some values may be left null for automatic calculation. These values will be calculated from rest of page size after calculation explicitly specified values. For example: if page width = 100 and new page width specified 60 units then left and right margins are automatically calculated: (100 - 60) / 2 = 15. This class is used in ResizeContents method.
class ContentsResizeValueValue of margin or content size specified in percents of default space units. This class is used in ContentsResizeParameters.
class CorruptedItemClass which provides information about corrupted files in time of concatenation.
class PageBreakData of page break position.

See Also