Jump to content

Insert graphic on overflow page if last page


rjohns

Recommended Posts

I'm working on a project and I need some help. Basically, I want to insert a logo and text on the last page of a document. Here's more specific info:

 

File Setup:

Page 1 - body; cover

Page 2 - body; first inside page

Page 3 - overflow

 

I'm inserting a 3 page PDF starting on page 2, so I'll end up with a 4 page document after composition. With this setup, pages 3 and 4 of the final composed document are generated from page 3 of the Acrobat file.

 

I need to place a graphic and some text on page 4 of the composed document (the last page). I've approached it thinking: "If the current page is page 4, insert this text."

 

After reading through a lot of threads, I couldn't find anything that really addressed what I'm trying to achieve. I tried adapting some of it, but didn't have much luck. I've tried using the following to insert the text:

if (FusionPro.Composition.currentPageNumber == 4)
   return "1.1416.000000";
   else return "";

 

But that didn't work. The text showed up on both overflow pages (pages 3 and 4). I also tried a variation like this:

if (FusionPro.Composition.currentPageNumber == FusionPro.Composition.totalPages)
   return "1.1416.000000";
   else return "";

 

And I got the same result.

 

I must be missing something ... But what? Any help is greatly appreciated – thanks!

Link to comment
Share on other sites

If you know that the PDF you're inserting is always going to have a set number of pages, then you don't need to use an Overflow page. Instead, you can simply use a series of Body pages with Graphic frames for the inserted PDF. Then you can just put down whatever you want on the last Body page.
Link to comment
Share on other sites

Becka, I think checking the "Re-evaluate this rule for every text flow" in your rule editor should give you the results you're looking for.

 

That being said, I think Dan is right (per usual) in saying that if you know the page count is always going to be 4, you might as well have 4 body pages. You've already got a 3 page document – what's one more?

 

But if you set it up as an overflow page in anticipation of using the same template for importing PDFs that may include more than 3 pages, you could leave what you have and add another body page to the end making your template look like:

Page 1 - body; cover

Page 2 - body; first inside page

Page 3 - overflow

Page 4 - body; last page of the PDF you overflowed.

Then your overflow rule would be something like:

var pdf = CreateResource('/path/to/Your.pdf','graphic');
var result = [];
for (var i=1; i<pdf.countPages; i++){
   pdf.pagenumber = i;
   result.push(pdf.content);
}
return result.join('<p>');

And on your 4th page, you'd have a graphic frame to return the last page of the PDF and whatever else you want on the page. Like this:

var pdf = CreateResource('/path/to/Your.pdf','graphic');
pdf.pagenumber = pdf.countPages;
return pdf;

Edited by step
misspelled Becka
Link to comment
Share on other sites

  • 2 weeks later...

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...