Skip to main content

Utility: Replace PDF

Description

This utility is used to replace pages from input pdf file based on page number

Example:
Please find the below sample code to access Replace PDF utility method using User defined java class.

import com.automationedge.ps.docedge.utils.*;
//Create utility class object
PDFUtils rpdf = new PDFUtils();

String inputFile = "E:\\Files\\Issues\\replacePDF\\data\\1060 pre estimate_original.pdf";
String outputFile = "E:\\Files\\Issues\\replacePDF\\data\\1060 pre estimate_original_merge.pdf";
String[][] mergeFiles = { { "E:\\Files\\Issues\\replacePDF\\data\\Aadhar1.pdf", "1" },
{ "E:\\Files\\Issues\\replacePDF\\data\\Aadhar2.pdf", "2" }
};

try {
//Call replace PDF method
String outputfilePath=rpdf.replacePDF(inputFile, mergeFiles, outputFile);
} catch (Exception e) {
throw e;
}

Method Input / Output Parameters

No.Field NameData typeSupported FormatDescription
1inputfilesStringpdfInput file path
2mergeFilesArrayPdf (Single page), jpeg, jpg, pngMerge file path with page number
3outputfileStringpdfOutput file path