• Contact
  • Company
  • Login / My Account
  • Shopping Cart (0)
Document Conversion Made Easy!
Peernet Menu
  • Products
      • Virtual Printers
        • tiff-image-printer-iconTIFF Image Printer – Create TIFF Images
        • raster-image-printer-iconRaster Image Printer – Create TIFF, PDF, JPEG, etc.
        • pdf-image-printer-iconPDF Image Printer – Create Searchable PDF
      • PDF Editor
        • pdf-creator-plus-iconPDF Creator Plus – Merge, Edit, Create Searchable PDF
      • Batch Converters
        • document-conversion-service-iconDocument Conversion Service – Unattended 24/7 Batch Converter
        • file-conversion-center-iconFile Conversion Center – Desktop Batch Converter
      • Reporting Software
        • peernet-reports-iconPEERNET Reports – Barcode, Report and Label Software
      • enterprise-licensingEnterprise Licensing for your Corporation
      • discounts-multiple-licensesDiscounts for Purchasing Multiple Licenses
      • distribute-bundle-peernet-softwareDistribute PEERNET Software Bundled with your Product
  • Purchase
      • Purchase Virtual Printers
        • tiff-image-printer-iconTIFF Image Printer – Create TIFF Images
        • raster-image-printer-iconRaster Image Printer – Create TIFF, PDF, JPEG etc.
        • pdf-image-printer-iconPDF Image Printer – Create Searchable PDF
      • Purchase PDF Editor
        • pdf-creator-plus-iconPDF Creator Plus – Merge, Edit, Create Searchable PDF
      • Purchase Batch Converters
        • document-conversion-service-iconDocument Conversion Service – Unattended 24/7 Batch Converter
        • file-conversion-center-iconFile Conversion Center – Desktop Batch Converter
      • Purchase Reporting Software
        • peernet-reports-iconPEERNET Reports – Barcode, Report and Label Software
      • peernet-online-store-purchase-optionsPurchase Options
      • peernet-software-license-levelsLicense Levels
      • peernet-software-purchase-resellerFind Resellers
      • peernet-software-sales-faqsSales FAQ
  • Learn & Support
        • peernet-help-centerTutorials
          • Learn the Basics or Go Beyond with Video Tutorials, FAQs and Guides

            At PEERNET we pride ourselves on providing the best support and the fastest response times in the industry.
          • Select Software Tutorials:
              • tiff-image-printer-iconTIFF Image Printer
              • raster-image-printer-iconRaster Image Printer
              • pdf-image-printer-iconPDF Image Printer
              • pdf-creator-plus-iconPDF Creator Plus
              • document-conversion-service-iconDocument Conversion Service
              • file-conversion-center-iconFile Conversion Center
              • peernet-reports-iconPEERNET Reports
        • peernet-software-faqsSales FAQ
          • Popular Topics

            Find all the answers you need to our most frequently asked questions.
              • Download & Install
                • How do I download software I already purchased?
              • Purchasing & Renewing
                • How do I purchase PEERNET software?
                • What license level do I need?
                • How do I add licenses to an existing serial number?
                • How do I renew my annual subscription?
              • Licensing & Operating
                • How do I activate my new PEERNET software?
                • How do I activate my software without an internet connection?
                • Where do I find my serial number?
                • How do I move my software to a new computer?
                • How do I update/upgrade my software to the latest release?
            • Read all Sales FAQs
  • Blog
  • Menu Menu
Document Conversion Service box shot

Combining Specific Pages of Each File into a Single PDF

June 20, 2014/by Robert Massart

Document Conversion Service

A Document Conversion Service customer in the banking industry recently needed to combine a group of PDF, Word and Excel files into a single PDF file. His key requirement was that for certain files he only wanted specific pages and for others he needed the entire file. He needed to be able to do this from an in-house application that was also being designed and implemented at the time.

Our customer approached us with his requirements and asked us if it could be done. At the time, our current solution to combine files did not have the ability to pass down individual settings for each file in the set.

We at PEERNET listen to the needs of our clients and so quickly saw that this was a feature that would be useful for all our customers. Soon after, we added this feature for the Document Conversion Service 2.0.015 release.

NOTE!This feature is only available from the PNConverter.CombineFiles method of the PEERNET.ConvertUtility.dll. The command line tool, DCSCombineFiles, does not allow for custom settings per file.

Creating the File List with Settings

When combining files, a main profile is used to specify the conversion settings for the resulting combined file. To allow each file to have their own settings in addition to the profile settings, the PNConverter.PNConvertFileInfo class is used to build a collection of files and settings to be passed to the PNConverter.CombineFiles method. The settings passed per file are used in addition to or instead of any settings in the main profile.

Only the following conversion settings can be used for the individual file settings:

  • General Converter Options
  • Endorsement Options
  • Word Converter Options
  • Excel Converter Options
  • PowerPoint Converter Options
  • Adobe Reader Options
  • Internet Explorer Options
  • Ghostscript Converter Options
  • Image Converter Options
  • OutsideIn AX Options

In the PNConverter.PNConvertFileInfo object, the path to each file must be a fully qualified path name. The OutputFolder property is ignored when combining files. The collection of settings is set for that file; this collection can be left empty if no custom settings are needed. The files are converted in the order in which they are added to the list.

IList<PNConvertFileInfo> fileInfoList = new List<PNConvertFileInfo>();
IList<PNSetting> filesettings = new List<PNSetting>();

// This file will print all pages and uses only the conversion 
// settings from the profile - we aren't passing any additional settings.
fileInfoList.Add(new PNConvertFileInfo(@"C:\Test\InputFiles\Report.pdf",
                                       String.Empty, null));

// This file only prints the first 3 pages, but also shows all markup
// in the Word document.
filesettings.Add( new PNSetting("PageRange", "1-3"));
filesettings.Add( new PNSetting("Microsoft.Word.Document.PrintOut.Item", 
                                "DocumentAndMarkup") );

fileInfoList.Add(new PNConvertFileInfo(@"C:\Test\InputFiles\Memo.doc",
                                   String.Empty,
                                   filesettings));

Combining the List of Files

The code sample below uses the PNConvertFileInfo list created above to append both files into a single multipaged PDF file image containing all the pages of the PDF and the first 3 pages of the Word document with markup displayed. The resulting combined file will be created using the conversion settings from the profile PDF 300dpi OptimizedColor.

PNCombineItem resultsItem = null;
String outputDir = @"C:\Test\CombineOutput";
String outputName = "CombinedInput";
 
resultsItem = 
    PNConverter.CombineFiles(fileInfoList,         // PNConvertFileInfo collection
                             outputDir,            // output folder
                             baseName,             // name of combined file
                             false,                // overwrite
                             false,                // create results log 
                             "PDF 300dpi OptimizedColor", // profile
                             String.Empty,         // File-ext
                             String.Empty,         // MIME
                             null,                 // user settings
                             String.Empty,         // not using remote conversion (DCOM)
                             String.Empty,         // remote conversion folder
                             String.Empty          // Log path
                             );

A handy new feature if you ask us! And we think most of our Document Conversion Service clients would agree. Let us know if you need help setting up this new feature.

https://www.peernet.com/wp-content/uploads/DCSBox-for-blog.jpg 450 1516 Robert Massart https://www.peernet.com/wp-content/uploads/peernet-logo.png Robert Massart2014-06-20 11:38:312019-07-16 14:44:51Combining Specific Pages of Each File into a Single PDF
  • Document Conversion Service
  • TIFF Image Printer
  • Raster Image Printer
  • PDF Image Printer
  • PDF Creator Plus
  • File Conversion Center
  • PEERNET Reports
Search Search

Recent Posts

  • PNSrv11Lib to PNSrv12Lib: Migration Made Easy
  • Migrating to Version 12: Compatibility Mode Quick Start Guide
  • Well Logs: Stitch PDF Pages into a Continuous TIFF Image
  • Dynamic Stamp Content
  • Convert to PDF: The Power of On-Premise PDF Creation

INTERESTING LINKS

Below are some interesting links for you! Enjoy your stay :)

RSS Feed Logo RSS Feed Logo Subscribeto RSS Feed

OUR PRODUCTS

  • Document Conversion Service
  • TIFF Image Printer
  • Raster Image Printer
  • PDF Image Printer
  • PDF Creator Plus
  • File Conversion Center
  • PEERNET Reports

LATEST NEWS

  • PNSrv11Lib to PNSrv12Lib: Migration Made EasyMarch 14, 2025 - 2:10 pm
  • Migrating to Version 12: Compatibility Mode Quick Start GuideMarch 14, 2025 - 2:09 pm
  • Well Logs: Stitch PDF Pages into a Continuous TIFF ImageMarch 14, 2025 - 2:08 pm
  • Dynamic Stamp ContentNovember 4, 2024 - 4:47 pm

BUSINESS INFORMATION

Toll Free: 1-800-883-7980 North America

Tel: 1-613-224-6894

Our office hours are Monday to Friday, from 0900 hrs to 1700 hrs, Eastern Standard Time.

Email Address: [email protected]
Copyright © 1997-2026. All rights reserved. Terms and Conditions | Disclaimer | Privacy Policy | Trademarks.
PEERNET® is a registered trademark of PEERNET Inc.
  • Link to Youtube
  • Link to Rss this site
  • Products
  • Purchase
  • Company
  • Contact
Link to: Linking PDF Table of Contents to Sections Within, Using Our PDF Creator Plus Link to: Linking PDF Table of Contents to Sections Within, Using Our PDF Creator Plus Linking PDF Table of Contents to Sections Within, Using Our PDF Creator Plu... Link to: Why Microsoft Word is Not Ideal for Sharing Docs at the Office Link to: Why Microsoft Word is Not Ideal for Sharing Docs at the Office document converter featuresWhy Microsoft Word is Not Ideal for Sharing Docs at the Office
Scroll to top Scroll to top Scroll to top