Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old June 26th, 2012, 12:19 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,341
Default Re: Inserting Multi-page PDF variable graphics

Quote:
Originally Posted by IndexxPrep View Post
Using this rule to place 8.5 x 11 PDF files that may or may not have .125" bleed. I am getting mixed results as far as the art centering in the text box. I have been using alignh and alignv with mixed results. I also noticed that in the supplied code you use position="afterline". If I remove that the horizontal positioning works perfect, however the art is top aligned in the box. I do not see any documentation on 'position' in the tag reference or user's guide. Any way to just center without scaling regardless of bleed box dimensions? See section of code below.

Code:
    //This is the secondary loop for this script.
    //It will loop through and create markup for each page in the PDF.
    for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++)
    {
        markupToReturn += '<graphic file="' + PDFresourceRef.name + '" pagenumber = "' + pageLoop + '" scale="off" alignh="center" alignv="center" />';

        markupToReturn += '<P>';
    }
You could try specifying a different bounding box, by adding an attribute such as pdfbboxtype="MediaBox". (Valid values are "CropBox" (the default), "MediaBox", "BleedBox", "TrimBox", and "ArtBox".) Without seeing the graphics, I'm not sure exactly what effect it will have, but you could play around with that.

Also, the attributes for scale, alignh, and alignv apply only to graphics in graphic frames, and have no effect on inline graphics in text frames, which is what these are.

If you know how many pages there are going to be ahead of time, or at least the maximum, then instead of using inline graphics in a text flow and overflow pages, you could specify multiple body pages with graphic frames, which would allow you to utilize all the graphic scaling and alignment options. You could use the FusionPro.Composition.SetBodyPageUsage function to suppress the extra pages in each record. This is a bit more work to set up, but it might be worth it for the scaling options.
__________________
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
  #22  
Old June 27th, 2012, 02:06 PM
IndexxPrep IndexxPrep is offline
Junior Community Member
 
Join Date: Feb 2009
Location: South Carolina
Posts: 23
Default Re: Inserting Multi-page PDF variable graphics

Thanks for the info. After much trial and error, I have somewhat combined the two methods and now have a properly working product. Thanks so much for all you do Dan! You rescue us all when we're in a rut.
__________________
IndexxPrep
Mac OSX 10.6.8
FP 7.2P1K
CS5
Reply With Quote
  #23  
Old July 20th, 2012, 07:56 AM
Hadrian's Avatar
Hadrian Hadrian is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Dallas Tx
Posts: 135
Default Re: Inserting Multi-page PDF variable graphics

Anyone figure out the centering issue or glitch with this type of inline usage?
Reply With Quote
  #24  
Old July 20th, 2012, 08:14 AM
IndexxPrep IndexxPrep is offline
Junior Community Member
 
Join Date: Feb 2009
Location: South Carolina
Posts: 23
Cool Re: Inserting Multi-page PDF variable graphics

@Hadrian,
The only way I could get this to work for my situation was to use a graphic box method instead of the text overflow method. Because my situation had to handle files with bleed and files without bleed, this was my only option as I could not get the overflow method to center properly for all scenarios. I put the following rule in a text rule. I create a graphic box on page 1 called "Front" and another on page 2 called "Back" and I do not assign any rule or variable field to the graphic box, the rule will do that.

Here is my code:

Code:
FieldName = '';
PDFfileName = '';
pagesInPDF = 0;
markupToReturn = '';
pathToAllPDFs = 'Macintosh HD:Users:macuser01:Desktop:resources:'; /* change "pathToAllPDFs" value to the path where your local test files are located /*
pathToPDF = '';
PDFresourceRef = '';

var FrontFrame = FindGraphicFrame("Front");
var BackFrame = FindGraphicFrame("Back");

//This is the main loop that parses through all of the fields for a given record.

PDFfileName = Field("File");
pathToPDF = Field("File");  /* this one should be uncommented for marcom central */

/*pathToPDF = pathToAllPDFs;  //uncomment this and comment out the one above to preview on a local machine  */

//Create a new resource that references this
PDFresourceRef = CreateResource(pathToPDF ,'graphic' ,'no');

//Find out how many pages it has
pagesInPDF = PDFresourceRef.countPages;

//This is the secondary loop for this script.
//It will loop through and create markup for each page in the PDF.
if (Field("Sides")=="1"){
for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++)
{
FrontFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "1" scale="off" />');
return pathToPDF;
}
}else if (Field("Sides")=="2"){
for (pageLoop = 1; pageLoop <= pagesInPDF; pageLoop++)
{
FrontFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "1" scale="off" />');
BackFrame.SetGraphic('<graphic file="' + PDFresourceRef.name + '" pagenumber = "2" scale="off" />');
return pathToPDF;
}
}
}
return pathToPDF;

return markupToReturn;�
Hope this helps you!
__________________
IndexxPrep
Mac OSX 10.6.8
FP 7.2P1K
CS5
Reply With Quote
  #25  
Old July 20th, 2012, 08:18 AM
Hadrian's Avatar
Hadrian Hadrian is offline
Regular Contributor
 
Join Date: Sep 2008
Location: Dallas Tx
Posts: 135
Default Re: Inserting Multi-page PDF variable graphics

@IndexxPrep

Ok I got it. I am going to use a combo as well. I appreciate it.
Reply With Quote
  #26  
Old August 5th, 2013, 02:31 PM
jreynolds jreynolds is offline
Junior Community Member
 
Join Date: Feb 2011
Location: Dallas, TX
Posts: 11
Default Re: Inserting Multi-page PDF variable graphics

I've used this script many times without an imposition, but am having trouble using an imposition template with an infinite stack.

In the attached sample, I'm trying to get the "AK" version with 14 pages to print 3 times, the "GTC1" version with 23 pages to print 4 times, then the "SSG" version with 22 pages to print 5 times. However, it seems that since the "AK" version is first record, it composes the last 2 records with only 14 pages too and I get the error message:
Quote:
The number of pages in this record does not match the imposition signature: 9 pages will be truncated.
From another thread, I tried adding these lines in OnJobStart, but it sounds like that is uneccessary:
Quote:
//FusionPro.Composition.chunksBreakStacks = true;

//FusionPro.Composition.forcePreprocessing = true;
So what's the trick for getting variable page PDFs to work with infinite stacking imposition?
Attached Files
File Type: zip InsertGraphics Sample.zip (3.38 MB, 3 views)
__________________
Jeff Reynolds
ViaTech Publishing
Windows 7 / Acrobat 10.1.3
FP VDP Creator 8.2.7
Reply With Quote
  #27  
Old August 6th, 2013, 07:10 AM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Inserting Multi-page PDF variable graphics

I don't believe stacking works with projects where each record has a different number of pages output. When job begins to compose FP Imposer presumably calculates total number of records and multiplies that times number of pages in layout/first record to determine total pages which is used to determine where to break each stack (and thereby determine total number of sheets). This process does not take into account that each record might have different number of pages based on rules since they have not processed yet.

I have always had to output single pages in this scenario and use 3rd party imposition software for the stacking process.

I will be thrilled if I turn out to be wrong!
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #28  
Old August 6th, 2013, 09:46 AM
jreynolds jreynolds is offline
Junior Community Member
 
Join Date: Feb 2011
Location: Dallas, TX
Posts: 11
Default Re: Inserting Multi-page PDF variable graphics

Thanks esmith. I think your solution of imposing after processing is the way to go for now. Hopefully a fix is in the works for using this great script with infinite stack imposition.
__________________
Jeff Reynolds
ViaTech Publishing
Windows 7 / Acrobat 10.1.3
FP VDP Creator 8.2.7
Reply With Quote
  #29  
Old August 6th, 2013, 10:32 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,341
Default Re: Inserting Multi-page PDF variable graphics

Quote:
Originally Posted by esmith View Post
I don't believe stacking works with projects where each record has a different number of pages output.
I would make a more general statement: Imposition expects each record to output the same number of pages, whether you're doing stacking or not. There's a setting in FP Imposer where you enter the number of pages per record.
Quote:
Originally Posted by esmith View Post
When job begins to compose FP Imposer presumably calculates total number of records and multiplies that times number of pages in layout/first record to determine total pages which is used to determine where to break each stack (and thereby determine total number of sheets).
Yes, there's a preprocessing step which determines the number of records, and where the stacks and chunks will break.
Quote:
Originally Posted by esmith View Post
This process does not take into account that each record might have different number of pages based on rules since they have not processed yet.
Well, it's not so much that preprocessing doesn't expect records to have different numbers of pages; it's that the entire imposition system doesn't expect it.
Quote:
Originally Posted by esmith View Post
I have always had to output single pages in this scenario and use 3rd party imposition software for the stacking process.

I will be thrilled if I turn out to be wrong!
No, you're not wrong. Although it's not clear to me what the expectation is if you define a signature of, say, 2-up for a business card with a front and a back, and then you output three pages from a record.
__________________
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
  #30  
Old August 6th, 2013, 11:58 AM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Inserting Multi-page PDF variable graphics

Quote:
Originally Posted by Dan Korn View Post
Although it's not clear to me what the expectation is if you define a signature of, say, 2-up for a business card with a front and a back, and then you output three pages from a record.
It would be nice to have the option of creating business cards (using your example) for 500 employees while generating different quantities for each employee based on title (i.e. executives get 300 each; administrative/sales gets 500 each; everyone else gets 100 each). These would all be stacked by employee in one print-ready file.
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
Reply

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 03:55 AM.


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