We have a business requirement to dynamically add our client's company logo image to the top left hand side of each page of a PDF report.
We understand that the Tracker engineers are not fluent in the PowerBuilder 2019 development tool by Appeon, but we're hoping you will be able to help us translate your C# example of AddImageToFirstPage (https://sdkhelp.pdf-xchange.com/vi ... t_addImage) to PowerBuilder PowerScript code.
Here is the C# example:
Code: Select all
private void AddImageToFirstPage(PDFXEdit.IPXV_Document Doc, PDFXEdit.PXV_Inst Inst)
{
if (Doc == null)
return;
int nID = Inst.Str2ID("op.document.addImage", false);
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
input.v = Doc;
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
options["Page"].v = 0; //First page
options["Pos.top"].v = 400;
options["Pos.left"].v = 50;
options["Pos.right"].v = 400;
options["Pos.bottom"].v = 50;
options["AlignMode"].v = 1 | 4; //Horizontal and vertical center
options["AsStamp"].v = false; //Inserting as a part of the content
PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS");
PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestImage.png"); //Converting string to name
options["Src"].v = destPath;
Op.Do();
}
Code: Select all
ole_pdf.Object.SetLicKey(ls_key)
lole_Inst = ole_pdf.Object.Inst
lole_Icab = lole_Inst.CreateOpenDocParams()
ole_pdf.Object.OpenDocFromPath( ls_filename, lole_Icab)
ll_nID = lole_Inst.Str2ID("op.document.addImage", false)
lole_operation = lole_Inst.CreateOp(ll_nID);
lole_icab = lole_operation.Params
lole_ICabNode_Input = lole_icab.Root("Input")
lole_Doc = ole_pdf.Object.Doc
lole_ICabNode_Input.v = lole_Doc
lole_ICabNode_Options = lole_icab.Root("Options")
…
…
lole_fsinst = lole_inst.GetExtension("AFS")
…
…
Code: Select all
options["Page"].v = 0; //First page
Alternatively, if there is another way to add an image file from disk to the top left hand corner of each page of the PDF document, please let us know as that might be easier to translate into PowerBuilder code.
Thanks in advance for your help with this and all the previous changes you've made to your product so that we can use it in our PowerBuilder applications.
Warm Regards,
Greg