JeremyT
-
Posts
88 -
Joined
Posts posted by JeremyT
-
-
Can the underscores before and after the numerals be eliminated?
Right now it produces:
FORM_01172014_073000_.pdf
I'd like it to be:
FORM-01172014_073000.pdf
I know how to add the hyphen, but I am unsure how to remove the underscores.
-
Input file most often starts with "ORDERS" and ends with "DOOR.xls". Only 1 or 2 a month that don't.
But, I also have a Spanish version of this job that is run a couple of days each month with input files like:
ORDERS_11042013_073000_DOOR SP.txt
Is there a way to capture just the numerals with the underscore between so that I could use the same code for both versions(English and Spanish)?
Screen shots of the input and output files are attached.
-
I am working on a job where I'd like the output pdf to have characters from the input file name.
Input file name: ORDERS_01172014_073000_DOOR.xls
I'd like the final pdf to be named: FORM-01172014_073000.pdf
I've done something similar on this post with code that Dan suggested:
http://forums.pti.com/showpost.php?p=14231&postcount=10
This code was used in a OnRecordStart.
if (FusionPro.Composition.processedRecordNumber == 1 || (FieldChanged("Form Type") && Field("Form Type")=="Form F")) { var outputPrefix = Field("Form Type")=="Form F" ? "Form F" : "Combined"; var outputName = GetFileName(FusionPro.Composition.inputFileName).replace(/^[^1-9]*([^\.]*)20(\d{2})\.\w+$/,outputPrefix+'-$1$2.'); var outputPath = "/some path here/folder/etc/"; // or base this on a field value, or whatever FusionPro.Composition.OpenNewOutputFile(outputPath + outputName + FusionPro.Composition.outputFormatExtension); Print("Changing to output file: " + outputName + FusionPro.Composition.outputFormatExtension); }
This time is simpler in that I am only outputting 1 pdf. How do I adjust?
Thanks,
Jeremy
-
I renamed the pages via Page Usage to "G2", "G2NF", "-BC"
I put the code you last gave me into a OnRecordStart rule.
When composing I get the following error: "A fatal error has occurred and FusionPro must abort. It is possible the disk is full. Composition stopped with errors. Error no 1096."
Job log:
Current working folder: /
Template File: /Form ABCDEF SMIC 0121.dif
Input File: /Excel files/0121 test.csv
Job Config File: /Form ABCDEF-Merge.cfg
Changing to output file: 912213G2.pdf
Composing record #1, input record 1, repeat 1 of 3
No page is emitted, please check page usage in your input file.
Changing to output file: 912213G2NF.pdf
A body page does not have master page assigned.
A blank page is emitted since no record is composed properly.
dlpdfdocwritepdf, progress "Doc->PageCount is zero", error: Bad parameter.
PDF Library Document Write Error: Bad parameter.
pdf_om_WriteDoc, dtl_pdf_WritePdf returned "-2"
Job aborted with error.
-
FusionPro.Composition.repeatRecordCount = 3; var FormLetter = Chr(Asc('A') + FusionPro.Composition.repeatRecordNumber - 1); var FormToUse = "Form " + FormLetter; // Set all body pages to be unused initially in the Page Usage dialog. FusionPro.Composition.SetBodyPageUsage(FormToUse, true); var outputName = Field("Agent_Code") + "-" + FormToUse + "." + FusionPro.Composition.outputFormatExtension; FusionPro.Composition.OpenNewOutputFile(outputName); Print("Changing to output file: " + outputName);
With my test file the code you gave works well. The variable text won't be in the same spot on each card so I'm not sure using a template would work.
This set up is a huge improvement over how we've been doing it now. Currently the merge is done with InDesign for each style. Then pdfs are split and then manually labelled with the Agent Code.
Looking at the real artwork, the pages will be named "G2", "G2NF", and -"BC" .
So when done the output pdfs will look like this:
Agent_CodeG2.pdf
Agent_CodeG2NF.pdf
Agent_Code-BC.pdf
How do I adjust for the new page names?
Thanks,
Jeremy
-
Here is the job. Right now it's very basic graphically because I am still waiting for the customer to send artwork.
I'd like a new output file for each page for each record. So each record would have 3 pdfs. Each pdf labelled based on page name in Page Usage.
I don't have anything in the data file to tell it which page to use since each record gets all pages.
Thanks,
Jeremy
-
But I don't think that's what you want to do here. I'm assuming that this is the same job that was discussed in this thread. The field "form number" is pulled from the data file as well, right? So I think this is what you want:
var outputName = Field("Agent_Code") + "-" + Field("form number") + "." + FusionPro.Composition.outputFormatExtension; FusionPro.Composition.OpenNewOutputFile(outputName); Print("Changing to output file: " + outputName);
This a different job than one you mentioned: //http://forums.pti.com/showthread.php?t=3607
It's similar in that I am trying to get multiple PDFs output. But this time "form number" is not in the data file. I am trying to get the "from number" from the Page Usage.
Again, I've got ideas on what I want to do but am unsure of how to do it. I'm still not that familiar with Javascript.
Thanks,
Jeremy
-
I am merging business cards for multiple insurance agents. Each agent gets 3 different styles of card.
I'd like a pdf output for each style of card for each agent that is labelled with agent_code and style of card.
For instance:
Agent1-FormA.pdf
Agent1-FormB.pdf
Agent1-FormC.pdf
Agent2-FormA.pdf
Agent2-FormB.pdf
Agent2-FormC.pdf
Agent_code is pulled from data file.
I've named the pages using "Page Usage" FormA, FormB and FormC.
Currently it outputs files like this:
"12213function GetBodyPageUsage() { [native code] }pdf"
It also puts all 3 styles in 1 pdf.
I've tried to find information on how to use "GetBodyPageUsage()" but have been unsuccessfull.
Thanks,
Jeremy
var outputName = ((Field("Agent_Code")) + FusionPro.Composition.GetBodyPageUsage); FusionPro.Composition.OpenNewOutputFile(outputName + FusionPro.Composition.outputFormatExtension); Print("Changing to output file: " + outputName + FusionPro.Composition.outputFormatExtension);
-
Thank you for all the help!
-
I wanted each output file to be copied to three different folders but it can't be done.
-
if (FusionPro.Composition.processedRecordNumber == 1 || (FieldChanged("Form Type") && Field("Form Type")=="Form F")) { var outputPrefix = Field("Form Type")=="Form F" ? "Form F" : "Combined"; var outputName = GetFileName(FusionPro.Composition.inputFileName).replace(/^[^1-9]*([^\.]*)20(\d{2})\.\w+$/,outputPrefix+'-$1$2.'); var outputPath = "/some path here/folder/etc/"; // or base this on a field value, or whatever FusionPro.Composition.OpenNewOutputFile(outputPath + outputName + FusionPro.Composition.outputFormatExtension); Print("Changing to output file: " + outputName + FusionPro.Composition.outputFormatExtension); }
Adding the variable outputPath to FusionPro.Composition.OpenNewOutputFile allowed me to tell the composed PDF where to go.
How do I get it to go to 3 folders, each on a separate server?
-
Sure:
if (FusionPro.Composition.processedRecordNumber == 1 || (FieldChanged("Form Type") && Field("Form Type")=="Form F")) { var outputPrefix = Field("Form Type")=="Form F" ? "Form F" : "Combined"; var outputName = GetFileName(FusionPro.Composition.inputFileName).replace(/^[^1-9]*([^\.]*)20(\d{2})\.\w+$/,outputPrefix+'-$1$2.'); FusionPro.Composition.OpenNewOutputFile(outputName + FusionPro.Composition.outputFormatExtension); Print("Changing to output file: " + outputName + FusionPro.Composition.outputFormatExtension); }
Dan,
I used the code you suggested above.
Everything works great!!!
Is it possible to put the 2 pdfs output into 3 different locations?
Thanks,
Jeremy
-
Dan,
Using the code you just provided splits the final pdfs the way I need them.
Is there a way to get the pdf with Forms A-E labeled "Combined-" and then date characters from the data file?
The pdf for Forms F is labeled correctly.
Thanks,
Jeremy
-
My apologies for not giving enough information.
I am using Acrobat Pro 10.1.4 with FusionPro 8.2.7 on Mac OS X 10.7.5
I've attached a zip with the complete job.
Thank you for your help!
-
I've looked through my code several times and can't figure out why this isn't working correctly.
Now I am getting a pdf named "Form A-E.pdf" with Form F pages in it.
Any ideas?
-
Now I get a pdf named "Form A-E" with Form F pages in it.
Any ideas on how to fix this?
-
Now I get a pdf named "Form A-E" with Form F pages in it.
-
I get the following error message when composing:
OnJobStart, line 1: ReferenceError: OnNewOutputFile is not defined
-
Is there a way to get the output pdf of Forms A, B, C, D, and E to pick up part of the data file name like what is being done for Form F?
Is this possible?
-
Is there a way to get the output pdf of Forms A, B, C, D, and E to pick up part of the data file name like what is being done for Form F?
-
Thanks for the help-merge works!
-
I was missing the second capture. Thanks.
-
I ended up with "Form F-5451202.pdf"
I am missing the 13 that comes just before the .CSV in the data file name.
-
I'm assuming you're trying to replace everything in red with "F-".
I also want the magenta text removed.
CARD_00000054512022013.CSV
So it would look like this "Form F-545120213.pdf"
Multiple page usage to multiple pdfs
in FusionPro® VDP Creator
Posted
Dan,
I am using 8.2.
The last code you posted work exactly like I need it!
Thanks again for all your help!
Jeremy