Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 21st, 2016, 01:56 PM
JPalchak JPalchak is offline
Junior Community Member
 
Join Date: Jan 2016
Posts: 10
Exclamation Multiple Page Usage OnRecordStart

Hello, I'm having some issues with a tricky file I need to compose.

I have 2 documents and 1 set of data to use for both. Normally to pull up a page you could use a Field that has been defined in the data for that purpose, however there isn't one exactly for this case.

Which 6-page document I use is determined by the value of the ASK field.


Now I've set up an OnRecordStart rule that checks if there is a value in that field or not Like so:



And the body pages like so:



It seems pretty straightforward, if there is no value or a null value then the 6 body pages that will be composed for a record will be NO ASK-P1 through P6. However all I get are errors.



What am I missing?
Reply With Quote
  #2  
Old April 21st, 2016, 04:31 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,293
Default Re: Multiple Page Usage OnRecordStart

Quote:
Originally Posted by JPalchak View Post
It seems pretty straightforward, if there is no value or a null value then the 6 body pages that will be composed for a record will be NO ASK-P1 through P6. However all I get are errors.
Are the errors really all you get? What does the output file look like?

Those errors are about missing graphics, and have nothing at all to do with page usage. I'm not sure why you think those two things are connected.

I would guess that it's simply a matter of your graphic file names being malformed. It looks like they're using the old-style HFS paths from Mac OS 9, with colons as directory separators. In modern versions of Mac OS X, you should use POSIX paths with forward slashes as directory separators instead. Specifically, instead of paths like "./2016 general proposal ask:no ask.pdf", they should be in the form of "./2016 general proposal ask/no ask.pdf". I don't know where in your job that path with the colon is coming from, though.

(Also, I do appreciate the screen shots, and I do often say here on the forum that a picture is worth a thousand words. But in the case of the contents of a log file, or a rule, it's better to simply copy-and-paste the text instead of posting a picture of it. Or just attach a text file. That makes it easier for others to help because we can copy-and-paste the text contents on our end instead of having to try to re-type what's shown in a screen shot.)

As for your rule itself, I think it's fine, although it's very repetitive, and can be reduced quite a bit. For one thing, you're already starting out with all the pages set to be unused, so you don't need any of the lines calling FusionPro.Composition.SetBodyPageUsage with the second parameter set to false. Also, you could do a simple iteration instead of 1 line for page 1, another line for page 2, another line for page 3, etc. For example, this should work just as well:
Code:
for (var i = 1; i <= 6; i++)
{
    if (Field("ASK"))
        FusionPro.Composition.SetBodyPageUsage("ASK-P" + i, true);
    else
        FusionPro.Composition.SetBodyPageUsage("NO ASK-P" + i, true);
}
Or, even more succinctly:
Code:
for (var i = 1; i <= 6; i++)
{
    var pageName = "ASK-P" + i;
    if (!Field("ASK"))
        pageName = "NO " + pageName;
        
    FusionPro.Composition.SetBodyPageUsage(pageName, true);
}
Or, even less:
Code:
for (var i = 1; i <= 6; i++)
    FusionPro.Composition.SetBodyPageUsage((Field("ASK") ? "" : "NO ") + "ASK-P" + i, true);
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old April 22nd, 2016, 08:00 AM
JPalchak JPalchak is offline
Junior Community Member
 
Join Date: Jan 2016
Posts: 10
Default Re: Multiple Page Usage OnRecordStart

None of my pages are resources or using graphic frames, do I need to make them into graphic frames? I don't see why I need to since I've had pages placed in a document before and called them out using the setbodypage.

The output file is blank pages with the fusion pro output from the data on them.

Reply With Quote
  #4  
Old April 22nd, 2016, 08:41 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Multiple Page Usage OnRecordStart

Quote:
Originally Posted by JPalchak View Post
None of my pages are resources or using graphic frames, do I need to make them into graphic frames? I don't see why I need to since I've had pages placed in a document before and called them out using the setbodypage.

The output file is blank pages with the fusion pro output from the data on them.
Probably not the case, but it might be worth making sure that you don't have "Suppress static PDF background in composition" checked in your composition settings (under "graphics").

What version of FusionPro are you using? I think I recall a quirk in previous versions of FusionPro that had difficulty dealing with template file names with capital letters in them. Is your file all lower cased – as it's listed in the message log? Is that colon (:) part of the file name? It might be worth trying to rename your template something simple like "test.pdf" and trying to recompose.

I also wanted to mention that you can toggle body pages by page number in FP8 and FP9 – I'm not sure about 7...
Code:
for (var i=1; i<=6; i++) 
  FusionPro.Composiiton.SetBodyPageUsage(i + !Field('ASK') * 6, true)
  console.log(i + !Field('Ask') * 6)
Or similar:
Code:
var pg = 7;
while (--pg)
  FusionPro.Composiiton.SetBodyPageUsage(pg + !Field('ASK') * 6, true);
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #5  
Old April 22nd, 2016, 09:20 AM
JPalchak JPalchak is offline
Junior Community Member
 
Join Date: Jan 2016
Posts: 10
Default Re: Multiple Page Usage OnRecordStart

Suppress static is unchecked and I'm on v9.0.3. I regularly have capitalized page names but I tried making them all lower-case but the same results occur.

It's like it wants a resource called no ask.pdf and ask.pdf to use for the body pages but why? If I already have a static background to use and all I'm doing is telling it which 6 pages to use per record.
Reply With Quote
  #6  
Old April 22nd, 2016, 09:24 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Multiple Page Usage OnRecordStart

Maybe it's a permissions issue with that particular PDF or something. It's really difficult to say based on a couple of screenshots. Can you collect and upload your template/data?
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #7  
Old April 25th, 2016, 09:13 AM
JPalchak JPalchak is offline
Junior Community Member
 
Join Date: Jan 2016
Posts: 10
Default Re: Multiple Page Usage OnRecordStart

Quote:
Originally Posted by step View Post
Maybe it's a permissions issue with that particular PDF or something. It's really difficult to say based on a couple of screenshots. Can you collect and upload your template/data?
Yep, here's a link to the .zip

https://dl.dropboxusercontent.com/u/...3ANO%20ASK.zip
Reply With Quote
  #8  
Old April 25th, 2016, 01:27 PM
ScottHillock ScottHillock is offline
Regular Contributor
 
Join Date: Mar 2010
Posts: 89
Default Re: Multiple Page Usage OnRecordStart

Remove the slash / from the filename so it is "2016 General Proposal ASKNO ASK.pdf".

The slash is being treated like a directory separator, and is being replaced with the Mac seperator ":", on composition.

Usually I try and keep file names as simple and short as possible, and all lower case.
Reply With Quote
  #9  
Old April 25th, 2016, 01:34 PM
JPalchak JPalchak is offline
Junior Community Member
 
Join Date: Jan 2016
Posts: 10
Default Re: Multiple Page Usage OnRecordStart

Quote:
Originally Posted by ScottHillock View Post
Remove the slash / from the filename so it is "2016 General Proposal ASKNO ASK.pdf".

The slash is being treated like a directory separator, and is being replaced with the Mac seperator ":", on composition.

Usually I try and keep file names as simple and short as possible, and all lower case.
Worked like a charm, got the file with that and I didn't change it to my usual _ naming convention. Thanks!
Reply With Quote
  #10  
Old April 25th, 2016, 02:35 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,293
Default Re: Multiple Page Usage OnRecordStart

Quote:
Originally Posted by ScottHillock View Post
Remove the slash / from the filename so it is "2016 General Proposal ASKNO ASK.pdf".

The slash is being treated like a directory separator, and is being replaced with the Mac seperator ":", on composition.

Usually I try and keep file names as simple and short as possible, and all lower case.
Yeah, on Windows, the template file name shows up as "2016 General Proposal ASK:NO ASK.pdf", with a colon, which is not legal in a Windows file name at all, and Windows can't even extract it (though WinRAR and 7-Zip handle it by simply removing the colon).

At any rate, my initial suspicion was correct: The problem had absolutely nothing at all to do with page usage or anything else in your rules.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Reply

Tags
composition, onrecordstart, pages

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.