LEADTOOLS Support
Imaging
Imaging SDK FAQ
Can I create single and multipage tiffs from PDFS using your tools?
#1
Posted
:
Friday, March 31, 2017 3:29:53 PM(UTC)
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.htmlhttps://www.leadtools.co...o/rastercodecs-save.htmlThe 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.
LEADTOOLS Support
Imaging
Imaging SDK FAQ
Can I create single and multipage tiffs from PDFS using your tools?
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.