Jump to content

Recommended Posts

Posted (edited)

Hi!

I made this class because many of my AutoIt projects have to generate PDF files (logs, incomes...), and I always have to FileInstall() wkhtmlto*.exe and care about arguments, putting them in temporary folder then deleting it and many other always-the-same boring things.

It's a class/object. It uses AutoItObject (which is already included). The wkhtmltopdf.exe and wkhtmltoimage.exe files are also included. All you must do to start using the class is including just the class file and instancing the class. Here's an example:

#include "class\wkhtmltox.au3"

Local $oObject = WKHtmlToX()

$oObject.Input = "http://microsoft.com/"
$oObject.Output = "microsoft.pdf" ; relative to current working dir

$oObject.Convert()

; Now converting the same page into PNG

$oObject.ToFormat = "png"
$oObject.Output = "microsoft.png"

$oObject.Convert()

Help file included.

Download file is just a redirect link because of the file size (14 MB because of wkhtmlto*.exe). The forum upload seems not to be working.

Download full script (13,7 MB)

AutoIt Forum Files: https://www.autoitscript.com/forum/files/file/343-wkhtmktox/ 

Dropbox: https://www.dropbox.com/s/xzw1l0b0y08mv8z/wkhtmltox.zip?dl=0

 

License info

As wkhtmltopdf is LGPL, you can use it on a proprietary software, since you tell that you're using it (a link to http://wkhtmltopdf.org on the help files and About dialog would be cool...)

Please check AutoItObject and CreateFilesEmbedded licenses: https://www.autoitscript.com/forum/topic/110379-autoitobject-udf/ and https://www.autoitscript.com/forum/topic/132564-createfilesembeddedau3-like-fileinstall/ 

This class is just a wrapper, so you don't need to tell anything about it on your app.

Edited by Jefrey
Added forum files link and license info

My stuff

  Reveal hidden contents

 

Posted (edited)

Can you put this files to:
https://www.autoitscript.com/forum/files/

instead Dropbox ?

please 

 

mLipok

 

edit: as a category you can use "PDF"

 

btw. 

As wkhtmltopdf is GNU is this mean: If I use your code then my program made in AutoIt becomes licensed as GNU ?

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Hi, @mLipok Thanks for your response!

  Quote

Can you put this files to:
https://www.autoitscript.com/forum/files/

instead Dropbox ?

please 

Although the total file limit in it was also 7.86 MB, I was able to upload :blink:

Well... Here's the link: https://www.autoitscript.com/forum/files/file/343-wkhtmktox/

  Quote

As wkhtmltopdf is GNU is this mean: If I use your code then my program made in AutoIt becomes licensed as GNU ?

wkhtmlto* is LGPL (v3). AFAIK, it allows us to use the wkhtmlto* binary in our projects, but you must not use the same license (although it would be nice, we know this is a capitalist world). But you must supply some way that the user can have access to the original source code (a link to the project page on the About dialog would be an idea). See this: http://www.gnu.org/licenses/lgpl.html#section4

The first paragraph of [http://www.gnu.org/licenses/why-not-lgpl.html this page] (forum bug? Can't insert links) is also meaningless:

  Quote

The GNU Project has two principal licenses to use for libraries. One is the GNU Lesser GPL; the other is the ordinary GNU GPL. The choice of license makes a big difference: using the Lesser GPL permits use of the library in proprietary programs; using the ordinary GPL for a library makes it available only for free programs.

 

My stuff

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...