Free Support Forum -

Convert a JPG file passed as FileStream to PDF issue in .NET


I noticed some very strange behavior when converting a certain jpg file.
The problem is always reproducible using the basic pdf conversion sample, but only happens when the file is passed in as a stream.
The following code was used to modify the sample:

private static Stream GetFileStream() { return File.OpenRead(@"D:\Back Gallery For saturn v launch wallpaper.jpg"); }
using (Converter converter = new Converter(GetFileStream))

If the same file is passed in normally, the conversion works as expected.

using (Converter converter = new Converter(@"D:\Back Gallery For saturn v launch wallpaper.jpg"))

Does anyone have an explanation for this strange behavior or could this be a bug?
(I tried with different images, but only this one seems to trigger this issue.
The issue was found when saving attachments to a FileStream using GroupDocs.Viewer.SaveAttachment, but I simplified the sample.)

1 Like


This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID CONVERSIONNET-3633. We’re now investigating it. As there is any update, you’ll be notified.

Thank you :slight_smile:

1 Like


You’re welcome :slight_smile:

1 Like

@Clemens_Pestuka - if you don’t mind sharing, what is the issue that you are having?

I am having an issue attempting to convert certain PNGs and JPEGs to PDF, where they produce a valid PDF, but it’s blank.

I am also using a Stream instead of loading from a physical file.

What version of GroupDocs.Conversion are you running?



Your query is answered here.