The unit of FixHeight and FixWidth properties is the point (72 pints = 1 inch, 1 inch = 25.4 mm). This is the code example to add an image in the PDF document:
C#
string dataDir = @"C:\Pdf\test627\";
// Instantiate Document object
Document doc = new Document();
// add page to pages collection of PDF file
Aspose.Pdf.Page page = doc.Pages.Add();
// Create an image instance
Aspose.Pdf.Image img = new Aspose.Pdf.Image();
img.FixWidth = 42.51; // 15mm = (15/25.4*72) points
img.FixHeight = 600;
// Set image type as SVG
img.FileType = Aspose.Pdf.ImageFileType.Unknown;
// Path for source file
img.File = dataDir + "Example.png";
page.Paragraphs.Add(img);
//Set page properties
page.PageInfo.Width = 800;
page.PageInfo.Height = 800;
// save resultant PDF file
doc.Save(dataDir + "Test.pdf");
If you speak with the team that produces the documentaton for the Image class so they add the unitis for FixWidth and FixHeight will save us alot of time searching and wondering …
Here you explain it great - but the documentation is lacking.
See https://docs.aspose.com/display/pdfnet/Aspose.Pdf.Image.FixHeight+Property
Looking at that page i do not receive any helpful information…
They can just copy paste your example and we as customers will be very happy!
We apologize for the inconvenience faced while searching required information in documentation. We will definitely consider your suggestion to improve API documentation accordingly.