Home
We need your feedback!

PDFDoc Scout

PDFDoc Scout screenshot (click to enlarge)


Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

PDFDoc Scout library - Sample

Download Free Trial See Licensing Options More Information

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 

Download Free Trial See Licensing Options More Information


See also: Bytescout.PDF - native .NET library to write/read/sign/
modify/merge/split PDF documents (but no HTML2PDF support)



On-line documentation (HTML format)


"Hello, World!" quick start step-by-step tutorials:


HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.