ftos.files.pdf.insertImage
Starting with v24.3.0, this is renamed from insertImageOnFile to ftos.files.pdf.insertImage.
Inserts an image in a PDF and saves the resulting file to the file upload location using a specified file name.
This is a business logic method for business service components.
Syntax
function ftos.files.pdf.insertImage(sourceRealName: string, imageRealName: string, outputFileName: string, imageWidth: number, imageHeight: nuber, pageNumber: number, adjustXposition : number, adjustYposition :number): string
Parameter | Description |
---|---|
sourceRealName
|
Unique internal ID of the source PDF file (real name). |
imageRealName
|
Unique internal ID of the image you wish to insert in the PDF (real name). |
outputFileNmae
|
File name assigned to the resulting PDF. |
imageWidth
|
Number of pixels to which the inserted image will be resized horizontally. |
imageHeight
|
Number of pixels to which the inserted image will be resized vertically. |
pageNumber
|
Page in the PDF where you wish to insert the image. |
adjustXposition
|
Number of pixels to the right of the page's left margin where the image is inserted. |
adjustYposition
|
Number of pixels above the page's bottom margin where the image is inserted. |
To determine the pixel sizes of a PDF page, multiply the page sizes by its pixel resolution. For instance, a Letter page (8.5 x 11 inches) rendered at a resolution of 72 ppi (pixels per inch) will have a width of 612 pixels (8.5 inches x 72 ppi) and a height of 792 pixels (11 inches x 72 ppi).
Some of the most popular page pixel sizes are listed below.
Resolution | ||||
---|---|---|---|---|
Page Size | 72 PPI | 96 PPI | 150 PPI | 300 PPI |
A4 | 595 x 842 | 794 x 1123 | 1240 x 1754 | 2480 x 3508 |
A5 | 420 x 595 | 559 x 794 | 874 x 1240 | 1748 x 2480 |
Letter | 612 x 792 | 816 x 1056 | 1275 x 1650 | 2550 x 3300 |
Legal | 612 x 1008 | 816 x 1344 | 1275 x 2100 | 2550 x 4200 |
Return Value
Returns a string containing the saved PDF's real name.