Hello,
I have a Workflow configuration where I want to create a new PDF via Alambic script to merge an area of another PDF on it.
var newPDF = Watch.GetPDFEditObject();
var jobPDF = Watch.GetPDFEditObject();
var newRect = new ActiveXObject("AlambicEdit.PdfRect")
var jobRect = new ActiveXObject("AlambicEdit.PdfRect")
jobPDF.Open(Watch.GetJobFileName(),false);
// Current job page size
jobRect = jobPDF.Pages(0).Size();
newPDF.Create("C:\\PLANETPRESS\\newFile.pdf");
newRect.left = 0;
newRect.top = 50; // need: 7 points = 2.5 mm
newRect.right = 100; // need: 48 points = 17 mm
newRect.bottom = 0;
newPDF.Pages().Insert(0,newRect);
newPDF.Pages(0).Merge2(jobPDF.Pages(0),-93,-459,0,1.0);
newPDF.Save(false);
I get the following error in debug mode:
[0002] W3602 : Error 0 on line 17, column 1: AlambicEdit.AlambicEditPDF.1: Media size is invalid.
Line 17: newRect.top = 50;
I have tested different values. 72 points ( newRect.top = 72; ) seems to be the minimum size.
Do I have any chance to do what I need (crop a pdf to 17x2.5mm)?
Thanks
Thomas