public static void Run() { // ExStart:MakeNUpUsingPageSizeAndPaths // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Make NUp pdfEditor.MakeNUp(dataDir + "MultiplePages.pdf", dataDir + "MakeNUpUsingPageSizeAndPaths_out.pdf", 2, 3, PageSize.A5); // ExEnd:MakeNUpUsingPageSizeAndPaths }
public static void Run() { // ExStart:UsingPageSizeHorizontalAndVerticalValues // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Make NUp pdfEditor.MakeNUp(dataDir + "input.pdf", "UsingPageSizeHorizontalAndVerticalValues_out.pdf", 2, 3); // ExEnd:UsingPageSizeHorizontalAndVerticalValues }
public static void Run() { // ExStart:MakeNUpUsingPageSizeAndStreams // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create streams FileStream inputStream = new FileStream(dataDir + "input.pdf", FileMode.Open); FileStream outputStream = new FileStream(dataDir + "MakeNUpUsingPageSizeAndStreams_out.pdf", FileMode.Create); // Make NUp pdfEditor.MakeNUp(inputStream, outputStream, 2, 3, PageSize.A5); // ExEnd:MakeNUpUsingPageSizeAndStreams }
public static void Run() { // ExStart:UsingPageSizeHorizontalVerticalValuesAndStreams // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create streams FileStream inputStream = new FileStream(dataDir + "input.pdf", FileMode.Open); FileStream outputStream = new FileStream(dataDir + "UsingPageSizeHorizontalVerticalValuesAndStreams_out.pdf", FileMode.Create); // Make NUp pdfEditor.MakeNUp(inputStream, outputStream, 2, 3); // ExEnd:UsingPageSizeHorizontalVerticalValuesAndStreams }
public static void Run() { // ExStart:UsingArrayOfFilesAndPaths // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create array of files string[] filesArray = new string[2]; filesArray[0] = dataDir + "input.pdf"; filesArray[1] = dataDir + "input2.pdf"; // Make NUp pdfEditor.MakeNUp(filesArray, dataDir + "UsingArrayOfFilesAndPaths_out.pdf", true); // ExEnd:UsingArrayOfFilesAndPaths }
public static void Run() { // ExStart:UsingArrayOfFilesAndPaths // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create array of files string[] filesArray = new string[2]; filesArray[0] = dataDir + "input.pdf"; filesArray[1] = dataDir + "input2.pdf"; // Make NUp pdfEditor.MakeNUp(filesArray, dataDir + "UsingArrayOfFilesAndPaths_out_.pdf", true); // ExEnd:UsingArrayOfFilesAndPaths }
public static void Run() { // ExStart:UsingArrayOfFilesAndStreams // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create streams FileStream[] fileStreams = new FileStream[2]; fileStreams[0] = new FileStream(dataDir + "input.pdf", FileMode.Open); fileStreams[1] = new FileStream(dataDir + "input2.pdf", FileMode.Open); FileStream outputStream = new FileStream(dataDir + "UsingArrayOfFilesAndStreams_out.pdf", FileMode.Create); // Make NUp pdfEditor.MakeNUp(fileStreams, outputStream, true); // ExEnd:UsingArrayOfFilesAndStreams }
public static void Run() { // ExStart:MakeNUpUsingStreams // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create streams FileStream inputStream1 = new FileStream(dataDir + "input.pdf", FileMode.Open); FileStream inputStream2 = new FileStream(dataDir + "input2.pdf", FileMode.Open); FileStream outputStream = new FileStream(dataDir + "MakeNUpUsingStreams_out.pdf", FileMode.Create); // Make NUp pdfEditor.MakeNUp(inputStream1, inputStream2, outputStream); // ExEnd:MakeNUpUsingStreams }
public static void Run() { // ExStart:UsingArrayOfFilesAndStreams // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Pages(); // Create PdfFileEditor object PdfFileEditor pdfEditor = new PdfFileEditor(); // Create streams FileStream[] fileStreams = new FileStream[2]; fileStreams[0] = new FileStream(dataDir + "input.pdf", FileMode.Open); fileStreams[1] = new FileStream(dataDir + "input2.pdf", FileMode.Open); FileStream outputStream = new FileStream(dataDir + "UsingArrayOfFilesAndStreams_out_.pdf", FileMode.Create); // Make NUp pdfEditor.MakeNUp(fileStreams, outputStream, true); // ExEnd:UsingArrayOfFilesAndStreams }
public static void Run() { // ExStart:PdfFileEditorFeatures // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_TechnicalArticles(); // Create instance of PdfFileEditor class PdfFileEditor pdfEditor = new PdfFileEditor(); // Append pages from input file to the port file and save in output file int start = 1; int end = 3; pdfEditor.Append(dataDir + "inFile.pdf", dataDir + "portFile.pdf", start, end, dataDir + "outFile.pdf"); // Concatenate two files and save in the third one pdfEditor.Concatenate(dataDir + "inFile1.pdf", dataDir + "inFile2.pdf", dataDir + "outFile.pdf"); // Delete specified number of pages from the file int[] pages = new int[] { 1, 2, 4, 10 }; pdfEditor.Delete(dataDir + "inFile.pdf", pages, dataDir + "outFile.pdf"); // Extract any pages from the file start = 0; end = 3; pdfEditor.OwnerPassword = "******"; pdfEditor.Extract(dataDir + "inFile.pdf", start, end, dataDir + "outFile.pdf"); // Insert pages from another file into the output file at a specified position start = 2; end = 5; pdfEditor.Insert(dataDir + "inFile.pdf", 4, dataDir + "portFile.pdf", start, end, dataDir + "outFile.pdf"); // Make booklet pdfEditor.MakeBooklet(dataDir + "inFile.Pdf", dataDir + "outFile.Pdf"); // Make N-Ups pdfEditor.MakeNUp(dataDir + "inFile.pdf", dataDir + "nupOutFile.pdf", 3, 2); // Split the front part of the file pdfEditor.SplitFromFirst(dataDir + "inFile.pdf", 3, dataDir + "outFile.pdf"); // Split the rear part of the file pdfEditor.SplitToEnd(dataDir + "inFile.pdf", 3, dataDir + "outFile.pdf"); // Split to individual pages int fileNum = 1; MemoryStream[] outBuffer = pdfEditor.SplitToPages(dataDir + "inFile.pdf"); foreach (MemoryStream aStream in outBuffer) { FileStream outStream = new FileStream("oneByone" + fileNum.ToString() + ".pdf", FileMode.Create); aStream.WriteTo(outStream); outStream.Close(); fileNum++; } // Split to several multi-page pdf documents fileNum = 1; int[][] numberofpage = new int[][] { new int[] { 1, 4 } }; MemoryStream[] outBuffer2 = pdfEditor.SplitToBulks(dataDir + "inFile.pdf", numberofpage); foreach (MemoryStream aStream in outBuffer2) { FileStream outStream = new FileStream("oneByone" + fileNum.ToString() + ".pdf", FileMode.Create); aStream.WriteTo(outStream); outStream.Close(); fileNum++; } // ExEnd:PdfFileEditorFeatures }
public static void Run() { // ExStart:PdfFileEditorFeatures // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_TechnicalArticles(); // Create instance of PdfFileEditor class PdfFileEditor pdfEditor = new PdfFileEditor(); // Append pages from input file to the port file and save in output file int start = 1; int end = 3; pdfEditor.Append(dataDir + "inFile.pdf", dataDir + "portFile.pdf", start, end, dataDir + "outFile.pdf"); // Concatenate two files and save in the third one pdfEditor.Concatenate(dataDir + "inFile1.pdf", dataDir + "inFile2.pdf", dataDir + "outFile.pdf"); // Delete specified number of pages from the file int[] pages = new int[] { 1, 2, 4, 10 }; pdfEditor.Delete(dataDir + "inFile.pdf", pages, dataDir + "outFile.pdf"); // Extract any pages from the file start = 0; end = 3; pdfEditor.OwnerPassword = "******"; pdfEditor.Extract(dataDir + "inFile.pdf", start, end, dataDir + "outFile.pdf"); // Insert pages from another file into the output file at a specified position start = 2; end = 5; pdfEditor.Insert(dataDir + "inFile.pdf", 4, dataDir + "portFile.pdf", start, end, dataDir + "outFile.pdf"); // Make booklet pdfEditor.MakeBooklet(dataDir + "inFile.Pdf", dataDir + "outFile.Pdf"); // Make N-Ups pdfEditor.MakeNUp(dataDir + "inFile.pdf", dataDir + "nupOutFile.pdf", 3, 2); // Split the front part of the file pdfEditor.SplitFromFirst(dataDir + "inFile.pdf", 3, dataDir + "outFile.pdf"); // Split the rear part of the file pdfEditor.SplitToEnd(dataDir + "inFile.pdf", 3, dataDir + "outFile.pdf"); // Split to individual pages int fileNum = 1; MemoryStream[] outBuffer = pdfEditor.SplitToPages(dataDir + "inFile.pdf"); foreach (MemoryStream aStream in outBuffer) { FileStream outStream = new FileStream("oneByone" + fileNum.ToString() + ".pdf", FileMode.Create); aStream.WriteTo(outStream); outStream.Close(); fileNum++; } // Split to several multi-page pdf documents fileNum = 1; int[][] numberofpage = new int[][] { new int[] { 1, 4 }}; MemoryStream[] outBuffer2 = pdfEditor.SplitToBulks(dataDir + "inFile.pdf", numberofpage); foreach (MemoryStream aStream in outBuffer2) { FileStream outStream = new FileStream("oneByone" + fileNum.ToString() + ".pdf", FileMode.Create); aStream.WriteTo(outStream); outStream.Close(); fileNum++; } // ExEnd:PdfFileEditorFeatures }