Due to some problems with pptx to pdf support right now I am creating thumbnails of the pptx and wanting to place them in a pdf file. I have been unsuccessful of getting the image to show up full size on the page with no border or margin.
Hello Eric,
Thanks for considering Aspose.
Please try using the following code snippet to accomplish your requirement. The following code reads the image files (JPEG) in a particular folder and converts them into a single PDF document, where the size of the image is same as the PDF size (no margin and border at any side).
[C#]
Pdf pdf = new Pdf();
MarginInfo marginInfo = new MarginInfo();
marginInfo.Bottom = 0;
marginInfo.Left = 0;
marginInfo.Right = 0;
marginInfo.Top = 0;
pdf.PageSetup.Margin = marginInfo;
Aspose.Pdf.Section section = pdf.Sections.Add();
string[] fileEntries = Directory.GetFiles(@"D:\pdftest\tempforImages\", "*.jpg");
for(int i=0; i<fileEntries.Length; i++)
{
section.IsLandscape = true;
Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);
image.Margin = marginInfo;
image.ImageInfo.FixHeight= section.PageInfo.PageHeight;
image.ImageInfo.FixWidth= section.PageInfo.PageWidth;
image.ImageInfo.ImageFileType = ImageFileType.Jpeg;
image.ImageInfo.File = fileEntries[i];
section.Paragraphs.Add(image);
}
pdf.Save(@"D:\pdftest\tempforImages\sampleresultant.pdf");
In case it does not satisfy your requirements or you've any further query, please feel free to contact.