Jump to content

Business Cards - two orientations, front/back - customer supplied file?


Recommended Posts

Hi everyone :)

 

I'm a new user, of course and I'm trying to work with FusionPro for the first time. I'm trying to set up a standard business card type job where the client can select their orientation (horizontal or vertical) and choose whether it's single or double sided. Once they've made those selections, I want them to be able to upload their pre-designed art (PDF) into the template and have FusionPro impose it.

 

I have the javascript rules which turn the appropriate pages on and off based on user selection so that seems to be working like I thought it should. However I have two problems that I'm not sure how to correct.

 

The first is that if the user selects double sided and uploads a multi-page pdf, the first page appears properly in the graphic frame but the second one doesn't. How do I tell it that page 1 in the pdf is GraphicFrame1 and page 2 is GraphicPage2?

 

The second is that if the client chooses vertical orientation, it doesn't impose properly since the FPI attached to the product is a horizontal layout. Is there either a way to tell the template to rotate the vertical pages before imposition, or alternatively to tell it to get a different FPI file?

 

Any help appreciated!

Link to comment
Share on other sites

The first is that if the user selects double sided and uploads a multi-page pdf, the first page appears properly in the graphic frame but the second one doesn't. How do I tell it that page 1 in the pdf is GraphicFrame1 and page 2 is GraphicPage2?

You can specify the pagenumber property of the FusionProResource object, like so:

var r = CreateResource("your PDF file name here");
r.pagenumber = 2;
return r;

The second is that if the client chooses vertical orientation, it doesn't impose properly since the FPI attached to the product is a horizontal layout. Is there either a way to tell the template to rotate the vertical pages before imposition, or alternatively to tell it to get a different FPI file?

I would just use a single template and FPI file, in one orientation, and let the graphic rotate as needed. This thread has an example of how to do that:

http://forums.printable.com/showthread.php?p=2587#post2587

Link to comment
Share on other sites

Hi Dan;

 

Thanks for the quick reply! I've downloaded the example you gave for the rotation and I'll be looking at that in a moment.

 

In regards to the PageCount rule -- how do I insert "your pdf name here" when I have no idea what name the client is going to upload? this is not a resource that i already have pre-defined, this is something they're going to give me that I will be having FusionPro import into a blank frame and then impose. Is there a call to say "find the file name they just gave me based on the field value"?

 

As a guess, since I am not familiar with JavaScript syntax:

 

var r = CreateResource(Field("FileUpload"));
r.pagenumber = 2;
return r;

 

Can you explain the logic of what this piece of code is doing? Create variable "r" which is the document I've defined. If the number of pages in "r" is 2, then return the value 2, otherwise return no value at all?

Link to comment
Share on other sites

In regards to the PageCount rule -- how do I insert "your pdf name here" when I have no idea what name the client is going to upload? this is not a resource that i already have pre-defined, this is something they're going to give me that I will be having FusionPro import into a blank frame and then impose. Is there a call to say "find the file name they just gave me based on the field value"?

 

As a guess, since I am not familiar with JavaScript syntax:

 

var r = CreateResource(Field("FileUpload"));
r.pagenumber = 2;
return r;

Yes, that's it exactly. You're accessing the uploaded file, by its name in the input data field.

Can you explain the logic of what this piece of code is doing? Create variable "r" which is the document I've defined. If the number of pages in "r" is 2, then return the value 2, otherwise return no value at all?

No, "return r" returns a Resource object, which has its pagenumber property set to 2, and its name property set to whatever value was in the data field (as set in the CreateResource function). The code always returns the resource; however, if the resource is not found, an error (exception) will be raised, and reported in the log (.msg) file at composition time.

Link to comment
Share on other sites

Hi Dan;

 

I have now got some happily rotating graphic images which makes me also happy. All is right in that part of my world.

 

Still stuck on the getting the document to output two pages properly though. If I'm understanding this right, I call the resource, assign it to variable r, set the page count to 2 and return the name of resource -- only now it knows it has two pages. I'm assuming in my scenario that I would use an IF statement -- If client choses "two sided" then reassign the page count of that file.

 

Am I then to use variable "r" somewhere to 1) turn a second page on if needed and/or 2) populate the second image magically into that page?

 

if (pagenumber==2 && Field("Orientatation"=="Vertical")
FusionPro.Composition.SetBodyPageUsage("VerticalLayoutReverse", true);
InsertPage2OfResource("VerticalPageReverse");

 

I think I'm missing the next step?

Link to comment
Share on other sites

Am I then to use variable "r" somewhere to 1) turn a second page on if needed and/or 2) populate the second image magically into that page?

 

if (pagenumber==2 && Field("Orientatation"=="Vertical")
FusionPro.Composition.SetBodyPageUsage("VerticalLayoutReverse", true);
InsertPage2OfResource("VerticalPageReverse");

I think I'm missing the next step?

I think you want to do something like this in OnRecordStart:

if (CreateResource(Field("FileUpload")).countPages == 2 && Field("Orientatation)" == "Vertical")
   FusionPro.Composition.SetBodyPageUsage("VerticalLayoutReverse", true);

And the previous logic which returns the resource, set to page 2, has to go into a separate Graphic rule which is assigned to the graphic frame on that body page.

 

But it's hard to know exactly because I don't have the rest of the job. If you want to post the job so far, then I, or someone else, may be able to offer more specific suggestions.

Link to comment
Share on other sites

Hi Dan;

 

My sincere apologies for taking up your time with this - but I admit I am confused and am no longer in the least sure what is supposed to go where. I can get the orientation switch to work with your code, and I can get pages to turn on and off using SetBodyPageUsage rules and in preview I can get two images to appear on two different pages like they ought to. However uploading it all into Marcom, my rules break down and I don't get a preview/proof properly which means I'm definitely mixing things up.

 

Any help appreciated. Once I understand this, similar objects should just fall into line - or at least, that's the theory.

bcard_blanklayout.zip

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...