@Hadrian,
The only way I could get this to work for my situation was to use a graphic box method instead of the text overflow method. Because my situation had to handle files with bleed and files without bleed, this was my only option as I could not get the overflow method to center properly for all scenarios. I put the following rule in a text rule. I create a graphic box on page 1 called "Front" and another on page 2 called "Back" and I do not assign any rule or variable field to the graphic box, the rule will do that.
Here is my code:
FieldName = '';
PDFfileName = '';
pagesInPDF = 0;
markupToReturn = '';
pathToAllPDFs = 'Macintosh HD:Users:macuser01:Desktop:resources:'; /* change "pathToAllPDFs" value to the path where your local test files are located /*
pathToPDF = '';
PDFresourceRef = '';
var FrontFrame = FindGraphicFrame("Front");
var BackFrame = FindGraphicFrame("Back");
//This is the main loop that parses through all of the fields for a given record.
PDFfileName = Field("File");
pathToPDF = Field("File"); /* this one should be uncommented for marcom central */
/*pathToPDF = pathToAllPDFs; //uncomment this and comment out the one above to preview on a local machine */
//Create a new resource that references this
PDFresourceRef = CreateResource(pathToPDF ,'graphic' ,'no');
//Find out how many pages it has
pagesInPDF = PDFresourceRef.countPages;
//This is the secondary loop for this script.
//It will loop through and create markup for each page in the PDF.
if (Field("Sides")=="1"){
for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++)
{
FrontFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "1" scale="off" />');
return pathToPDF;
}
}else if (Field("Sides")=="2"){
for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++)
{
FrontFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "1" scale="off" />');
BackFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "2" scale="off" />');
return pathToPDF;
}
}
}
return pathToPDF;
return markupToReturn;�Hope this helps you!