Posted by a ceTe Software moderator
Hello Paul,
Yes, you can set the desired width and height to the image without any problem using our DynamicPDF Generator for .NET product. Please try setting the image width and height as of PDF page dimensions using SetBounds method of Image class and this will work for you. Below is the sample code for it.
string TIFFImageFile = @"C:\Temp\GOOD.TIF";
string tempPdfFilePath = @"C:\Temp\GOOD.pdf";
Document doc = new Document();
doc.InitialPageZoom = PageZoom.FitPage;
Image img = new Image(TIFFImageFile, 0.0f, 0.0f);
Page page = new Page(ceTe.DynamicPDF.PageSize.Letter, 0.0f);
//Setting width and height to the image as of Page.
img.SetBounds(page.Dimensions.Width, page.Dimensions.Height);
page.Elements.Add(img);
doc.Pages.Add(page);
doc.Draw(tempPdfFilePath);
PrintJob printJob = new PrintJob(Printer.Default);
printJob.Pages.Add(tempPdfFilePath);
//Setting the scaling to the print job.
AutoPageScaling scaling = new AutoPageScaling(ScaleTo.PagePrintableArea, true, true);
printJob.PrintOptions.Scaling = scaling;
printJob.Print();
Thanks,
ceTe Software Support Team.