Print Page | Close Window

CompressImages - VBS

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3920
Printed Date: 03 May 24 at 6:08PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: CompressImages - VBS
Posted By: Thierry_B
Subject: CompressImages - VBS
Date Posted: 24 May 21 at 9:33PM
Hello,

Great Library :-)
But have problem with CompressImages.
What's wrong ? Error Code 800A01B6

Dim ClassName
Dim QP

Dim InFileName
Dim OutFileName
Dim lWidth
Dim lHeight

ClassName = "DebenuPDFLibrary64Lite1114.PDFLibrary"
InFileName = "image.jpg"
OutFileName = "Testfini.pdf"

Set QP = CreateObject(ClassName)

Call QP.CompressImages(1)

' Load the image that you'd like to convert to PDF
if (QP.AddImageFromFile(InFileName, 0)) = 0 Then WScript.Echo("Erreur chargement image")

' Get the width and height of the image
lWidth = QP.ImageWidth()
lHeight = QP.ImageHeight()

' Reformat the size of the page in the selected document 
Call QP.SetPageDimensions(lWidth, lHeight)

' Draw the image onto the page using the specified width/height
Call QP.DrawImage(0, lHeight, lWidth, lHeight)

' Save the new PDF to disk
If QP.SaveToFile(OutFileName) = 0 Then WScript.Echo("Error, file could not be written")

Set QP = Nothing





Replies:
Posted By: Ingo
Date Posted: 25 May 21 at 8:06PM
Why not asking Google?
This has nothing to do with the library i think...
It's an error code from vbs.
https://www.computerperformance.co.uk/error-codes/800a01b6/" rel="nofollow -

- Code Error 800A01B6 – Object doesn't support this property ...




-------------
Cheers,
Ingo



Posted By: Thierry_B
Date Posted: 25 May 21 at 10:04PM
I think CompressImage is not accessible in Quick Library version; just with commercial one.



Posted By: Sopracenery
Date Posted: 29 May 21 at 5:48PM
Right, you can use only the Appendix C functions.

These are:

Appendix C: Functions available in the Lite Edition
AddImageFromFile
AddLinkToWeb
AddStandardFont
DeletePages
DocumentCount
DrawHTMLText
DrawHTMLTextBox
DrawImage
DrawQRCode
DrawText
DrawTextBox
ExtractPages
FindImages
GetImageListCount
GetImageListItemFormatDesc
GetInformation
GetPageBox
GetPageImageList
HasFontResources
ImageCount
ImageHeight
ImageWidth
IsLinearized
LastErrorCode
LoadFromFile
MergeDocument
NewDocument
NewPage
NormalizePage
PageCount
PageHasFontResources
PageHeight
PageRotation
PageWidth
RemoveDocument
RotatePage
SaveToFile
SecurityInfo
SelectDocument
SelectedDocument
SelectFont
SelectImage
SelectPage
SetBaseURL
SetInformation
SetMeasurementUnits
SetOrigin
SetPageBox
SetPageDimensions
SetPageLayout
SetPageMode
SetPageSize
SetTextAlign
SetTextColor
SetTextSize
SetTextUnderline



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk