How to convert multipage TIFF (selected frames) to PDF document.

            using Apitron.Image2Pdf;
            ...
            private static void Main(string[] args)
            {
                // open and load the TIF image files
                string[] images = Directory.GetFiles(@"..\Documents\", "*.tif");

                // this objects represents a PDF document
                Document document = new Document();
                
                PageSettings settings = new PageSettings();
                settings.PageOrientation = Orientation.Auto;
                settings.ScaleMode = ImageScaleMode.PreserveAspectRatio;

                 // process and save images to PDF one by one
                foreach (string image in images)
                {
                    // add only frame with selected index  
                    document.AddImage(image, settings, 0);
                }
                document.Save("ConvertTiffToPdfSample.pdf");
            }
        
Back to List