Re: [Libreoffice] EPS Export with text for LaTex and PSFrag

2011-03-23 Thread Thorsten Behrens
Jesse Perla wrote:
> Does anyone know how to get LibreOffice Draw to export EPS without text
> rendered as curves?  This is necessary to use these diagrams in LaTex with
> PSFrag for example.
> 
See officecfg/registry/schema/org/openoffice/Office/Common.xcs -
look for TextMode in that file.

Cheers,

-- Thorsten


pgpxU7uJ7G9wf.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] EPS Export with text for LaTex and PSFrag

2011-03-22 Thread Fernand Vanrie

Jesse,

Found some where on a forum, some Basic code to set this filter options 
by the API


hope it helps

Fernand

' gets all shapes in the current draw page
' @param page: A XDrawPage. If page is not a XDrawPage, an empty shapes 
collection is returned.
' @return: a com.sun.star.drawing.ShapeCollection containing all shapes, 
may be empty.

function getAllShapesInDrawPage(thePage as Object)
   ' create empty collection of shapes
   theShapes= createUnoService("com.sun.star.drawing.ShapeCollection")
   if not hasUnoInterfaces(thePage, "com.sun.star.drawing.XDrawPage") then
  getAllShapesInDrawPage = theShapes
  exit function
   end if

   ' add all shapes in the page to the collection
   for i=0 to thePage.getCount() - 1
  theShapes.add(thePage.getByIndex(i))
   next i
   getAllShapesInDrawPage = theShapes
end function


' From a Draw page, export the current selection to eps. If the current 
selection is empty, select all
' shapes on the page and export them. If there are no shapes on the 
page, export the empty page.

' Parts of this code are taken from the code in ooo bug 7918.
sub exportSelectionOrPageToEps
   Dim currentPageName as String

   theDoc = StarDesktop.getCurrentComponent()
   if not theDoc.SupportsService( 
"com.sun.star.drawing.DrawingDocument" ) Then

  Msgbox("The current document must be a Draw document", 0)
  exit sub
   end if

theController = theDoc.currentController
   thePage = theController.currentPage
theSelection = theController.selection

   ' if nothing is selected, select all shapes in the current page
   if isEmpty(theSelection) then
  MsgBox("selection is empty, will select everything in current 
page", 0)

  theController.select(getAllShapesInDrawPage(thePage))
  theSelection = theDoc.currentController.selection
   end if

   'create url for storing
   Dim origUrl as String
   Dim exportUrl as new com.sun.star.util.URL
   origUrl = theDoc.url
   if isnull(thePage.name) then
  exportUrl.complete = Left( origUrl, Len(origUrl) - 4 ) + 
"_Export" + ".eps"

else
  exportUrl.complete = Left( origUrl, Len(origUrl) - 4 ) + "_" + 
thePage.name + ".eps"

endif

   ' Create the export filter.
' A GraphicExportFilter uses a page, shape or collection of shapes 
as source.
theExporter = createUnoService( 
"com.sun.star.drawing.GraphicExportFilter" )


' Export selection if something is selected, otherwise whole page.
if not isEmpty(theSelection) then
   theExporter.SetSourceDocument(theSelection)
else
   msgbox("no selection, exporting whole page", 0)
   theExporter.SetSourceDocument(thePage)
endif

' Set the filter data
Dim aFilterData(5) as new com.sun.star.beans.PropertyValue
aFilterData(0).Name = "Level" '1=PS level 1, 2=PS level 2
aFilterData(0).Value = 2
aFilterData(1).Name = "ColorFormat" '1=color, 2=grayscale
aFilterData(1).Value = 1
aFilterData(2).Name = "TextMode" '0=glyph outlines, 1=no glyph 
outlines, see ooo bug 7918

aFilterData(2).Value = 1
aFilterData(3).Name = "Preview" '0=none,1=TIFF,2=EPSI,3=TIFF+EPSI
aFilterData(3).Value = 0
aFilterData(4).Name = "CompressionMode" ' 1=LZW, 2=none
aFilterData(4).Value = 2
Dim aArgs (2) as new com.sun.star.beans.PropertyValue
aArgs(0).Name = "MediaType"
aArgs(0).Value = "image/x-eps"
aArgs(1).Name = "URL"
aArgs(1).Value = exportUrl
aArgs(2).Name = "FilterData"
aArgs(2).Value = aFilterData()
theExporter.filter(aArgs())

MsgBox("exported " + origUrl + " to " + exportUrl.complete, 0)
End Sub



I may have solved my own problem and found the new setting.  Try the following

* Open the file "C:\Program Files (x86)\LibreOffice
3\Basis\share\registry\main.xcd" in a text editor
* Use the Find and Replace feature in your editor.
Find:

EPS">02220

Replace with:

EPS">0


* Restart LibreOffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] EPS Export with text for LaTex and PSFrag

2011-03-22 Thread Jesse Perla
I may have solved my own problem and found the new setting.  Try the following

* Open the file "C:\Program Files (x86)\LibreOffice
3\Basis\share\registry\main.xcd" in a text editor
* Use the Find and Replace feature in your editor.
Find:

EPS">02220

Replace with:

EPS">0


* Restart LibreOffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] EPS Export with text for LaTex and PSFrag

2011-03-21 Thread Jesse Perla
Does anyone know how to get LibreOffice Draw to export EPS without text
rendered as curves?  This is necessary to use these diagrams in LaTex with
PSFrag for example.

I can't figure out the changes to the configuration files (or in the latest
OpenOffice for that matter as the config files seem to have changed).  To
see older notes on how to do this:
http://www.oooforum.org/forum/viewtopic.phtml?t=3085
and
http://www.mail-archive.com/users@openoffice.org/msg66714.html


In the future, I think this would be a great option to have in UI.  Perhaps
on the settings when you export diagram itself instead of being a global
setting.

Thanks,
Jesse
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice