Jump to content

Multi-Line Records, inserting PDFs


mdlivels

Recommended Posts

Hi-

Trying to use a mutli-line record data file and insert variable page count PDFs into my Fusion template, but I cannot get it right. I have no issue calling in one PDF (the filename is literally in the data) but I cannot get it to advance and continue adding PDF files until the next record. Can't show the data, but it's pretty simple with a mutli-line record that advances when a certain field changes. The corresponding records all contain different PDF filenames, but again I'm only able to pull in the first one and then it moves to the next record. Is this even possible?

 

var pathName = "\\gcomsecure\Resources\MDL\\";

var data = FusionPro.GetMultiLineRecords();
for (var rec = 1; rec <= data.recordCount; rec++)

 var FullResourcePath = pathName + Field("Filename");  //change to match your data file field
 var x = new FusionProResource(FullResourcePath, "graphic", 1);
 if (!x.exists)
   {
 ReportError("Graphic not found: " + Field("Filename"));

 }
 var pdfString = '';
 for (var pgnbr = 1; pgnbr <= x.countPages; pgnbr++)
 {           
   x.pagenumber = pgnbr;
   pdfString += x.value + '<p>\n';
 }
 Print("Result is: " + pdfString);
 return pdfString;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...