-
The file to convert is attached (Please rename it from .avi to .bmp) (Why it’s not allowed to attach bmp file here)
2. Then I convert it using your example from documentation:public static void ConvertToPdfTest()
{
//Instantiate a Pdf object by calling its empty constructor
var pdf1 = new Aspose.Pdf.Generator.Pdf();<span style="color:green;">//Create a section in the Pdf object</span> <span style="color:blue;">var</span> sec1 = pdf1.Sections.Add(); <span style="color:green;">//Create an image object in the section</span> <span style="color:blue;">var</span> image1 = <span style="color:blue;">new</span> Aspose.Pdf.Generator.<span style="color:#2b91af;">Image</span>(sec1); <span style="color:green;">//Add image object into the Paragraphs collection of the section</span> sec1.Paragraphs.Add(image1); <span style="color:green;">//Set the path of image file</span> image1.ImageInfo.File = <span style="color:#a31515;">@"E:\Bugs\BMP_file\4.bmp"</span>; <span style="color:green;">//Set the type of image using ImageFileType enumeration</span> image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.<span style="color:#2b91af;">ImageFileType</span>.Bmp; <span style="color:green;">//Set image title</span> image1.ImageInfo.Title = <span style="color:#a31515;">"BMP Image"</span>; <span style="color:green;">//Save the Pdf</span> pdf1.Save(<span style="color:#a31515;">@"E:\Bugs\BMP_file\testBmp4.pdf"</span>); }</pre>3. Resulted Pdf file is attached<br><br>Aspose.Imaging.dll version: 3.0.0.0<br><br>
-
Take 2.bmp file (it’s attached as .avi => rename it into .bmp)
2. Convert it with aspose.imaging.dllpublic static void ConvertToPdfTest()
{
//Instantiate a Pdf object by calling its empty constructor
var pdf1 = new Aspose.Pdf.Generator.Pdf();<span style="color:green;">//Create a section in the Pdf object</span> <span style="color:blue;">var</span> sec1 = pdf1.Sections.Add(); <span style="color:green;">//Create an image object in the section</span> <span style="color:blue;">var</span> image1 = <span style="color:blue;">new</span> Aspose.Pdf.Generator.<span style="color:#2b91af;">Image</span>(sec1); <span style="color:green;">//Add image object into the Paragraphs collection of the section</span> sec1.Paragraphs.Add(image1); <span style="color:green;">//Set the path of image file</span> image1.ImageInfo.File = <span style="color:#a31515;">@"E:\Bugs\BMP_file\2.bmp"</span>; <span style="color:green;">//Set the type of image using ImageFileType enumeration</span> image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.<span style="color:#2b91af;">ImageFileType</span>.Bmp; <span style="color:green;">//Set image title</span> image1.ImageInfo.Title = <span style="color:#a31515;">"BMP Image"</span>; <span style="color:green;">//Save the Pdf</span> pdf1.Save(<span style="color:#a31515;">@"E:\Bugs\BMP_file\testBmp2.pdf"</span>); }</pre>3. Resulted pdf is created (attached) but if you try to open it shows error "Insufficient data for an image"<br>
Hi Ulrik,
Hi Ulrik,
I use Aspose.Pdf.Generator.Image as a type of image, yes, Aspose.Pdf version is 10.6.0.0
I use Aspose.Pdf.Generator.Image as a type of image, yes, Aspose.Pdf version is 10.6.0.0
Hi Ulrik,
This file is 30KB size. I attached it again, but the file is same as previously
Hi Ulrik,
Ok about 2.bmp file.
Please note that there are 2 different problems with 2 different files.
“BMP file converts into ‘slush’” was the first problem with 1.bmp file (and has higher priority for us)
Hi Ulrik,
that’s really strange.
Attaching ones more the same file…
Hi Ulrik,
I downloaded new version, package “Aspose.Total_dll_only” and tried to convert files.
For now I have Aspose.Pdf 10.8.0.0 and there are still absolutely the same problems with 1.bmp and 2.bmp
Hi Ulrik,