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

Notification

Icon
Error

Options
Go to last post Go to first unread
mohnston  
#1 Posted : Tuesday, July 14, 2020 8:20:16 AM(UTC)
mohnston

Rank: Newbie

Groups: Member
Joined: 6/23/2020(UTC)
Posts: 5

Thanks: 1 times
I get error - Aurigma.GraphicsMill.UnsupportedPixelFormatException: 'The specified pixel format is not supported.' when I run this code.

Code:
var quality = 100;
var dpi = 92f;
using (var read = new PdfReader(fn, dpi, dpi))
using (var write = new JpegWriter(fnOut,quality,false,true))
{
    Pipeline.Run(read + write);
}

It's as close to the sample code as it gets.

fn is a valid path to a valid pdf file.

Running v10.5.30 registered

Edited by moderator Tuesday, July 14, 2020 9:13:37 AM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Tuesday, July 14, 2020 9:15:54 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Please try to remove the alpha channel as the JPEG format doesn't support transparency.

Code:
var quality = 100;
var dpi = 92f;
using (var read = new PdfReader(fn, dpi, dpi))
using (var converter = new ColorConverter(PixelFormat.Format24bppRgb))
using (var write = new JpegWriter(fnOut,quality,false,true))
{
    Pipeline.Run(read + converter + write);
}
Best regards,

Fedor Skvortsov

thanks 1 user thanked Fedor for this useful post.
mohnston on 7/14/2020(UTC)
mohnston  
#3 Posted : Tuesday, July 14, 2020 10:57:45 AM(UTC)
mohnston

Rank: Newbie

Groups: Member
Joined: 6/23/2020(UTC)
Posts: 5

Thanks: 1 times
Hmmm - that worked. Thank you!

Would have saved me much time to include a note about that in the documentation. Eh?

Users browsing this topic
Guest
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.