Rank: Newbie
Groups: Guest
Joined: 2/7/2019(UTC) Posts: 9
Thanks: 6 times
|
I'm asking for help again :) how to create cmyk tiff from cmyk pdf? I tried several methods, the shortest is: Code:using (var reader = new PdfReader(filePdf, V.pageDpi, V.pageDpi))
using (var writer = new TiffWriter(filePdf.Replace(".pdf", ".tiff")))
{
writer.Compression = CompressionType.Zip;
Pipeline.Run(reader + writer);
}
but I get a tiff file which has RGB colors...
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Hi, try this one: Code:using (var reader = new PdfReader(filePdf, dpi, dpi))
using (var writer = new TiffWriter(filePdf.Replace(".pdf", ".tiff")))
{
using (var content = reader.Frames[0].GetContent())
{
var format = content.GetPreferredPixelFormat();
using (var imageGenerator = new ImageGenerator(content, format, RgbColor.Transparent))
{
imageGenerator.ColorProfile = content.GetPreferredColorProfile(format.ColorSpace);
writer.Compression = CompressionType.Zip;
Pipeline.Run(imageGenerator + writer);
}
}
}
Getting preview images from PDF is RGB only. But it’s much faster, so I would recommend using it when possible. |
Best regards, Eugene Kosmin The Aurigma Development Team
|
1 user thanked Eugene Kosmin for this useful post.
|
|
|
Forum Jump
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.