Page 1 of 1

GdPictureDocumentConverter.CombineToPDf fails on Stream

Posted: Fri Jun 10, 2022 2:33 pm
by jloizagah
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);
}
}

Re: GdPictureDocumentConverter.CombineToPDf fails on Stream

Posted: Fri Jun 10, 2022 3:15 pm
by Hugo
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