Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, March 31, 2017 3:29:53 PM(UTC)

Roberto  
Roberto

Groups: Registered, Tech Support, Administrators
Posts: 39

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)

Absolutely!

For this we can leverage the RasterCodecs class. This class offers a number of overloads for loading and saving files.

https://www.leadtools.co...o/rastercodecs-load.html
https://www.leadtools.co...o/rastercodecs-save.html

The following code snippet demonstrates how the load and save method overloads would be use to create multipage TIFFs from PDF and individual TIFFs from PDF.

Code:
using (RasterCodecs codecs = new RasterCodecs())
{
    //load the original PDF
    codecs.Options.Load.AllPages = true;
    using(RasterImage image = codecs.Load(@"C:\Users\Public\Documents\LEADTOOLS Images\Leadtools.pdf"))
    {
        //save as multipage tiff
        codecs.Save(image, @"output path.tif", RasterImageFormat.Tif, 0, 1, -1, 1, CodecsSavePageMode.Overwrite);

        //save each page as individual tiff
        for (int i = 1; i <= image.PageCount; i++)
            codecs.Save(image, @"output path" + i + ".tif", RasterImageFormat.Tif, 0, i, i, 1, CodecsSavePageMode.Overwrite);
    }
}


Another option is to use the RasterImage Class to create multipage images in memory. The RasterImage object can hold multiple pages with different sizes. The AddPage, AddPages, InsertPage and InsertPages methods allows adding new pages to an existing RasterImage.

Edited by moderator Wednesday, December 27, 2023 2:18:12 PM(UTC)  | Reason: Updated

Roberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.046 seconds.