This topic contains 4 replies, has 0 voices, and was last updated by chanarbon 8 years, 1 month ago.

  • Author
    Posts
  • #1678

    JacksonP

    Is there any way in Netsuite to Concatenate PDF Files together? I have 100 PDFs in a folder, that I want to concatenate together into one large File. I wanted to create a script to easily do that to build into the file cabinet. I have a workflow that can create a bunch of pdfs easily, just not together. Any Ideas?

    Code:
    function(record, file, render) {

    function onAction(scriptContext) {

    var objRecord = scriptContext.newRecord;

    var invoicePdf = render.transaction({
    entityId: objRecord.id,
    printMode: render.PrintMode.PDF
    });

    invoicePdf.folder = 5169576;

    invoicePdf.save();
    }

    return {
    onAction : onAction
    };
    });
    This is a cached copy. Click here to see the original post.

  • #1679

    david.smith

    Save your XML to a folder. Then you can concat them together with the script and output the one file. If you still need the individual PDFs you can still save them as well.

    I don’t know a way you can combine the PDF files.

  • #1680

    JacksonP

    Alright, I’ll look into that, Thanks!

  • #1681

    Infinet Cloud Solutions

    As per David its not possible to concatenate PDF files. Whilst not solving the problem exactly, I would like to see an extension of the file module to allow the generation of a zip file from one or more files from the file cabinet (or file objects).

  • #1682

    chanarbon

    @Infinet Cloud Solution,

    For your concern, you can use JSZip for this concern to zip a a certain number of files. The only concern you can get with JSZip library is that is uses a number of instructions which makes it a lot better used in Map/Reduce

You must be logged in to reply to this topic.