GdPictureDocumentConverter.CombineToPDf fails on Stream

Discussions about PDF management.
Post Reply
jloizagah
Posts: 29
Joined: Tue Mar 17, 2009 2:45 pm

GdPictureDocumentConverter.CombineToPDf fails on Stream

Post by jloizagah » Fri Jun 10, 2022 2:33 pm

I want to combine several images in a single pdf. If I use this code:

IEnumerable<string> inputFiles = new List<string>(new string[] { @"0006920072@14040368.jpg", @"0006920072@14040369.jpg" });
using (Stream dstStream = File.Create(@"merged.pdf"))
{
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
var pp = gdpictureDocumentConverter.CombineToPDF(inputFiles, dstStream, PdfConformance.PDF1_5);
}
}

it works fine, but if I pass MemoryStreams instead of images names, I received a Generic error:

MemoryStream ms1 = new MemoryStream(File.ReadAllBytes(@"0006920072@14040368.jpg"));
MemoryStream ms2 = new MemoryStream(File.ReadAllBytes( @"0006920072@14040369.jpg"));

IEnumerable<Stream> listams2 = new List<Stream>(new Stream[] { ms1, ms2 });


using (Stream dstStream = File.Create(@"merged.pdf"))
{
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
var pp = gdpictureDocumentConverter.CombineToPDF(listams2, dstStream, PdfConformance.PDF1_5);
}
}

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: GdPictureDocumentConverter.CombineToPDf fails on Stream

Post by Hugo » Fri Jun 10, 2022 3:15 pm

Hey there,

Thank you for your feedback.

I would be needing to reproduce this on my end. Could you provide me with the input files you are using please? Once I have these and have reproduced our developpers can work on a fix.
If these are private you can contact us here:
https://orpalis.zendesk.com/hc/en-us/requests/new

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests