Jump to content

Placing multiple 2-page PDFs by VI


urville

Recommended Posts

So, i am struggling with Java. Trying to learn it on the side. My knowledge is pretty basic, but in the meantime I'm asking for help.:p

 

I have found other threads about multi-page pdf placement via javascript. Thing is, no one ever explains what each bit of the java is doing, which isnt a critique, it just means I cant figure out how to rework it for my specific need which functionally is a bit different. :confused:

 

The threads are still helpful but they could be a bit more "teach a man to fish". :D

 

So, i have postcard mailings and in these mailings i create a blank PDF the full "with bleed" size of 8.75x5.75, place a front and back via variable and use an imposition template to add crops (which adds the crops behind the artwork FYI lol).

 

I am then combining many different excel sheets into one large mailing list. Each individual sheet has a three letter code corresponding to a sales person that i add as a column. Each sales agent has their own postcard. I then use that column to place the front and back artwork in addition to the addressing info and a variable line with the receivers name on the front ("Michael, dont miss out on the deals we have for you.") It's different sales people each time and turnover is high so I am constantly expanding and rewriting my rules.

 

So far I have to split each PDF once proofs are approved into a 1-front and 2-back pdfs set from InDesign that i then add as resources so that I can call them in two rules, one for the front and one for the back of the PC.

 

They are basic (Front: if REP field contains AAA, then display AAA1.pdf, if REP field contains AAB, display AAB1.pdf) and (Back: if REP field contains AAA, then display AAA2.pdf, if REP field contains AAB, display AAB2.pdf) etc.

 

This is a real pain, and often there are mistakes from InDesign as this is not the most elegant or efficient means of doing this (lots of unnecessary extra workflow prepress) and this client is always in a rush and I wish there was simply a place in the resources/rule functionality to simply denote page number in PDFs. Seems like a real developer/S.engineer oversight.

 

Nevertheless, I'm trying to make javascript that does this for each possible card and I think if I keep going at it without asking for help it'll be ages, in not never, before I ever figure it out, lol.

 

I think part of the curveball is the ever changing sales reps.

 

Help is greatly appreciated. I know people are giving their time and effort, so thank you!:)

Link to comment
Share on other sites

provided that there are 2 page PDFs create for each REP, create 2 rules to use for 2 page template:

 

1. front page

2. back page

 

front page rule:

Pic = CreateResource("//[b][color="Green"]YOUR VNC PATH[/color][/b]/"+[b][color="Purple"]YourRepField[/color][/b]+".pdf", "graphic", true);
Pic.pagenumber = [b][color="Red"]1[/color][/b];
return Pic;

 

back page rule:

Pic = CreateResource("//[b][color="Green"]YOUR VNC PATH[/color][/b]/"+[b][color="Purple"]YourRepField[/color][/b]+".pdf", "graphic", true);
Pic.pagenumber = [b][color="red"]2[/color][/b];
return Pic;

 

these are graphic rules, so you'll have to use graphic object and use the graphic rules accordingly. In most cases if you have bleeds and crop marks already, depending on the PDFs bleed settings and gutters needed to nUp the files, you may need to delete pre-cropped marks and use impositioning's crop features (especially if you are doing 0.25" crop marks).

 

When uploading to server to compose, make sure server has access rights to VNC location otherwise you'll have blank backgrounds. If composing locally does not take a long time, you shouldn't have to worry about it (but it will lock your acrobat until it's done composing).

 

Over time, building off of blank PDFs with re-usable coding and settings (colors, etc) will save you time. If you have a different page size you can always FP insert a different page size and resize background sizes copied to the new template page.

 

Good luck and happy findings.

Edited by tou
Link to comment
Share on other sites

So, i am struggling with Java. Trying to learn it on the side.

Java is different than JavaScript. You won't be able to write Java for FusionPro.

I have found other threads about multi-page pdf placement via javascript. Thing is, no one ever explains what each bit of the java is doing, which isnt a critique, it just means I cant figure out how to rework it for my specific need which functionally is a bit different. :confused:

I feel like this thread does a pretty excellent job of "teaching you to fish" for the exact fish you're trying to catch (inserting multi-page PDFs). It has an example with well-commented code. But if you ever come across code that's been posted here on the forum that doesn't quite make sense, reply on that thread and ask for further clarification.

 

They are basic (Front: if REP field contains AAA, then display AAA1.pdf, if REP field contains AAB, display AAB1.pdf) and (Back: if REP field contains AAA, then display AAA2.pdf, if REP field contains AAB, display AAB2.pdf) etc.

You don't need to create 'if' statements for each of those scenarios if your resources are named according to the value of the "REP" field. Instead you could just write this:

return Resource(Field("REP") + "1.pdf");

 

I wish there was simply a place in the resources/rule functionality to simply denote page number in PDFs. Seems like a real developer/S.engineer oversight.

There is. If you reference the "Building Blocks" window, you will find a list of properties for FusionProResources (Objects > Resources > FusionProResource) and you will notice that "pagenumber" is one such property. So you can add you PDF resource and then set the page number to return like this:

// Assigns AAA.pdf to the "pdf" variable
var pdf = Resource(Field("REP") + ".pdf");
pdf.pagenumber = 2; // sets the page number to 2
return pdf; // returns the second page of AAA.pdf

Link to comment
Share on other sites

provided that there are 2 page PDFs create for each REP, create 2 rules to use for 2 page template:

 

Indeed, each rep has a different item each time so the main card is built with their info and then items are inserted into that template. I have thought about making that process VI and even their info and clipped personages but it requires layered graphics and so i'm waiting till i have this down pat before i try to start inserting things in layers and fitting.

 

I didnt even realize you could create resources via a rule! This is great because then I can simply make one big if then else and add all the known reps and it will only feed this particular mailings reps and info.

 

 

In most cases if you have bleeds and crop marks already, depending on the PDFs bleed settings and gutters needed to nUp the files, you may need to delete pre-cropped marks and use impositioning's crop features (especially if you are doing 0.25" crop marks).

 

We use .125 bleed pretty much always. What happened is I build these 8.5x5.5 with .125 bleed. When i first did this just winging it how I figured it out myself I made a 8.5x5.5 with .125 bleed blank PDF and graphically call them in but didnt even know there was an impose at the time so it just kept cutting off my bleed. So to fix it I just made an8.75x5.75 blank PDF and then called in the PDFs. Later I learned about impose and use it to give crops which funny enough go behind the placed artwork making them useless, but I need to rework it back I think and maybe it will work.

 

Since I make the PDFs I can control how they go out, I dont put crops on in ID.

 

When uploading to server to compose, make sure server has access rights to VNC location otherwise you'll have blank backgrounds. If composing locally does not take a long time, you shouldn't have to worry about it (but it will lock your acrobat until it's done composing).

 

There is a server? I never set one up. I must be composing locally, I just accept the lost time and work on other InDesign jobs. I'll have to look into this.

 

Over time, building off of blank PDFs with re-usable coding and settings (colors, etc) will save you time. If you have a different page size you can always FP insert a different page size and resize background sizes copied to the new template page.

 

Indeed, once I had done it this way i began to see how this is how I am going to build templates I think for basic mailings of the repeatable sizes. I even graphically pull the indicias now. I know there is supposedly templates, but I havent gotten there yet either.

Link to comment
Share on other sites

Java is different than JavaScript. You won't be able to write Java for FusionPro.

 

Quite right, sorry. I am learning both. Don't post tired.

 

I feel like this thread does a pretty excellent job of "teaching you to fish" for the exact fish you're trying to catch (inserting multi-page PDFs). It has an example with well-commented code. But if you ever come across code that's been posted here on the forum that doesn't quite make sense, reply on that thread and ask for further clarification.

 

Thank you, i appreciate that. I didnt want to resurrect threads that were ages old and most forums hate back referencing old threads, I take it that is not the case here.

 

 

You don't need to create 'if' statements for each of those scenarios if your resources are named according to the value of the "REP" field. Instead you could just write this:

return Resource(Field("REP") + "1.pdf");

There is. If you reference the "Building Blocks" window, you will find a list of properties for FusionProResources (Objects > Resources > FusionProResource) and you will notice that "pagenumber" is one such property. So you can add you PDF resource and then set the page number to return like this:

// Assigns AAA.pdf to the "pdf" variable
var pdf = Resource(Field("REP") + ".pdf");
pdf.pagenumber = 2; // sets the page number to 2
return pdf; // returns the second page of AAA.pdf

 

Ok... I see. I'm going to need to digest all these threads and info and see if I can franken it all together into something. Hah! Thanks!:o

Link to comment
Share on other sites

FOLLOWUP QUESTION:

I dont understand why when i make the blank page 8.5x5.5 plus bleed in indesign, and then place a graphic frame on top of it measuring 8.75x5.75 and Variable call a page 8.5x5.5 with .125 bleed (8.75x5.75) it cuts off the image that .125 on all four edges? EDITED IN LATER: I played with it, and it seems to be entirely predicated on the blank PDF. This sucks, because I was hoping by NOT making the blank PDF 8.75x5.75 no bleed using FPImposer would let the crop marks appear on top of the artwork rather than below. I dont get that result it makes no sense, crops should always be on top like in ID.

 

I cant really go much more as the run sheet is 12x18 and obviously there is gripper.

 

What is the logic of FP there? I dont get it.

 

Additionally, if i understand wht is happening in the script here, it seemed like a logical choice to combine these two methods you both suggested into one combined code to simplify? It does work so far, and if I am correct it will allow me to dictate with less code by using the "agent" field which is more elegant.

 

FRONT
pdf = CreateResource(Field("agent") + ".pdf", "graphic", true);
pdf.pagenumber = 1;
return pdf;

BACK
pdf = CreateResource(Field("agent") + ".pdf", "graphic", true);
pdf.pagenumber = 2;
return pdf;

Edited by urville
Link to comment
Share on other sites

FOLLOWUP QUESTION:

I dont understand why when i make the blank page 8.5x5.5 plus bleed in indesign, and then place a graphic frame on top of it measuring 8.75x5.75 and Variable call a page 8.5x5.5 with .125 bleed (8.75x5.75) it cuts off the image that .125 on all four edges? EDITED IN LATER: I played with it, and it seems to be entirely predicated on the blank PDF. This sucks, because I was hoping by NOT making the blank PDF 8.75x5.75 no bleed using FPImposer would let the crop marks appear on top of the artwork rather than below. I dont get that result it makes no sense, crops should always be on top like in ID.

 

I cant really go much more as the run sheet is 12x18 and obviously there is gripper.

 

What is the logic of FP there? I dont get it.

 

Additionally, if i understand wht is happening in the script here, it seemed like a logical choice to combine these two methods you both suggested into one combined code to simplify? It does work so far, and if I am correct it will allow me to dictate with less code by using the "agent" field which is more elegant.

 

FRONT
pdf = CreateResource(Field("agent") + ".pdf", "graphic", true);
pdf.pagenumber = 1;
return pdf;

BACK
pdf = CreateResource(Field("agent") + ".pdf", "graphic", true);
pdf.pagenumber = 2;
return pdf;

 

You can play with bleeds/crop marks in Impositioning tab during composing or use impositioning file checkbox pointing to FPImposer file.

 

The code you're referencing has to be in two separate rules for two graphic objects later. I'm not sure by your meaning of elegant, but it saves coding if data contains the variable portion of things. CreateResource() allows you to not have to insert resources to the template itself and call from repository/network location.

 

If need be can you upload what you have so far along with results?

 

Good luck!

Edited by tou
Link to comment
Share on other sites

You can play with bleeds/crop marks in Impositioning tab during composing or use impositioning file checkbox pointing to FPImposer file.

 

This is exactly how I am doing it. Marcom told me in a support email that the imposition tab will not affect how it prints vs how it previews, except to add crop marks. Nevertheless, it still erases the ID designated bleed in the placed files if I dont put out the blank master PDF on which I am placing the artwork as full size (no implied bleed set in ID). AND Additionally... either way, it still puts the crops behind the artwork using FPimposer. They asked me to send them a sample job which I have done and i am awaiting word back on that particular bug. I dont get this implementation of bleed and crops in general though, it makes no sense.

 

The code you're referencing has to be in two separate rules for two graphic objects later. I'm not sure by your meaning of elegant, but it saves coding if data contains the variable portion of things. CreateResource() allows you to not have to insert resources to the template itself and call from repository/network location.

 

Oh. :confused:

Only that its less and more simplified code doing the same job as much more complex code, which is what I had been using and previously found on the forums through searching. I thank you guys both for it! :)

Exactly! I dont have to build a huge volume of statements nor a huge library of resources in it.

 

If need be can you upload what you have so far along with results?

 

I just had to go back to a main PDF that is the full size with no bleed set in ID and place on top of that (vs giving the main pdf bleed in ID). Otherwise if i build actual size and imply bleed in ID for the main PDF on to which i am placing, it cuts off the bleed to the exact size of the bleed on each edge on the placed item with blank white. Which, I cant help but say again, makes no sense to me functionally.

Edited by urville
Link to comment
Share on other sites

This is exactly how I am doing it. Marcom told me in a support email that the imposition tab will not affect how it prints vs how it previews, except to add crop marks. Nevertheless, it still erases the ID designated bleed in the placed files if I dont put out the blank master PDF on which I am placing the artwork as full size (no implied bleed set in ID). AND Additionally... either way, it still puts the crops behind the artwork using FPimposer. They asked me to send them a sample job which I have done and i am awaiting word back on that particular bug. I dont get this implementation of bleed and crops in general though, it makes no sense.

I would not set bleeds and crop marks in FPImposer then if you want your ID crop marks. In FPImposer set your page size to your full size and gutters/bleeds to 0. Basically stepping the full size PDF. No FP crop marks.

 

If you don't set the clipping of the image correctly artwork that goes beyond the finished size will overlap when nUp'ng....which maybe the reason for covering the crop marks...

Edited by tou
Link to comment
Share on other sites

FOLLOWUP QUESTION:

I dont understand why when i make the blank page 8.5x5.5 plus bleed in indesign, and then place a graphic frame on top of it measuring 8.75x5.75 and Variable call a page 8.5x5.5 with .125 bleed (8.75x5.75) it cuts off the image that .125 on all four edges? EDITED IN LATER: I played with it, and it seems to be entirely predicated on the blank PDF. This sucks, because I was hoping by NOT making the blank PDF 8.75x5.75 no bleed using FPImposer would let the crop marks appear on top of the artwork rather than below. I dont get that result it makes no sense, crops should always be on top like in ID.

 

The placed variable PDF is being clipped at its Trim Box. Suggest setting the Media Box, Crop Box, Trim Box, Bleed Box and Art Box of the placed PDF to the document size plus bleed using Acrobat or PitStop. For example, in an 8.5" x 11" document with .125" bleed, all Page Boxes in a placed variable PDF should be set to 8.75" x 11.25".

 

The FusionPro Template should have all page boxes set correctly. Trim Box = 8.5" x 11". Media Box and Bleed Box 8.75" x 11.25". Then use the appropriate Bleed Setting in your Composition Settings > Imposition and/or FPI file.

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