Jump to content

Create PDF from your application


taietel
 Share

Recommended Posts

Hi white8889

I'm afraid you can not, because I don't know/use/speak/write chinese (I'm to old for that Posted Image but not too old to play with AutoIt) and this version of activex was initial for my own projects, then I have decided to share. The fonts are read from within dll. 

M.I.

Link to comment
Share on other sites

  • 2 months later...

Stefano, as you read in one of my previous posts, the problem was when setting style to certain fonts.

Of course I can/will help you!

Here is the modified dll. I have tested it with all the fonts/styles available in this version; in the zip file there is a sample pdf resulted from this (see pages 3 and 4).

Sorry for the delay, but I'm a little busy for the moment and tired also. :graduated:

M.I.

[Edit] *typo

[Edit] Attachment moved to first post

Edited by taietel
Link to comment
Share on other sites

  • 5 months later...

Any progress on this great piece of work?

Also, where can I find more info about your dll? I have created a

sort of UDF for personal use, but I still need more info about the

functionality of this script, especially table creation / formatting.

Link to comment
Share on other sites

Hi

Im on windows 7 X64 and everytime i try to use this it keeps saying that it cannot register the dll. Ive tried going to the temp dir and deleting the fonts and the dll and trying again but no joy

jamie

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

engjcowi, have you compiled your script for x32 or x64 architecture?

Try to compile for x32. The activex was intended for x32, since I use only that.

#AutoIt3Wrapper_UseX64=n

dmob, the info about the dll is not available for the moment.

I've updated the ActiveX for not using the external fonts and I will post it as soon as possible (still needs some testing).

Regards,

taietel

Link to comment
Share on other sites

FriendsFade,

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Gui = GUICreate("Convert2au3",  200, 94, @DesktopWidth - 220, @DesktopHeight - 130, BitOR($WS_POPUP,$WS_BORDER), BitOR($WS_EX_ACCEPTFILES,$WS_EX_TOOLWINDOW))
GUISetBkColor(0x000000)
WinSetOnTop($Gui,"",1)
$Input1 = GUICtrlCreateLabel('', 0, 0, 200, 94)
GUICtrlSetState(-1, 136)
GUICtrlCreateLabel ("Drag your file here...", 10,10,180,17,$SS_CENTER, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetColor(-1, 0xFFCC00)
$StatusBar=GUICtrlCreateLabel (@CRLF&@CRLF&'', 10,30,180,57,$SS_CENTER, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetColor(-1, 0xFFFF00)
WinSetTrans($Gui,"",220)
GUISetState ()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = -13
                $filename=StringRegExp(@GUI_DRAGFILE,'(^.*)\\(.*)\.(.*)',3)
                GUICtrlSetData($StatusBar, 'Reading file '&$filename[1]&'.'&$filename[2]&' ...')
                ConsoleWrite($filename[0]&@CRLF)
                $ScrBin='Local $sData=''0x'''&@CRLF
                $file = FileOpen(@GUI_DRAGFILE, 16)
                While 1
                    $Bin = FileRead($file, 512)
                    If @error = -1 Then ExitLoop
                    $ScrBin&='$sData&='''&StringTrimLeft($Bin,2)&''''&@CRLF
                    Sleep(1)
                WEnd
                FileClose($file)

                GUICtrlSetData($StatusBar, 'Transforming file '&$filename[1]&'.'&$filename[2]&' ...')
                Sleep(1000)
                $Output = $filename[0] & '\Inc_'
                $i = 1
                While FileExists($Output & $i & '_'&$filename[1]&'.au3')
                    $i += 1
                WEnd
                $Output = $Output & $i & '_'&$filename[1]&'.au3'

                $file = FileOpen($Output,2)
                FileWrite($file, 'Func _IncludeFile($sPath="")'&@CRLF&$ScrBin&@CRLF& _
                'If $sPath="" Then $sPath=@TempDir'&@CRLF&'$sData=Binary($sData)'&@CRLF& _
                @TAB&'$f=$sPath&"\'&$filename[1]&'.'&$filename[2]&'"'&@CRLF& _
                @TAB&'If Not FileExists($sPath&"\'&$filename[1]&'.'&$filename[2]&'") Then'&@CRLF& _
                @TAB&@TAB&'$file=FileOpen($f,18)'&@CRLF& _
                @TAB&@TAB&'FileWrite($file,$sData)'&@CRLF& _
                @TAB&@TAB&'FileClose($file)'&@CRLF&@TAB&'EndIf'&@CRLF&@TAB&'Return $f'&@CRLF&"EndFunc")
                FileClose($file)
                GUICtrlSetData($StatusBar, 'Done! File Inc_'& $i & '_'&$filename[1]&'.au3 was created!')
                Sleep(3000)
                Exit
            Case $msg = -3
                Exit
        EndSelect
    WEnd

dmob, when I get back home.

Regards,

taietel

[edit] bad formating

Edited by taietel
Link to comment
Share on other sites

engjcowi, have you compiled your script for x32 or x64 architecture?

Try to compile for x32. The activex was intended for x32, since I use only that.

#AutoIt3Wrapper_UseX64=n

dmob, the info about the dll is not available for the moment.

I've updated the ActiveX for not using the external fonts and I will post it as soon as possible (still needs some testing).

Regards,

taietel

Hi

Thanks for your help. ive added the above and still says cannot register. when i get more time im gonna try to register the dll manually

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

engjcowi, when I ran the application in windows 7 (32 bit), it can not register the activex as long as I run it as admin. On windows 7 (x64), the script will register the ActiveX if it is compiled as 32 bit application. The script, as it is now, tries to register the activex with the x64 version of the regsvr32 (that one from System32). Change the path to %systemroot%\SysWoW64\regsvr32.exe (see this article) in the script and I think it will solve your problem.

Regards,

taietel

Link to comment
Share on other sites

Hi !

Got this error when running pdfAutoit.au3

+>15:51:08 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:040C  Keyboard:0000040C  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
+>15:51:08 AU3Check ended.rc:0
>Running:(3.3.6.1):C:\Program Files\AutoIt3\autoit3.exe "E:\_Downloads\pdfAutoit\pdfAutoit.au3"    
E:\_Downloads\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
->15:51:11 AutoIT3.exe ended.rc:1
>Exit code: 1    Time: 3.927
Link to comment
Share on other sites

Hi Taietel,

Thanks for this master piece

I have no luck adding an image to a PDF with .Image

Which image formats are supported ? I've tried gif and png both with no luck

*** Edit : jpg works ***

Thanks

Best regards,

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

  • 2 weeks later...

 If you want to output pdf's from your application, you can use this ActiveX DLL (embeded in the script). It's small and very easy to use. Here is a screenshot of the first page generated by the example. 

Posted Image

First, unpack the Fonts directory in the scriptdir (if you put it in another location, replace the path in the script). 

[EDIT] Deleted old version (165 downloads) and uploaded new one*

           *all included in the au3 

Love it

Works greate except the pdf file created causes an Arial-Bold BBox error when opening.

Last file I downloaded had Helvetica-Italin BBox error.

Fixing it would be greatly appreciated.

StuffByDennis

Link to comment
Share on other sites

@StuffByDennis

If you don't use these fonts, just remove the code which is causing the problem, thats what i did.

Or search the internet and download the files and recreate them with the code -> second post on page 6.

I believe this code is based on

Basicly this embedding is useless because it isn't used as it supposed to be.. because the files are saved. I would prefer to use the

Best regards,Emiel Wieldraaijer

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...