I have been experimenting with the ImageToPDFConverter object in .NET Core C# and I have been running into an issue where using the IronPdf.Imaging.ImageBehavior.CropPage option results in the image sizing being off.
I am not doing anything overly complicated:
var sloth = System.IO.Directory.GetCurrentDirectory() + "/Sloth.jpg";
using var slothPDF = ImageToPdfConverter.ImageToPdf(sloth, IronPdf.Imaging.ImageBehavior.CropPage);
slothPDF.SaveAs("SlothTest.pdf");
I have also tried reading the file into a System.Drawing.Image object and passing that in but the results are the same.
My first instinct was that perhaps something is off with the image metadata which is causing this issue, but figured I would raise this here in case it is actually a problem.
I have been experimenting with the ImageToPDFConverter object in .NET Core C# and I have been running into an issue where using the IronPdf.Imaging.ImageBehavior.CropPage option results in the image sizing being off.
I am not doing anything overly complicated:
I have also tried reading the file into a System.Drawing.Image object and passing that in but the results are the same.
Image used in the test:![Sloth](https://user-images.githubusercontent.com/7475708/169060709-66c780a5-0b5f-461d-9672-02ee8525fd73.jpg)
Resulting PDF: SlothTest.pdf
My first instinct was that perhaps something is off with the image metadata which is causing this issue, but figured I would raise this here in case it is actually a problem.