Re: [dev] RE: [api-dev] pdf import programmatically

2010-06-22 Thread TJ Frazier

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 +
From: tvata...@starxpert.fr
To: dev@openoffice.org
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 Teoshaun...@hotmail.com
À: dev@openoffice.org, d...@api.openoffice.org
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: shaun...@hotmail.com
To: dev@openoffice.org; d...@api.openoffice.org
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: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] RE: [api-dev] pdf import programmatically

2010-06-22 Thread Thibault Vataire
Hi,

You can find documentation about this here :
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options

But there is also an empiric way :
1- open the document from the GUI
2- read the FilterName and FilterOptions properties of the correspondent 
component. Use its getArgs() method to access these properties 
(http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XModel.html#getArgs).

T. Vataire




- Mail Original -
De: Wei Min Teo shaun...@hotmail.com
À: dev@openoffice.org
Envoyé: Mardi 22 Juin 2010 05:37:35
Objet: RE: [dev] RE: [api-dev] pdf import programmatically


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 +
 From: tvata...@starxpert.fr
 To: dev@openoffice.org
 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 shaun...@hotmail.com
 À: dev@openoffice.org, d...@api.openoffice.org
 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: shaun...@hotmail.com
  To: dev@openoffice.org; d...@api.openoffice.org
  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: dev-unsubscr...@openoffice.org
 For additional commands, e-mail: dev-h...@openoffice.org
 
  
_
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



RE: [dev] RE: [api-dev] pdf import programmatically

2010-06-21 Thread Wei Min Teo

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 +
 From: tvata...@starxpert.fr
 To: dev@openoffice.org
 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 shaun...@hotmail.com
 À: dev@openoffice.org, d...@api.openoffice.org
 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: shaun...@hotmail.com
  To: dev@openoffice.org; d...@api.openoffice.org
  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: dev-unsubscr...@openoffice.org
 For additional commands, e-mail: dev-h...@openoffice.org
 
  
_
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

Re: [dev] RE: [api-dev] pdf import programmatically

2010-06-17 Thread Thibault Vataire
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 shaun...@hotmail.com
À: dev@openoffice.org, d...@api.openoffice.org
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: shaun...@hotmail.com
 To: dev@openoffice.org; d...@api.openoffice.org
 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: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org