Hi, Wei Min Teo,
The rest is bottom-posted.

On 6/21/2010 23:37, Wei Min Teo wrote:

Hi Thibault Vataire,



Thanks. I think this seem like it should work. It was suggested by cor nouws 
too.



The problem with these filter fields or other properties is that i can't seem 
to find any documentation as to what strings it accepts.



Thanks again

Date: Thu, 17 Jun 2010 09:15:09 +0000
From: [email protected]
To: [email protected]
Subject: Re: [dev] RE: [api-dev] pdf import programmatically

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

The documentation for a filter should be available as a specification, or possibly in the Developers' Guide, but these are not always easy to find; they may not exist.

However, if you can successfully open a particular type of file by hand, through the GUI, then you can find those specific settings easily: look in the file! :-)

There are tools - the BASIC IDE is one - for inspecting an open file. If I recall correctly, you need to find the Media Descriptor. It will have the parameter names and value strings, including the filter name, formatted exactly as you should use them.

--
/tj/


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to