Hi,
I've found a issue. Can anyone confirm this?
Below is official code example you could find in this web page:
http://www.aspose.com/docs/display/pdfnet/Use+Image+from+Local+Disk
//Instantiate a Pdf object by calling its empty constructor
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
//Create a section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1);
//Set the path of image file
image1.ImageInfo.File = "C:/Images/aspose.jpg";
Here, if you use an Gif image file containing a hashtag(#) in its file name, like "#.gif", then you'll got an empty test.pdf (0KB) as output.
Weirdly, jpeg image, e.g., "#.jpeg", does not have this problem.
//Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg;
//Set image title
image1.ImageInfo.Title = "JPEG image";
//Save the Pdf
pdf1.Save("d:\\temp\\test.pdf");
Thanks,
Jake
I've found a issue. Can anyone confirm this?
Below is official code example you could find in this web page:
http://www.aspose.com/docs/display/pdfnet/Use+Image+from+Local+Disk
//Instantiate a Pdf object by calling its empty constructor
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
//Create a section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1);
//Set the path of image file
image1.ImageInfo.File = "C:/Images/aspose.jpg";
Here, if you use an Gif image file containing a hashtag(#) in its file name, like "#.gif", then you'll got an empty test.pdf (0KB) as output.
Weirdly, jpeg image, e.g., "#.jpeg", does not have this problem.
//Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Jpeg;
//Set image title
image1.ImageInfo.Title = "JPEG image";
//Save the Pdf
pdf1.Save("d:\\temp\\test.pdf");
Thanks,
Jake