PdfFileEditor.TryConcatenate

TryConcatenate(string, string, string)

Concatenates two files.

public bool TryConcatenate(string firstInputFile, string secInputFile, string outputFile)
ParameterTypeDescription
firstInputFileStringFirst file to concatenate.
secInputFileStringSecond file to concatenate.
outputFileStringOutput file.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

Examples

PdfFileEditor fileEditor = new PdfFileEditor();
bool result = fileEditor.TryConcatenate("file1.pdf", "file2.pdf", "outfile.pdf");

See Also


TryConcatenate(Document[], Document)

Concatenates documents.

public bool TryConcatenate(Document[] src, Document dest)
ParameterTypeDescription
srcDocument[]Array of source documents.
destDocumentDestination document.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

See Also


TryConcatenate(string[], string)

Concatenates files into one file.

public bool TryConcatenate(string[] inputFiles, string outputFile)
ParameterTypeDescription
inputFilesString[]Array of files to concatenate.
outputFileStringName of output file.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

Examples

PdfFileEditor pfe = new PdfFileEditor();
bool result = pfe.TryConcatenate(new string[] { "src1.pdf", "src2.pdf" }, "dest.pdf");

See Also


TryConcatenate(Stream[], Stream)

Concatenates files

public bool TryConcatenate(Stream[] inputStream, Stream outputStream)
ParameterTypeDescription
inputStreamStream[]Array of streams to be concatenated.
outputStreamStreamStream where result file will be stored.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

Examples

PdfFileEditor pfe = new PdfFileEditor();
Stream stream1 = new FileStream("file1.pdf", FileMode.Open, FileAccess.Read);
Stream stream2 = new FileStream("file2.pdf", FileMode.Open, FileAccess.Read);
Stream outstream = new FileStream("outfile.pdf", FileMode.Create, FileAccess.Write);
bool result = pfe.TryConcatenate(new Stream[] { stream1, stream2 } , outstream);

See Also


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.

public bool TryConcatenate(string firstInputFile, string secInputFile, string blankPageFile, 
    string outputFile)
ParameterTypeDescription
firstInputFileStringFirst file.
secInputFileStringSecond file.
blankPageFileStringPDF file with blank page.
outputFileStringResult file.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

Examples

PdfFileEditor pfe = new PdfFileEditor();
bool result = pfe.TryConcatenate("src1.pdf", "src2.pdf", "blank.pdf", "dest.pdf");

See Also


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.

public bool TryConcatenate(Stream firstInputStream, Stream secInputStream, Stream blankPageStream, 
    Stream outputStream)
ParameterTypeDescription
firstInputStreamStreamThe first Pdf Stream.
secInputStreamStreamThe second Pdf Stream.
blankPageStreamStreamThe Pdf Stream with blank page.
outputStreamStreamOutput Pdf Stream.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

Examples

PdfFileEditor pfe = new PdfFileEditor();
Stream stream1 = new FileStream("file1.pdf", FileMode.Open, FileAccess.Read);
Stream stream2 = new FileStream("file2.pdf", FileMode.Open, FileAccess.Read);
Stream blank = new FileStream("blank.pdf", FileMode.Open, FileAccess.Read);
Stream outstream = new FileStream("outfile.pdf", FileMode.Create, FileAccess.Write);
bool result = pfe.TryConcatenate(new Stream[] { stream1, stream2, blank } , outstream);

See Also


TryConcatenate(string[], HttpResponse)

Concatenates files and saves reslt into HttpResposnse object.

public bool TryConcatenate(string[] inputFiles, HttpResponse response)
ParameterTypeDescription
inputFilesString[]Array of files to concatenate.
responseHttpResponseResponse object.

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

See Also


TryConcatenate(Stream[], HttpResponse)

Concatenates files and stores result into HttpResponse object.

public bool TryConcatenate(Stream[] inputStream, HttpResponse response)
ParameterTypeDescription
inputStreamStream[]Streams array which contain files to concatenate.
responseHttpResponseResponse object/

Return Value

true if operation completed successfully; otherwise, false.

Remarks

The TryConcatenate method is like the Concatenate method, except the TryConcatenate method does not throw an exception if the operation fails.

See Also