Jump to content

Create PDF from your application


taietel
 Share

Recommended Posts

Wakillon, delete the Fonts directory from the Temp directory and run the script from the first post again!

[EDIT]I've had the same problem, and I realized that it was font-related

Tell me if it's working now!

Edited by taietel
Link to comment
Share on other sites

Wakillon, delete the Fonts directory from the Temp directory and run the script from the first post again!

[EDIT]I've had the same problem, and I realized that it was font-related

Tell me if it's working now!

I re download script , delete font folder in temp directory and...

pdfAutoit\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:36:04 AutoIT3.exe ended.rc:1
+>20:36:05 AutoIt3Wrapper Finished
>Exit code: 1    Time: 2.140

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Delete also the MPDF.dll from the temp directory! The script extract this dll in the temp dir and, if the script is runned again, it will not overwrite the dll!

That's because I don't want to extract it every time I write a pdf. 

Write back if it's ok now!

Edited by taietel
Link to comment
Share on other sites

Delete also the MPDF.dll from the temp directory! The script extract this dll in the temp dir and, if the script is runned again, it will not overwrite the dll!

That's because I don't want to extract it every time I write a pdf.

Write back if it's ok now!

I do what you say but...

pdfAutoit\pdfAutoit.au3 (543) : ==> The requested action with this object has failed.:
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10)
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10)^ ERROR
->20:44:56 AutoIT3.exe ended.rc:1
+>20:44:57 AutoIt3Wrapper Finished
>Exit code: 1    Time: 2.641

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

I have no problems!

If you have followed the steps I've wrote you above,

     1. Delete the %Temp%\Fonts

     2. Delete %Temp%\MPDF.dll

     3. Run the script from first post

then you should not have any problems too!

  ;)

[EDIT] If somebody else tried this, please post if you had problems!

Also if you had none!  :)

Edited by taietel
Link to comment
Share on other sites

I have no problems!

If you have followed the steps I've wrote you above,

1. Delete the %Temp%\Fonts

2. Delete %Temp%\MPDF.dll

3. Run the script from first post

then you should not have any problems too!

I'm very sorry but i delete font, dll, re run script...Posted Image

pdfAutoit\pdfAutoit.au3 (543) : ==> The requested action with this object has failed.:
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10)
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10)^ ERROR
->21:03:24 AutoIT3.exe ended.rc:1
+>21:03:24 AutoIt3Wrapper Finished
>Exit code: 1    Time: 2.632

I have retry the version with 3 pages and it works well, but not the last...

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Change this

.Cell ($sText, $C[1], $C[2]+5, $C[3], 10)

to this

.Cell ($sText, $C[1], $C[2]+5, $C[3], 10, " ")

i delete font, dll and...

pdfAutoit\pdfAutoit.au3 (543) : ==> The requested action with this object has failed.:
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10, " ")
.Cell ($sText, $C[1], $C[2]+5, $C[3], 10, " ")^ ERROR
->21:12:07 AutoIT3.exe ended.rc:1
+>21:12:08 AutoIt3Wrapper Finished
>Exit code: 1    Time: 2.637

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Line 543 is within the function _CellTableText and is called by the lines 318-322. Post these lines. Try to uncomment them first and run the script.

Link to comment
Share on other sites

Line 543 is within the function _CellTableText and is called by the lines 318-322. Post these lines. Try to uncomment them first and run the script.

lines 318-322

_CellTableText($tabel,1,1,"User")
    _CellTableText($tabel,1,2,"Password")
    _CellTableText($tabel,2,1,"nevermind",$ALIGN_LEFT,8,0x0000FF,$FONT_COURIER)
    _CellTableText($tabel,2,2,"887sdfnvs8",$ALIGN_LEFT,8,0xFF0000,$FONT_COURIER)

Where do you see comment ?

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Sorry, I meant "comment" these lines! I'm trying to stop smoking and it's killing me!

[EDIT] This is a function I've made to write text in cells. _DrawTable() returns an array with every cell's coordonates (x,y,w,h). h is optional, since cell is expanded dynamically to bottom, according to text length. I'll double check it.

[EDIT] wakillon, I've checked and it's ok! What SO do you have? I'm on XP Pro sp3, 32bit

Edited by taietel
Link to comment
Share on other sites

Sorry, I meant "comment" these lines! I'm trying to stop smoking and it's killing me!

[EDIT] This is a function I've made to write text in cells. _DrawTable() returns an array with every cell's coordonates (x,y,w,h). h is optional, since cell is expanded dynamically to bottom, according to text length. I'll double check it.

[EDIT] wakillon, I've checked and it's ok! What SO do you have? I'm on XP Pro sp3, 32bit

Hi taietel ! Posted Image

I'm on XP Pro sp3 32bit too

I have retry today ( deleting font and dll... ) but same error...

Perhaps I'm not alone in this case...

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

wakillon, have you tried to comment lines 318 to 322? Try this and tell me if it's ok!

M.I.

[EDIT] If anyone has the same problem, please reply

Edited by taietel
Link to comment
Share on other sites

wakillon, have you tried to comment lines 318 to 322? Try this and tell me if it's ok!

M.I.

[EDIT] If anyone has the same problem, please reply

Google translate give me "Avez-vous essayé de commenter les lignes 318 à 322" so i don't understand ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Script fails here using Win7 Pro:

If Not IsObj($obj) Then

MsgBox (0,"ERROR!","Can not register MPDF.dll...")

Exit

This line is failing:

Global $obj = ObjCreate("MPDFX.MPDF")

Where is the activeX object from?

Ok, i'm new to Win7, #requireadmin fixed it after deleting the dll.

Link to comment
Share on other sites

Hi taietel

Great script, especially like the technique of embedding the DLL - Well Done!

Now for the silly noobie question.. ;)

However, I'm somewhat stumped on exactly how one uses this. I've run the script as is and as expected, the example page has been created. But how do I generate my own page? Is there anyway I can use this create a PDF creation service? I have a requirement where I'd like to take an RTF document and convert it to a PDF.

Thanks

Link to comment
Share on other sites

IndyUK, sorry for answering so late.

If you want to generate your own page, see the example (accessing the MPDF object). You can not transform an RTF to PDF with this. What you can do (I actually use it for this) is, for example, to make a GUI with input boxes that user has to fill them, then, when he/she pushes a button, it outputs the report/form/application in pdf format. Or various tests randomly picked from a list, then converted to pdf after user has given the answers. Or ... there are a lot of possibilities!

If you want to convert RTF to PDF, you can use a PDF printer, or Office suite (Open Office has directly, MS Office > 2007 has on the menu - Save As -> PDF).

M.I.

Link to comment
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
 Share

  • Recently Browsing   0 members

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