Free Support Forum - aspose.com

Help with Ambiguous Reference in example

The example in the Image class:

Pdf pdf = new Pdf();

Section section = new Section(pdf);
pdf.Sections = new Sections();
pdf.Sections.Add(section);

Image image1 = new Image(section);
section.Paragraphs = new Paragraphs();
section.Paragraphs.Add(image1);

image1.ImageInfo.File = “C:/Images/Flower.jpg”;
image1.ImageInfo.Type = “jpeg”;

pdf.Save(“C:/Test.pdf”);

Image is an Ambiguous reference. Which library should it be pointing to?

System.Drawing…
System.Web…
Aspose.Pdf…

Any help would be great!

Thanks

Paul

Dear Paul,

Thanks for your consideration.

We have noticed some of the examples included in the API Reference are obsolete. Your example should be like this:


Pdf pdf = new Pdf();

Section section = new Section(pdf);
pdf.Sections = new Sections();
pdf.Sections.Add(section);

Aspose.Pdf.Image image1 = new Aspose.Pdf.Image(section);
section.Paragraphs = new Paragraphs();
section.Paragraphs.Add(image1);

image1.ImageInfo.File = “C:/Images/Flower.jpg”;
image1.ImageInfo.ImageFileType = Aspose.Pdf.ImageFileType.Jpeg;

pdf.Save(“C:/Test.pdf”);

Soon we will announce a new release which will include the updated and working examples in the API Reference.

Thanks for you patience.

Please accept my personal apology for any inconvenience you may have experienced.