Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Tuesday, June 27, 2023 7:21:24 AM(UTC)

Rank: Newbie

Groups: Member
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:

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...
Eugene Kosmin  
#2 Posted : Wednesday, June 28, 2023 1:16:31 AM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)

try this one:
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
thanks 1 user thanked Eugene Kosmin for this useful post.
MateuszŁ on 7/1/2023(UTC)
Users browsing this topic
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.