Jump to content

Postcards. _front and _back inserting


rpaterick

Recommended Posts

Let's say my .pdf file is called "master" when it comes in.

I'm going to have a "column header" in my excel file called "graphic" that would/could call out multiple .pdf files.

 

The .pdf file comes-in and has to be worked on to print correctly(layout and sizing issues). I have a batching process setup in Acrobat to correct the .pdf every time it comes-in(different .pdf names).

The naming convention though I found I have to call page 1 master_front.pdf and page 2 master_back.pdf.

 

So, the work-flow is that I would get all kinds of different postcards with different names but all would have the same extension, .pdf.

The data file would just have the name of the .pdf, there would be no _front and _back.

I would have just one folder that FP would look at to find the _fronts and _backs to pull from.

 

I saw the other threads on how to pull from graphics, thats pretty straight forward but my issue is placing _front and _back .pdf extensions based on the original .pdf name and coming from the data file.

 

Thanks!:o

Link to comment
Share on other sites

What exactly does the field from the input file contain? Is it just the name of the graphic file, to which you need to add "_front" or "_back" before the ".pdf" extension? If so, then you should be able to do something like this:

var filename = Field("Graphic");
return filename .replace(/(\.[^.]*)$/, "-front$1");
// OR
return filename .replace(/(\.[^.]*)$/, "-back$1");

Link to comment
Share on other sites

What exactly does the field from the input file contain? Is it just the name of the graphic file, to which you need to add "_front" or "_back" before the ".pdf" extension?

 

Just the name of the .pdf.

 

Attached is a sample file of what the data could look like.

 

Here is what would then be in a folder that FP would look at based upon the attached data.

ready23_front.pdf

ready23_back.pdf

itstime_front.pdf

itstime_back.pdf

 

My FP document is setup to have the address-side as page 2(visual). Basically the FP document has a graphic box for page 1 and on page 2 would be the address block on top and a graphic placeholder for the _back.pdf file.

 

Thanks Dan for your help!

Ryan

test.txt

Link to comment
Share on other sites

Just the name of the .pdf.

Okay, so then there's the next part of my previous post:

If so, then you should be able to do something like this:

var filename = Field("Graphic");
return filename.replace(/(\.[^.]*)$/, "-front$1");
// OR
return filename.replace(/(\.[^.]*)$/, "-back$1");

So, make one Graphic rule that does this:

return CreateResource(Field("Graphic").replace(/(\.[^.]*)$/, "-front$1"));

And another that does this:

return CreateResource(Field("Graphic").replace(/(\.[^.]*)$/, "-back$1"));

Or you could just do something like this without having to rename the graphics in the first place.

 

OR, you could just do something like this in OnRecordStart:

var r = CreateResource(Field("Graphic"), "graphic");
FusionPro.Composition.AddGraphicVariable("Front", r);
r.pagenumber = 2;
FusionPro.Composition.AddGraphicVariable("Back", r);

Just replace "Front" and "Back" above with the graphic variable you're using in each Graphic frame.

Link to comment
Share on other sites

Okay, so then there's the next part of my previous post:

 

Dan, I thought I understood how to point to a folder to where the images reside but I can't figure it out.

I understand on how to make a resource and link to it, multiples as well.

 

Is there a way to just have these _front and _back pdfs reside in one folder all the time and FP just searches the folder?

 

When you point to this folder, does it do a preview in FP or do you have to compose to say a .pdf to preview?

 

Thanks!

Ryan

Link to comment
Share on other sites

Ryan,

 

You can point to a specific folder (or folders) via the "Search Path" on the Composition>Advanced menu tab. You can put the full path in here "C:\projectFiles\MasterPostcards\usedForPrint". Or if you want to use a relative path from your template contained in a specific folder and includes the sub-folder for all your graphics, then use "./usedForPrint". This way you don't have to put any path information in your rule which limits you to only using that specific path every time.

 

However, if you really want to get a bit fancy, you could always add the path name as a separate variable in the data file and include the path field in your CreateResource function in the graphic rule...

 

return new FusionProResource(Field("imgPath") + Field("Graphic"), "graphic", true);

 

 

Good luck,

Link to comment
Share on other sites

Ryan,

 

You can point to a specific folder (or folders) via the "Search Path" on the Composition>Advanced menu tab. You can put the full path in here "C:\projectFiles\MasterPostcards\usedForPrint". Or if you want to use a relative path from your template contained in a specific folder and includes the sub-folder for all your graphics, then use "./usedForPrint". This way you don't have to put any path information in your rule which limits you to only using that specific path every time.

 

Thanks DSweet!

 

I don't know why I couldn't figure it out. The path in advanced worked.:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...