The PDFDoc Scout SDK product has been acquired by Lionsoft company in January, 2011 and not available on our web-site anymore.

NEW: pdf generator for Web Developers: PDF Generator SDK for Javascriptclick here to read more details...


For 3rd party C# open-source PDF generation library? Check the blog article: .NET Bear, Do You Know Any Free PDF Generation Libraries For Use In Commercial Applications?
 

Check our commercial products for PDF format:

PDF Extractor SDK - extract tables, text, structured data from PDF files in your apps

PDF Renderer SDK - render PDF files to PNG, BMP, TIFF images in your apps

PDF To HTML SDK - convert PDF to HTML with images and formatting preserved

How to scale image (JPG, BMP, PNG, TIFF, GIF) to fit page in PDF document generated with PDFDoc Scout library

Tutorial: sample on scaling JPG, BMP (TIFF, PNG) images to fit pages in PDF generated by PDFDoc Scout library

You can download the source code of this example here: pdfdocscout_scale_image_to_fit_page.zip

This tutorial describes how to scale images to fit the page in PDF document generated with PDFDoc Scout library

See also: using HTML formatting to draw tables

Screenshot of generated PDF document:

Images scaled to fit the page in PDF document

Source code of example (scale_image_to_fit_page.vbs):

Set PDFDoc = CreateObject("PDFDocScout.PDFDocument")

PDFDoc.InitLibrary "demo", "demo"
PDFDoc.OutputFilename = "scale_image_to_fit_page.pdf"
PDFDoc.AutoOpenGeneratedPDF = true

PDFDoc.BeginDocument

Image1 = PDFDoc.AddImageFromFileName ("test.jpg", 1) ' 1 = ictJPEG type image compression, we store image as JPEG inside PDF

Image1Width = PDFDoc.GetImageWidth(Image1)
Image1Height = PDFDoc.GetImageHeight(Image1)

' place scaled image to fit the page
PDFDoc.Page.PlaceImageEx Image1, 0,0, PDFDoc.Page.Width / Image1Width, PDFDoc.Page.Height / Image1Height, 0

PDFDoc.EndDocument ' close PDF document generation

' disconnect from library
Set PDFDoc = Nothing

You can download the source code of this example here: pdfdocscout_scale_image_to_fit_page.zip 

Filed in: PDFDoc Scout SDK

Tutorials: