a question of Export custom file format?

2012-06-07 Thread jianlizhao
Hi 

My os is ms windows.
I write a extention.
In my  extention how can I get openoffice program path.
I want to  Dynamic loading some dll.
Who can tell me get the  path method?

My programming language use C++.

Best regards.



Re: a question of Export custom file format?

2012-06-07 Thread Oliver Brinzing
Hi,

 I write a extention.
 In my  extention how can I get openoffice program path.

Sub Test
Dim oService as Object
oService = CreateUnoService(com.sun.star.util.PathSubstitution)
' see 
http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/PathSubstitution.html
 for details
MsgBox oService.getSubstituteVariableValue(inst)

' get your Extension Path
' 
http://www.openoffice.org/api/docs/common/ref/com/sun/star/deployment/PackageInformationProvider.html
oService =
getDefaultContext().getByName(/singletons/com.sun.star.deployment.PackageInformationProvider)
MsgBox oService. getPackageLocation(my.extension.identifier)
End Sub


Regards

Oliver

-- 

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45





signature.asc
Description: OpenPGP digital signature


Re: a question of Export custom file format?

2012-06-07 Thread Armin Le Grand

Hi ,

On 07.06.2012 02:24,  wrote:

hi Armin

  can i modify the SDK to achieve my need.


Not the SDK, but the UNO API definition and imlementation for primitives.

You could do that in principle, but it is a lot of work and requires 
knowing the UNO API and it's principles, Primitives and their 
principles, some of the AOO code and it's functionalities and a lot of 
AOO-specific data types and how to handle them over the API. It also is 
a region where first design and then open discussion will be needed to 
guarantee a good API design; it would be intended to be used by everyone 
and (in principle) should never need to be changed (and needs to stay 
backward compatible from there on since it would be a public API).



  achieve  demo code as below:


  Reference  XRenderable  xRenderable( mxSrcDoc, UNO_QUERY )
VCLXDevice* pXDevice = new VCLXDevice;
..
PDFWriter*  pPDFWriter = new PDFWriter(
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI), PDFWriter::PDF_1_4,
eCompressMode );
OutputDevice*  pOut = pPDFWriter-GetReferenceDevice();
pXDevice-SetOutputDevice( pOut );
..
GDIMetaFile aMtf;
const MapMode   aMapMode( MAP_100TH_MM );
const Size  aMtfSize( aPageSize.Width, aPageSize.Height );

pOut-Push();
pOut-EnableOutput( FALSE );
pOut-SetMapMode( aMapMode );

aMtf.SetPrefSize( aMtfSize );
aMtf.SetPrefMapMode( aMapMode );
aMtf.Record( pOut );

xRenderable-render( nSel - 1, aSelection, aRenderOptions );
aMtf.Stop();
aMtf.WindStart();

if( aMtf.GetActionCount() )
 bRet = ImplExportPage( *pPDFWriter, aMtf, nCompressMode ) || bRet;

pOut-Pop();

just provide the output of the VCL. To meet my needs.
  If this idea can be.
How do I do?

Regards

On 06.06.2012 12:23,  wrote:

hi  Armin

 could you give me  a example of  use your Way doing a new
exporter, assuming that the file format is pdf?


It would be more or less the same as every UNO API based export, iterate
over the document, the pages and the shapes. Instead of getting a
MetaFile from the shape (using Graphicxporter) you would get the
sequence of primitives and use that as base geometry information.

You cannot use this when you want to develop an extension, the UNO API
for primitives is minimal currently and thus you would have to link
against office components (what the definition of extension does not
allow). To do this, the most needed primitives would need to get an UNO
API implementation first.


   Regards


Sincerely,
Armin
--
ALG



/:includetail


Sincerely,
Armin
--
ALG



Re: a question of Export custom file format?

2012-06-07 Thread Rony G. Flatscher (Apache)

On 07.06.2012 18:02, Oliver Brinzing wrote:
 Hi,

 I write a extention.
 In my  extention how can I get openoffice program path.
 Sub Test
   Dim oService as Object
   oService = CreateUnoService(com.sun.star.util.PathSubstitution)
   ' see 
 http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/PathSubstitution.html
  for details
   MsgBox oService.getSubstituteVariableValue(inst)

   ' get your Extension Path
   ' 
 http://www.openoffice.org/api/docs/common/ref/com/sun/star/deployment/PackageInformationProvider.html
   oService =
 getDefaultContext().getByName(/singletons/com.sun.star.deployment.PackageInformationProvider)
   MsgBox oService. getPackageLocation(my.extension.identifier)
 End Sub


 Regards

 Oliver


Here is an example (ooRexx, listPathSettings.rxo) which lists all path 
settings available in AOO
to .stdout:

xContext = UNO.connect()-- connect to server and retrieve the 
XContext object
XMcf = xContext~getServiceManager   -- retrieve XMultiComponentFactory

oPathSettings=XMcf~createInstanceWithContext(com.sun.star.util.PathSettings, 
xContext)
xpaths=oPathSettings~XPropertySet   -- get XPropertySet interface
paths=xpaths~getPropertySetInfo~getProperties   -- get the sequence of 
properties

do i=1 to paths~items   -- iterate over all properties (all 
path names)
   name=paths[i]~name   -- get the Property's name
   call printPathSetting i, name, xpaths~getPropertyValue(name) -- display 
on .stdout
end

-- end of program, start of directives (each led in by two colons '::')
::requires UNO.CLS   -- get the UNO/OOo support, which itself gets the Java 
support

::routine printPathSetting/* print the PathSetting name with its 
value(s) */
  use arg i, name, propValue

  tmpStr=i~right(3): pp(name)

  resArr=processPathUrls(propValue) -- returns array
  say tmpStr || detTabs(tmpStr) pp(resArr[1])
  do k=2 to resArr~items
 say 090909x pp(resArr[k])
  end

  return


detTabs: procedure /* determine indentation, depends on length of path name 
*/
  parse arg string

  len=length(string)
  if  len8  then return 090909x -- three tabs
  else if len16 then return 0909x   -- two tabs
  else if len24 then return 09x -- one tab
  elsereturn -- no tab (empty string)

 
   /* take care of special case that multiple paths are encoded in a single
  value (instead of defining them as an array of java.lang.String;
  the URL-style will delimit different paths with the semi-colon char 
(;)
  on all platforms; will return a Rexx array of strings representing the
  defined URLs rendered to the operating system's file system 
representation. */
processPathUrls: procedure
   use arg propValue

   resArr=.array~new

   if propValue~string~left(18)==[Ljava.lang.String then -- a String 
array in hand
   do
  if propValue~items=0 then -- empty array
 resArr~append()
  else
  do k=1 to propValue~items
 resArr~appendAll(convertPathUrl(propValue[k])) 
  end
   end
   else -- value is a string already 
(representing single path)
   do
  resArr~appendAll(convertPathUrl(propValue))
   end
   return resArr


   /* parse string, could be that more than one path is encoded and 
delimited by semi-colon,
  return an array of converted strings */
convertPathUrl: procedure
   parse arg str

   arr=.array~new
   if str= then   -- path is explicitly an empty string
  arr~append(str)
   else
   do while str
  parse var str before ; str -- parse using ; as delimiter
  arr~append(uno.convertFromUrl(before)) -- turn URL into opsys' path 
notation
   end
   return arr

You'll get the idea looking at the code, such that you can map it to your 
preferred programming
language.

---rony



Re: a question of Export custom file format?

2012-06-07 Thread Rony G. Flatscher

On 07.06.2012 18:02, Oliver Brinzing wrote:
 Hi,

 I write a extention.
 In my  extention how can I get openoffice program path.
 Sub Test
   Dim oService as Object
   oService = CreateUnoService(com.sun.star.util.PathSubstitution)
   ' see 
 http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/PathSubstitution.html
  for details
   MsgBox oService.getSubstituteVariableValue(inst)

   ' get your Extension Path
   ' 
 http://www.openoffice.org/api/docs/common/ref/com/sun/star/deployment/PackageInformationProvider.html
   oService =
 getDefaultContext().getByName(/singletons/com.sun.star.deployment.PackageInformationProvider)
   MsgBox oService. getPackageLocation(my.extension.identifier)
 End Sub


 Regards

 Oliver


Here is an example (ooRexx, listPathSettings.rxo) which lists all path 
settings available in AOO
to .stdout:

xContext = UNO.connect()-- connect to server and retrieve the 
XContext object
XMcf = xContext~getServiceManager   -- retrieve XMultiComponentFactory

oPathSettings=XMcf~createInstanceWithContext(com.sun.star.util.PathSettings, 
xContext)
xpaths=oPathSettings~XPropertySet   -- get XPropertySet interface
paths=xpaths~getPropertySetInfo~getProperties   -- get the sequence of 
properties

do i=1 to paths~items   -- iterate over all properties (all 
path names)
   name=paths[i]~name   -- get the Property's name
   call printPathSetting i, name, xpaths~getPropertyValue(name) -- display 
on .stdout
end

-- end of program, start of directives (each led in by two colons '::')
::requires UNO.CLS   -- get the UNO/OOo support, which itself gets the Java 
support

::routine printPathSetting/* print the PathSetting name with its 
value(s) */
  use arg i, name, propValue

  tmpStr=i~right(3): pp(name)

  resArr=processPathUrls(propValue) -- returns array
  say tmpStr || detTabs(tmpStr) pp(resArr[1])
  do k=2 to resArr~items
 say 090909x pp(resArr[k])
  end

  return


detTabs: procedure /* determine indentation, depends on length of path name 
*/
  parse arg string

  len=length(string)
  if  len8  then return 090909x -- three tabs
  else if len16 then return 0909x   -- two tabs
  else if len24 then return 09x -- one tab
  elsereturn -- no tab (empty string)

 
   /* take care of special case that multiple paths are encoded in a single
  value (instead of defining them as an array of java.lang.String;
  the URL-style will delimit different paths with the semi-colon char 
(;)
  on all platforms; will return a Rexx array of strings representing the
  defined URLs rendered to the operating system's file system 
representation. */
processPathUrls: procedure
   use arg propValue

   resArr=.array~new

   if propValue~string~left(18)==[Ljava.lang.String then -- a String 
array in hand
   do
  if propValue~items=0 then -- empty array
 resArr~append()
  else
  do k=1 to propValue~items
 resArr~appendAll(convertPathUrl(propValue[k])) 
  end
   end
   else -- value is a string already 
(representing single path)
   do
  resArr~appendAll(convertPathUrl(propValue))
   end
   return resArr


   /* parse string, could be that more than one path is encoded and 
delimited by semi-colon,
  return an array of converted strings */
convertPathUrl: procedure
   parse arg str

   arr=.array~new
   if str= then   -- path is explicitly an empty string
  arr~append(str)
   else
   do while str
  parse var str before ; str -- parse using ; as delimiter
  arr~append(uno.convertFromUrl(before)) -- turn URL into opsys' path 
notation
   end
   return arr

You'll get the idea looking at the code, such that you can map it to your 
preferred programming
language.

---rony



Re: a question of Export custom file format?

2012-06-06 Thread Armin Le Grand

Hi  (had to copy-paste, cannot read, hope it's correct)

On 06.06.2012 06:23,  wrote:

HI:

I need to develop an extension program of openoffice's write,
the extended function is export a custom file format
, the file format similar as PDF file format ,
But not the PDF file format.

I analyzed the export of PDF files ,the Function  through VCL output.
I have two question as below:

1)Such  need can be achieved in extension of openoffice's write?


Yes, when You use the UNO API. This means to get the document, iterate 
over pages and objects and export them.



2) Can I use
calss VirtualDevice
calss GDIMetaFile
interface---   ReferenceXRenderable  xRenderable (mxSrcDoc, UNO_QUERY)
in openoffice's write?


I do not know too much from it by heart, but a starting point is to get 
the document as handle.
More important: Using VirtualDevice and GDIMetaFile will work, but is 
somehow the older way to do things. With the current state of the core i 
would suggest to use primitives for SdrObjects when you need to export 
graphical representations (as in PDF export, and not the model data as 
in PPT export). Primitives give you all the geometry data in double 
precision and in a tree structure with some automatisms. For each 
SdrObject you may get a sequence of primitives (over UNO API from 
xShape). Examples how to proccess them can be found in 
drawinglayer/source/processor2d. E.g. vclmetafileprocessor2d is the 
instance which currently is used in the core to create GDIMetaFiles from 
primitives (these are not created from 'painting' SdrObjects since some 
time, this already shows that primitives contain more information than 
the GDIMetaFIles). Or e.g. vclpixelprocessor2d is the current renderer 
for pixel output (screen display).
In principle all exporters using geometry information as base data 
can/should be rewritten to use primitives. Thus, when doing a new 
exporter, I would recommend using them from the beginning.
To see how to get primitives from xShape grep for XPrimitiveFactory2D 
and createPrimitivesFromXShape.


HTH!
Sincerely,
Armin
--
ALG



Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 12:23:44PM +0800, 蜗牛 wrote:
 HI:
  
 I need to develop an extension program of openoffice's write, 
 the extended function is export a custom file format
 , the file format similar as PDF file format ,
 But not the PDF file format.
  
 I analyzed the export of PDF files ,the Function  through VCL output.
 I have two question as below:
  
 1)Such  need can be achieved in extension of openoffice's write?

Export/Import filters can be developed as UNO components and deployed in
extensions:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Integrating_Import_and_Export_Filters

 2) Can I use calss VirtualDevice calss GDIMetaFile interface---
 Reference XRenderable xRenderable (mxSrcDoc, UNO_QUERY) in
 openoffice's write?

No, you cannot use this classes if you are developing an *extension*.
Extensions are only allowed to link against URE libraries, not the core
application libraries. This means, in an extension you can only use the
API as described in its reference
http://www.openoffice.org/api/docs/common/ref/com/sun/star/module-ix.html
and in the Developers Guide
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide

That said, I'm not sure what your trying to achieve; are you willing
to develop an extension, or planning to hack on the core source code?

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgpzG1vLL49yd.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
hi Ariel 
  
 I am  trying to achieve; 
 develop an extension .
  
  
 can vcl  module not give interface?
  
 I rember kde plugin use vcl module ?
  
 thanks
  
 Regards

Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛,

On Wed, Jun 06, 2012 at 05:46:11PM +0800, 蜗牛 wrote:
 hi Ariel 
   
  I am  trying to achieve; 
  develop an extension .
   
   
  can vcl  module not give interface?
   
  I rember kde plugin use vcl module ?

You cannot use vcl directly, that is, you cannot include its headers
nor link against it. Extensions can only link against URE libraries, not
core libraries. If you need to design some user interface in your
extension you must use the AWT API (the toolkit module is a sort of vcl
wrapper):
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/GUI/Graphical_User_Interfaces
http://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/module-ix.html

The KDE plugin is *not* an extenison, it is build in the source tree and
linked against core libraries.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgpzMGBwuj090.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
hi Ariel 

   could you give me  a example of  use the AWT API ?
   
 Regards

 

  
Hi ,

On Wed, Jun 06, 2012 at 05:46:11PM +0800,  wrote:
 hi Ariel 
   
  I am  trying to achieve; 
  develop an extension .
   
   
  can vcl  module not give interface?
   
  I rember kde plugin use vcl module ?

 You cannot use vcl directly, that is, you cannot include its headers
 nor link against it. Extensions can only link against URE libraries, not
 core libraries. If you need to design some user interface in your
 extension you must use the AWT API (the toolkit module is a sort of vcl
 wrapper):
  
 http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/GUI/Graphical_User_Interfaces
 http://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/module-ix.html

 The KDE plugin is *not* an extenison, it is build in the source tree and
l inked against core libraries.
 

 Regards
 -- 
 Ariel Constenla-Haile
La Plata, Argentina

a question of Export custom file format?

2012-06-06 Thread ????
hi Ariel 

   could you give me  a example of  use your Way doing a new 
exporter, assuming that the file format is pdf?
   
 Regards


  

 

 --  --
  ??: Armin Le Grandarmin.le.gr...@me.com;
 : 2012??6??6??(??) 5:02
 ??: ooo-devooo-dev@incubator.apache.org; 
 
 : Re: a question of Export custom file format?

 

Hi  (had to copy-paste, cannot read, hope it's correct)

On 06.06.2012 06:23,  wrote:
 HI:

 I need to develop an extension program of openoffice's write,
 the extended function is export a custom file format
 , the file format similar as PDF file format ,
 But not the PDF file format.

 I analyzed the export of PDF files ,the Function  through VCL output.
 I have two question as below:

 1)Such  need can be achieved in extension of openoffice's write?

Yes, when You use the UNO API. This means to get the document, iterate 
over pages and objects and export them.

 2) Can I use
 calss VirtualDevice
 calss GDIMetaFile
 interface---   ReferenceXRenderable  xRenderable (mxSrcDoc, UNO_QUERY)
 in openoffice's write?

I do not know too much from it by heart, but a starting point is to get 
the document as handle.
More important: Using VirtualDevice and GDIMetaFile will work, but is 
somehow the older way to do things. With the current state of the core i 
would suggest to use primitives for SdrObjects when you need to export 
graphical representations (as in PDF export, and not the model data as 
in PPT export). Primitives give you all the geometry data in double 
precision and in a tree structure with some automatisms. For each 
SdrObject you may get a sequence of primitives (over UNO API from 
xShape). Examples how to proccess them can be found in 
drawinglayer/source/processor2d. E.g. vclmetafileprocessor2d is the 
instance which currently is used in the core to create GDIMetaFiles from 
primitives (these are not created from 'painting' SdrObjects since some 
time, this already shows that primitives contain more information than 
the GDIMetaFIles). Or e.g. vclpixelprocessor2d is the current renderer 
for pixel output (screen display).
In principle all exporters using geometry information as base data 
can/should be rewritten to use primitives. Thus, when doing a new 
exporter, I would recommend using them from the beginning.
To see how to get primitives from xShape grep for XPrimitiveFactory2D 
and createPrimitivesFromXShape.

HTH!
Sincerely,
Armin
--
ALG

Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 06:08:10PM +0800, 蜗牛 wrote:
 hi Ariel 
 
could you give me  a example of  use your Way doing a new 
 exporter, assuming that the file format is pdf?

I can point you to the SDK examples:
sdk/examples/DevelopersGuide/OfficeDev/FilterDevelopment

You should read the Developer's Guide first, in order to understand the
examples.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgpHxhmYo7jlQ.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
Hi Ariel 
 Not made a filter ,This export function only use in my extension, Invoked by 
the menu of my extension,Not available to other applications.
   
 On Wed, Jun 06, 2012 at 06:08:10PM +0800,  wrote:
 hi Ariel 
 
could you give me  a example of  use your Way doing a new 
 exporter, assuming that the file format is pdf?

I can point you to the SDK examples:
sdk/examples/DevelopersGuide/OfficeDev/FilterDevelopment

You should read the Developer's Guide first, in order to understand the
examples.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 06:00:25PM +0800, 蜗牛 wrote:
 hi Ariel 
 
could you give me  a example of  use the AWT API ?

You can look at the SDK examples: sdk/examples/DevelopersGuide/GUI (in Java)

AFAIK the C++ extension, Presentation Minimizer uses AWT, so you can get
something from
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sdext/source/minimizer/


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgp2nEMmHFmcW.pgp
Description: PGP signature


Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 08:29:41PM +0800, 蜗牛 wrote:
 Hi Ariel Not made a filter ,This export function only use in my
 extension, Invoked by the menu of my extension,Not available to other
 applications.

Then you don't need a filter at all. Simply add a menu entry, implement
a ProtocolHandler to dispatch the command, and do the export there. All
these things are documented in the Developr's Guide, and there are
examples in the SDK, even in C++:
sdk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgpIi6wfIoqhR.pgp
Description: PGP signature


Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 08:44:13PM +0800, 蜗牛 wrote:
 hi Ariel :
   
  the  export file format complex  as PDF, need precise layout, so
  I reference  the PDF export, that need the VCL.  

I still don't have a clear idea of you're trying to achieve. As far as
I could understand:

- you don't to implement an export filter, you simply want to add a menu
  entry that will allow the user to export the selected object to your
  file format

- you don't want to hack AOO source code, you just want to write an
  extension

With these two things clear, you should notice that it is completely
pointless to look in the core source code for answers to include in your
extension: because (a) an extension can only link to URE libraries, (b)
the core code has usually internal dependencies, you won't find a single
class that will give the answer and from which you could take code to
use in your extension; this approach is a waste of time.

  You tell me the method to achieve the precise layout?

Again, it's pointless to look for a class, even more pointless to look
for a single function. I guess you should consider using some external
library.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgp3D0xaCCHRx.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
Hi Ariel :
 you are right.
 could you tell me which external
library can use ?
  

 


On Wed, Jun 06, 2012 at 08:44:13PM +0800,  wrote:
 hi Ariel :
   
  the  export file format complex  as PDF, need precise layout, so
  I reference  the PDF export, that need the VCL.  

I still don't have a clear idea of you're trying to achieve. As far as
I could understand:

- you don't to implement an export filter, you simply want to add a menu
  entry that will allow the user to export the selected object to your
  file format

- you don't want to hack AOO source code, you just want to write an
  extension

With these two things clear, you should notice that it is completely
pointless to look in the core source code for answers to include in your
extension: because (a) an extension can only link to URE libraries, (b)
the core code has usually internal dependencies, you won't find a single
class that will give the answer and from which you could take code to
use in your extension; this approach is a waste of time.

  You tell me the method to achieve the precise layout?

Again, it's pointless to look for a class, even more pointless to look
for a single function. I guess you should consider using some external
library.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: a question of Export custom file format?

2012-06-06 Thread Armin Le Grand

Hi ,

On 06.06.2012 12:23,  wrote:

hi  Armin

could you give me  a example of  use your Way doing a new
exporter, assuming that the file format is pdf?


It would be more or less the same as every UNO API based export, iterate 
over the document, the pages and the shapes. Instead of getting a 
MetaFile from the shape (using Graphicxporter) you would get the 
sequence of primitives and use that as base geometry information.


You cannot use this when you want to develop an extension, the UNO API 
for primitives is minimal currently and thus you would have to link 
against office components (what the definition of extension does not 
allow). To do this, the most needed primitives would need to get an UNO 
API implementation first.



  Regards


Sincerely,
Armin
--
ALG



a question of Export custom file format?

2012-06-06 Thread ????
Hi  Armin

 Your letter written under:
 the most needed primitives would need to get an UNO 
API implementation first.

 How do I do?
Please give detailed steps
   
 Regards


  
It would be more or less the same as every UNO API based export, iterate 
over the document, the pages and the shapes. Instead of getting a 
MetaFile from the shape (using Graphicxporter) you would get the 
sequence of primitives and use that as base geometry information.

You cannot use this when you want to develop an extension, the UNO API 
for primitives is minimal currently and thus you would have to link 
against office components (what the definition of extension does not 
allow). To do this, the most needed primitives would need to get an UNO 
API implementation first.

   Regards

Sincerely,
Armin
--
ALG

Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 09:08:22PM +0800, 蜗牛 wrote:
 Hi Ariel : you are right.  could you tell me which external library
 can use ?

I'm sorry, I can't: I have no idea what your you're trying to implement.
Nevertheless, you should think *first* if this is possible at all. You
need to retrieve information about the object you want to export only
using UNO API, so the first thing to do is investigate if the
information you get via the API is enough to achieve the kind of thing
you're trying to do (and I don't want to be negative, but usually the
UNO API is rather poor...).

For first question should be can I do this with an extension, that is
using only UNO API?. Did you try to find this out?


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgpFGvAdVZlQ7.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
Hi  Ariel 
  
  can not directly access the VCL interface is the SDK problem?
 If the SDK, can directly modify the SDK code to solve this problem?
  

 Regards


On Wed, Jun 06, 2012 at 09:08:22PM +0800,  wrote:
 Hi Ariel : you are right.  could you tell me which external library
 can use ?

I'm sorry, I can't: I have no idea what your you're trying to implement.
Nevertheless, you should think *first* if this is possible at all. You
need to retrieve information about the object you want to export only
using UNO API, so the first thing to do is investigate if the
information you get via the API is enough to achieve the kind of thing
you're trying to do (and I don't want to be negative, but usually the
UNO API is rather poor...).

For first question should be can I do this with an extension, that is
using only UNO API?. Did you try to find this out?


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: a question of Export custom file format?

2012-06-06 Thread Ariel Constenla-Haile
Hi 蜗牛

On Wed, Jun 06, 2012 at 09:35:34PM +0800, 蜗牛 wrote:
 Hi  Ariel 
   
   can not directly access the VCL interface is the SDK problem?  

If you are going to work in an extension, you must use only UNO API as
described in the API reference; so forget about VCL :) VCL is used
internally, as an API Developer you don't need to know anything about
it.

You can only work with the features described in the reference
http://www.openoffice.org/api/docs/common/ref/com/sun/star/module-ix.html
and document in the Developer's Guide.

Did you study the API? I don't mean the whole API and the whole
Developer's Guide. But the first question you should answer yourself is
if you can achieve what you're trying to do, using *only* the API. (In
order to use the API, you must know the API, of course).

   If the SDK, can directly modify the SDK code to solve this problem?

No, you will have to start implement things yourself. Of course, this
will be more than welcome (as far as the API is useful).

The main issue I see by reading your mails, is that you didn't try to
find out how feasible is it to do what you're trying to do, using only
AOO API.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


pgprpxP3O3snt.pgp
Description: PGP signature


a question of Export custom file format?

2012-06-06 Thread ????
Hi Ariel 
 The following code excerpt since ooo1.1,  if this demo code can be implemented 
in the extension, my question can be resolved/:includetail
 /:includetail 
 /:includetail 
 VCLXDevice* pXDevice = new VCLXDevice;
..
PDFWriter*  pPDFWriter = new PDFWriter( 
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI), PDFWriter::PDF_1_4, 
eCompressMode );
OutputDevice*  pOut = pPDFWriter-GetReferenceDevice();
pXDevice-SetOutputDevice( pOut );
 
..
GDIMetaFile aMtf;
const MapMode   aMapMode( MAP_100TH_MM );
const Size  aMtfSize( aPageSize.Width, aPageSize.Height );
 pOut-Push();
pOut-EnableOutput( FALSE );
pOut-SetMapMode( aMapMode );
 aMtf.SetPrefSize( aMtfSize );
aMtf.SetPrefMapMode( aMapMode );
aMtf.Record( pOut );
 xRenderable-render( nSel - 1, aSelection, aRenderOptions );
aMtf.Stop();
aMtf.WindStart();
 if( aMtf.GetActionCount() )
bRet = ImplExportPage( *pPDFWriter, aMtf, nCompressMode ) || bRet;
 pOut-Pop();
/:includetail 
Regards/:includetail
 
 
 

On Wed, Jun 06, 2012 at 09:35:34PM +0800,  wrote:
 Hi  Ariel 
   
   can not directly access the VCL interface is the SDK problem?  

If you are going to work in an extension, you must use only UNO API as
described in the API reference; so forget about VCL :) VCL is used
internally, as an API Developer you don't need to know anything about
it.

You can only work with the features described in the reference
http://www.openoffice.org/api/docs/common/ref/com/sun/star/module-ix.html
and document in the Developer's Guide.

Did you study the API? I don't mean the whole API and the whole
Developer's Guide. But the first question you should answer yourself is
if you can achieve what you're trying to do, using *only* the API. (In
order to use the API, you must know the API, of course).

   If the SDK, can directly modify the SDK code to solve this problem?

No, you will have to start implement things yourself. Of course, this
will be more than welcome (as far as the API is useful).

The main issue I see by reading your mails, is that you didn't try to
find out how feasible is it to do what you're trying to do, using only
AOO API.

Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


 
/:includetail

a question of Export custom file format?

2012-06-06 Thread jianlizhao
Hi  蜗牛

You can modify the source code to be recompiled.


Reference XRenderable  xRenderable( mxSrcDoc, UNO_QUERY )
VCLXDevice* pXDevice = new VCLXDevice;
..
PDFWriter*  pPDFWriter = new PDFWriter(
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI), PDFWriter::PDF_1_4,
eCompressMode );
OutputDevice*  pOut = pPDFWriter-GetReferenceDevice();
pXDevice-SetOutputDevice( pOut );
..
GDIMetaFile aMtf;
const MapMode   aMapMode( MAP_100TH_MM );
const Size  aMtfSize( aPageSize.Width, aPageSize.Height );

pOut-Push();
pOut-EnableOutput( FALSE );
pOut-SetMapMode( aMapMode );

aMtf.SetPrefSize( aMtfSize );
aMtf.SetPrefMapMode( aMapMode );
aMtf.Record( pOut );

xRenderable-render( nSel - 1, aSelection, aRenderOptions );
aMtf.Stop();
aMtf.WindStart();

if( aMtf.GetActionCount() )
bRet = ImplExportPage( *pPDFWriter, aMtf, nCompressMode ) || bRet;

pOut-Pop();
Regards



a question of Export custom file format?

2012-06-06 Thread ????
hi Armin
   
 can i modify the SDK to achieve my need.
  
 achieve  demo code as below:

   
 Reference XRenderable  xRenderable( mxSrcDoc, UNO_QUERY )
VCLXDevice* pXDevice = new VCLXDevice;
..
PDFWriter*  pPDFWriter = new PDFWriter(
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI), PDFWriter::PDF_1_4,
eCompressMode );
OutputDevice*  pOut = pPDFWriter-GetReferenceDevice();
pXDevice-SetOutputDevice( pOut );
..
GDIMetaFile aMtf;
const MapMode   aMapMode( MAP_100TH_MM );
const Size  aMtfSize( aPageSize.Width, aPageSize.Height );

pOut-Push();
pOut-EnableOutput( FALSE );
pOut-SetMapMode( aMapMode );

aMtf.SetPrefSize( aMtfSize );
aMtf.SetPrefMapMode( aMapMode );
aMtf.Record( pOut );

xRenderable-render( nSel - 1, aSelection, aRenderOptions );
aMtf.Stop();
aMtf.WindStart();

if( aMtf.GetActionCount() )
bRet = ImplExportPage( *pPDFWriter, aMtf, nCompressMode ) || bRet;

pOut-Pop();

just provide the output of the VCL. To meet my needs.
 If this idea can be.
How do I do?
 
Regards

On 06.06.2012 12:23,  wrote:
 hi  Armin

 could you give me  a example of  use your Way doing a new
 exporter, assuming that the file format is pdf?

It would be more or less the same as every UNO API based export, iterate 
over the document, the pages and the shapes. Instead of getting a 
MetaFile from the shape (using Graphicxporter) you would get the 
sequence of primitives and use that as base geometry information.

You cannot use this when you want to develop an extension, the UNO API 
for primitives is minimal currently and thus you would have to link 
against office components (what the definition of extension does not 
allow). To do this, the most needed primitives would need to get an UNO 
API implementation first.

   Regards

Sincerely,
Armin
--
ALG


 
/:includetail

a question of Export custom file format?

2012-06-05 Thread ????
HI:
 
I need to develop an extension program of openoffice's write, 
the extended function is export a custom file format
, the file format similar as PDF file format ,
But not the PDF file format.
 
I analyzed the export of PDF files ,the Function  through VCL output.
I have two question as below:
 
1)Such  need can be achieved in extension of openoffice's write?
2) Can I use 
calss VirtualDevice
calss GDIMetaFile
interface---   Reference XRenderable xRenderable (mxSrcDoc, UNO_QUERY)
in openoffice's write?