Jump to content

PDF document


Recommended Posts

Is there any function in Autoit , or application made to convert text files to PDF format , with images ?

HI,

I dont't think so. Txt-Files with images?

What about PDF-Writer?

I think there are several free tools doing that job.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

That is cool - but it only allows txt unless I missed the inport function - I also tried to clip a print screen and paste, but it was greyed out. Anyone know how to import a PIC?

2¢

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Hi,

There is a site which tells of Open Office conversions to pdf, which would do what you want, I think;

OOO conversion formats

There is a COM handling au3 script available on the forum showing how to put XLS into pdf using OOO;

OOOXML

File Conversion through OpenOffice, Convert Spreadsheets to HTML or PDF

Try that? [have to intall ooo first, of course....]

Best, randall

Edited by randallc
Link to comment
Share on other sites

Hi,

There is a site which tells of Open Office conversions to pdf, which would do what you want, I think;

OOO conversion formats

There is a COM handling au3 script available on the forum showing how to put XLS into pdf using OOO;

OOOXMLTry that? [have to intall ooo first, of course....]

Best, randall

Randall !

It was a good idea .....

The script works from a command line .....

What i want to do is to convert text/doc files to PDF using objcs and autoit.

forex, i Can open /convert text/doc files to Html with autoit ...

Is There a short way to convert Html to Pdf ? EXample please

Link to comment
Share on other sites

I use Virtual PDF Printer.

It adds a virtual printer to your PC, so when you "print" with that printer, it saves it as a PDF file.

http://www.go2pdf.com/

#)

Link to comment
Share on other sites

Hi,

Here is a [was working at the time...] script I wrote without command line; takes xls file to pdf inside autoit; I imagine you could do the same with an html file, but I don't have ooo installed at present to test it.

Office97 is free at present in beta till February, so you could do object commands with that too.

Best, randall

;OOOxml.au3
;http://www.oooforum.org/forum/viewtopic.phtml?p=73715&highlight=filters#73715
#include <Array.au3>
Dim $ServiceManager
Dim $Desktop
$s_FileXLname=@ScriptDir&"\book1.xls"
;ConvertOOo($cmdline[1])
ConvertOOo($s_FileXLname)
MsgBox(0,"", "Conversion Complete")
Exit
Func ConvertOOo($fn)
    Local $args, $oDoc, $cURL, $cURL, $oSave
    If $fn = "" Then
        MsgBox(0, "", "No Filename Specified")
        Return
    EndIf
    $ServiceManager = ObjCreate("com.sun.star.ServiceManager")
    $Desktop = $ServiceManager.createInstance("com.sun.star.frame.Desktop")
    $cURL = Convert2URL($fn)
    $args = _ArrayCreate(MakePropertyValue("ReadOnly", True),  _
            MakePropertyValue("Password", "secret"),  _
            MakePropertyValue("Hidden", True))
    $oDoc = $Desktop.loadComponentFromURL( $cURL, "_blank", 0, $args)
    ;$oSave = _ArrayCreate(MakePropertyValue("FilterName", "HTML (StarCalc)"))
    ;$cURL = StringLeft($cURL, StringLen($cURL) - 4) & ".html"
    $oSave = _ArrayCreate(MakePropertyValue("FilterName", "calc_pdf_Export"))
    $cURL = StringLeft($cURL, StringLen($cURL) - 4) & ".pdf"
    $oDoc.storeToURL( $cURL, $oSave)
    $oDoc.close(True)
EndFunc   ;==>ConvertOOo
Func MakePropertyValue( $cName, $uValue)
    Local $Pstruc
    $Pstruc = $ServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
    $Pstruc.Name = $cName
    $Pstruc.Value = $uValue
    Return $Pstruc
EndFunc   ;==>MakePropertyValue
Func Convert2URL($fname)
    $fname = StringReplace($fname, ":", "|")
    $fname = StringReplace($fname, " ", "%20")
    $fname = "file:///" & StringReplace($fname, "\", "/")
    Return $fname
EndFunc   ;==>Convert2URL

PS - it works with html to pdf , but

1. Opens OOO

2. gives "error" when shuts down with ooo2;

let me know if yoiu rtesearch it and fix it.

Best, Randall

Edited by randallc
Link to comment
Share on other sites

Hi,

Here is a [was working at the time...] script I wrote without command line; takes xls file to pdf inside autoit; I imagine you could do the same with an html file, but I don't have ooo installed at present to test it.

Office97 is free at present in beta till February, so you could do object commands with that too.

Best, randall

;OOOxml.au3
;http://www.oooforum.org/forum/viewtopic.phtml?p=73715&highlight=filters#73715
#include <Array.au3>
Dim $ServiceManager
Dim $Desktop
$s_FileXLname=@ScriptDir&"\book1.xls"
;ConvertOOo($cmdline[1])
ConvertOOo($s_FileXLname)
MsgBox(0,"", "Conversion Complete")
Exit
Func ConvertOOo($fn)
    Local $args, $oDoc, $cURL, $cURL, $oSave
    If $fn = "" Then
        MsgBox(0, "", "No Filename Specified")
        Return
    EndIf
    $ServiceManager = ObjCreate("com.sun.star.ServiceManager")
    $Desktop = $ServiceManager.createInstance("com.sun.star.frame.Desktop")
    $cURL = Convert2URL($fn)
    $args = _ArrayCreate(MakePropertyValue("ReadOnly", True),  _
            MakePropertyValue("Password", "secret"),  _
            MakePropertyValue("Hidden", True))
    $oDoc = $Desktop.loadComponentFromURL( $cURL, "_blank", 0, $args)
    ;$oSave = _ArrayCreate(MakePropertyValue("FilterName", "HTML (StarCalc)"))
    ;$cURL = StringLeft($cURL, StringLen($cURL) - 4) & ".html"
    $oSave = _ArrayCreate(MakePropertyValue("FilterName", "calc_pdf_Export"))
    $cURL = StringLeft($cURL, StringLen($cURL) - 4) & ".pdf"
    $oDoc.storeToURL( $cURL, $oSave)
    $oDoc.close(True)
EndFunc   ;==>ConvertOOo
Func MakePropertyValue( $cName, $uValue)
    Local $Pstruc
    $Pstruc = $ServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
    $Pstruc.Name = $cName
    $Pstruc.Value = $uValue
    Return $Pstruc
EndFunc   ;==>MakePropertyValue
Func Convert2URL($fname)
    $fname = StringReplace($fname, ":", "|")
    $fname = StringReplace($fname, " ", "%20")
    $fname = "file:///" & StringReplace($fname, "\", "/")
    Return $fname
EndFunc   ;==>Convert2URL

PS - it works with html to pdf , but

1. Opens OOO

2. gives "error" when shuts down with ooo2;

let me know if yoiu rtesearch it and fix it.

Best, Randall

Randall !

It was a good idea to use the ooo . I reinstalled the ooo writer and testd to run your Script ,

but i am geting error on line 23 .

error: the requested action with this object has failed .

Link to comment
Share on other sites

Hi,

Not sure its worth it unles you think you can fix the script;

but I added SDK install as well from the download site;

have you done that?

You need to download the program. I would get the full package and also the SDK if you plan on doing any programming wit

WFCBest, randall
Link to comment
Share on other sites

  • 2 weeks later...

Hi,

Not sure its worth it unles you think you can fix the script;

but I added SDK install as well from the download site;

have you done that?

WFCBest, randall

Hi Randall !

I have downloaded everything including the SDK , ant tried to run your Example which converts the Excel file to PDF ..... not working for me ......

I Wanted to develop the script using your script as a base .

suggestions to make the script work ?

I have the current version of autoit 3.2 !

Link to comment
Share on other sites

Hi,

I would like to use it too, but have not researched it any further;

I'm surprised if nothing happened, but it never worked properly for me; did you try to PM WFC as he was looking at it?.. or research ooo groups?

Sorry,

Best,randall

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