PDF Merge

 

SmithCart includes the ability to merge multiple PDF files into a single PDF document and serve up a download link to the user to download the merged PDF document.

 

To setup a SmithCart product to merge multiple PDF files, you must setup both the “Source” PDF documents and also configure the “Destination” file name for the merged PDF document that is outputted by SmithCart.

 

PDF Source Files

 

The PDF source files you want to merge are contained in the “Smith_ProductDownloads” table.  The structure of the “Smith_ProductDownloads” table is as follows:

 

      ProductID - SmithCart ProductID

      DocumentID –This is for integration with 3rd party document module for reference purposes.

      SourcePath –This is the full url to each document.

      SortSeqNo - This field is an integer that will be used to define the order of the documents in the merged PDF.

 

Please see the following example Smith_ProductDownloads table with data populated:

 

 

 

 

Please Note:  You should only populate the “Smith_ProductDownloads” table if you have a single SmithCart product that has multiple PDF’s you need to merge into a single PDF document.

 

PDF Destination File

 

The destination PDF file is the file that SmithCart outputs to your server that contains the contents of multiple merged PDF documents.  To setup a product to merge multiple PDF files, you must setup the following fields in the “Downloadable Product Setup” section of the Product Setup page.

 

 

 

 

Download URL – The full url path and file name to the merged PDF file for the product. 

 

For Example:

http://www.mysite.com/portals/0/smithcart/customerdownloads/mydoc.pdf

In the example above “mydoc.pdf” is the name of the merged PDF after SmithCart merges the PDF files found in the “Smith_ProductDownload” table.

 

Product Path – In this field, enter the relative path and file name to the merged PDF file for the product.  The relative path should start after the “\portals\[portalid]” folder, located directly off the root of your DNN install.

 

For Example:

/SmithCart/CustomerDownloads/myDoc.pdf

 

Auto Generate GUID – The auto generate guid provides additional security features for preventing piracy of your downloadable products.  When this checkbox is checked the cart will automatically generate a unique GUID and add the GUID to the end of the download url. 

 

Encrypt URL -  

 

Checkout and PDF Merge Process

 

After a user successfully completes the checkout process, SmithCart will do the following:

 

      For each product on the order, SmithCart will look up the product id in the Smith_ProductDownload table  ordered by the “SortSeqNo” field.

 

      Smth Cart merges all the source PDF files in the “Smith_ProductDownload” table by product id into one PDF document using the path provided in the “DownloadURL” and “ProductPath” fields configured in the SmithCart product setup screen described in the PDF Destination File section above.

 

      The merged PDF document is then saved in the destination folder provided in the  “ProductPath” field configured in the SmithCart product setup screen.

 

      Finally, a download link is displayed to the user in the order detail grid of the confirm status page of the SmithCart checkout.  When the user clicks on the download link the merged PDF document will be opened in a new window for the user to view or save.