Create PDF from your application

242 posts in this topic

Posted (edited)

If you look to output PDF's from your application (generate reports, graphics, tables etc), this UDF can be very useful.

In the zip file are examples, images for testing and the UDF.

Enjoy!

I have removed some of the previous versions due to the lack of space, but they are still available on request.

[uPDATED June 22] v.1.0.1 Added more page formats, two more fonts, example table ...

[uPDATED July 30] v1.0.2 Solved issues with Adobe Reader. StuffByDennis added two more functions (Thanks Dennis).

[uPDATED August 10] v1.0.3 Rewrote entirely _LoadResImage function - optimize for speed/size of the pdf. Fixed the Example_Image2PDF

Thanks to xavierh for finding a missing space in the _LoadFontTT function (even it looks insignificant, that solved

an issue with text justification when using Adobe Reader, not Foxit Reader)

Total downloads old versions: 2044 + 21

Version 1.0.3: MPDFv103.zip

Old versions:

pdfAutoit.rar

MIPDF.zip

Edited by taietel

Share this post


Link to post
Share on other sites



Posted

I've tried to edit my post and the code between autoit code tags was all scrambled!

I've attached the script in the first post and link to the fonts zip file.

Share this post


Link to post
Share on other sites

Posted

Hi taietel

I have tried it, it works well !

It seems there are lot of possibility of creation.

Thanks Posted Image

Share this post


Link to post
Share on other sites

Posted

Hi wakillon! And thanks for the feedback.

I know there are a lot! You can write more functions based on what's on the script, make form-based apps and output to pdf, daily reports etc. Use your imagination!  ;) 

This is just a bare-bone I've decided to share.

Share this post


Link to post
Share on other sites

Posted (edited)

 For now I'm occupied with relocation, but hopefully this does not last forever.    ;)

M.I.

Edited by taietel

Share this post


Link to post
Share on other sites

Posted

I'm definately interested because evidently I'm going to have to start creating a variable letter creation program...

I don't even know where to start but it almost looks like this will give me the answer. ;)

Share this post


Link to post
Share on other sites

Posted

wakillon, since you're the only one interested in this, PM if you want to receive updates of this activex. For now I'm occupied with relocation, but hopefully this does not last forever. ;)

M.I.

I'm not the only interested, it's because there are a lot of timid people on this forum ! Posted Image

And Number of downloads: 73, it's cool right !

Share this post


Link to post
Share on other sites

Posted (edited)

 Timid??? It's not the case! This can be solved!  ;)

I'm working in improving the dll and make the code more clean (I suck at that) and turn it into some kind of UDF.

Any suggestions are welcome! 

kaotkbliss, ask if anything is unclear!

M.I.

Edited by taietel

Share this post


Link to post
Share on other sites

Posted

I'm sure I will have a ton of questions as I begin my project. I need to wrap your code into a gui that will allow a user to merge a database with completely customizable text, page size, number of pages, images, etc. that will be used in creating pdfs.

So, I guess my first question, I see you have some of the more common page sizes available (A4, Legal, Letter, etc.) Could this be set up for a custom size?

Share this post


Link to post
Share on other sites

Posted

kaotkbliss, see the first post. Sorry for the late answer! It's my turn to cook!  ;)

I've deleted the old version and attached a new one. See the third page (it has custom dimensions) of the generated pdf.

Share this post


Link to post
Share on other sites

Posted

Sweet. Now I need to start getting everything together. I'm sure I will have many many more as I attempt to tackle this project.

Share this post


Link to post
Share on other sites

Posted (edited)

I've deleted the old version and attached a new one. See the third page (it has custom dimensions) of the generated pdf.

I wante to try your new version and i get an error...Posted Image

: ==> The requested action with this object has failed.:
.FormatPage = $FORMAT_A4
.FormatPage = $FORMAT_A4^ ERROR
->11:42:10 AutoIT3.exe ended.rc:1
+>11:42:11 AutoIt3Wrapper Finished
>Exit code: 1    Time: 1.528
Edited by wakillon

Share this post


Link to post
Share on other sites

Posted

wakillon, that's because I've changed it to allow custom pages. 

Change

.FormatPage = $FORMAT_A4

with

.FormatPage ($FORMAT_A4)

Look in the example, at the third page (it has different dimensions; the first two are A4).

M.I.

Share this post


Link to post
Share on other sites

Posted

wakillon, that's because I've changed it to allow custom pages.

Change

.FormatPage = $FORMAT_A4

with

.FormatPage ($FORMAT_A4)

Look in the example, at the third page (it has different dimensions; the first two are A4).

Could you update archive, because with archive script i get only 2 pages

and with the script link I get another error ...Posted Image

\createpdf\pdfAutoit.au3 (166) : ==> The requested action with this object has failed.:
.LoadAfm = @TempDir & "\Fonts"
.LoadAfm = @TempDir & "\Fonts"^ ERROR
->12:24:13 AutoIT3.exe ended.rc:1
+>12:24:14 AutoIt3Wrapper Finished

Share this post


Link to post
Share on other sites

Posted

wakillon, see the attachment in the first post (I've included all in the archive). 

M.I.

Share this post


Link to post
Share on other sites

Posted

wakillon, see the attachment in the first post (I've included all in the archive).

M.I.

Ah it's better, i see the 3 pages and the last with his big watermark , and no error ! Posted Image

How do you set the size of watermark ? i don't see parameters...

Thanks for all.

Share this post


Link to post
Share on other sites

Posted

Updated first post (see the screenshot of the first page). Now all the fonts are included in the script. 

wakillon, you can not change the watermark's parameters. Instead, you can replace it with a rotated, coloured etc text. 

M.I.

Share this post


Link to post
Share on other sites

Posted

Updated first post (see the screenshot of the first page). Now all the fonts are included in the script.

wakillon, you can not change the watermark's parameters. Instead, you can replace it with a rotated, coloured etc text.

M.I.

I'm unlucky, I download your last version ( with all embeded in the script ) and i get an error Posted Image

pdfAutoit.au3 (164) : ==> The requested action with this object has failed.:
.LoadAfm = @TempDir & "\Fonts"
.LoadAfm = @TempDir & "\Fonts"^ ERROR
->19:20:10 AutoIT3.exe ended.rc:1
+>19:20:11 AutoIt3Wrapper Finished

Share this post


Link to post
Share on other sites

Posted (edited)

Solved! My mistake. See the first post!

[EDIT] The problem was that I've modified the dll, but I forgot to change the old one in the script... Now it works well.

I'm working to include form elements (basic ones - inputbox, checkbox) , but this might take a while...

Edited by taietel

Share this post


Link to post
Share on other sites

Posted

Solved! My mistake. See the first post!

[EDIT] The problem was that I've modified the dll, but I forgot to change the old one in the script... Now it works well.

I'm working to include form elements (basic ones - inputbox, checkbox) , but this might take a while...

very unlucky...

pdfAutoit3\pdfAutoit.au3 (310) : ==> The requested action with this object has failed.:
.Cell ($text4, $mLeft, $mTop+335, $AreaW-$mLeft, 12, "")
.Cell ($text4, $mLeft, $mTop+335, $AreaW-$mLeft, 12, "")^ ERROR
->20:23:14 AutoIT3.exe ended.rc:1
+>20:23:15 AutoIt3Wrapper Finished

Share this post


Link to post
Share on other sites

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.