Hi,
To open you document programmatically, you can do that :
sub main
dim xComp as object
dim args(0) as new com.sun.star.beans.PropertyValue
args(0).name = "FilterName"
args(0).value = "draw_pdf_import"
xComp =
starDesktop.loadComponentFromUrl(convertToUrl("/home/tvataire/Bureau/resultat.pdf"),
"_blank", com.sun.star.frame.FrameSearchFlag.CREATE, args)
end sub
This works on a pdf document previously created with Writer.
I'm working with OOo 3.2 on Ubuntu.
Regards,
Thibault Vataire
----- Mail Original -----
De: "Wei Min Teo" <[email protected]>
À: [email protected], [email protected]
Envoyé: Jeudi 17 Juin 2010 04:34:36
Objet: [dev] RE: [api-dev] pdf import programmatically
Hi,
Can anyone help me on this? Is there a way to force a document to open with
draw programmatically?
> From: [email protected]
> To: [email protected]; [email protected]
> Date: Mon, 7 Jun 2010 15:32:58 +0800
> Subject: [api-dev] pdf import programmatically
>
>
> Hi all,
>
>
>
> I am trying import pdf files to edit. I've installed the sun pdf import with
> openoffice 3.1. Pdf files seem to open fine in draw when i open it from the
> desktop.
>
>
>
> However, when i use the loadComponentFromURL method, it opens the file with
> writer and encoded text appears. I've also tried passing in "MediaType" in
> the mediadescriptor with the value of "simpress8" but it doesn't work.
>
>
>
> How can i programmatically force it to open with draw and return a XComponent
> object?
>
>
>
> Thanks.
>
>
>
> Cheers,
>
>
>
> Wei Min
>
> _________________________________________________________________
> Hotmail: Trusted email with powerful SPAM protection.
> https://signup.live.com/signup.aspx?id=60969
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]