Jump to content

JeremyT

Registered Users - Approved
  • Posts

    88
  • Joined

Posts posted by JeremyT

  1. 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.

    ScreenShot2014-01-22at11_39_22AM.jpg.a1aa7402dba855ed8b05aa7897cb0201.jpg

    ScreenShot2014-01-22at11_40_26AM.jpg.398e2dcbef03a75e9f3ab99fdb5a4bca.jpg

  2. 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

  3. 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.

  4. 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

  5. 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

  6. 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);
    

  7. 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?

  8. 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

×
×
  • Create New...