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 Name | Data type | Supported Format | Description |
|---|---|---|---|---|
| 1 | inputfiles | String | Input file path | |
| 2 | mergeFiles | Array | Pdf (Single page), jpeg, jpg, png | Merge file path with page number |
| 3 | outputfile | String | Output file path |