OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Setting Image size for JPEG export

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Impress
View previous topic :: View next topic  
Author Message
TimH
Newbie
Newbie


Joined: 22 Aug 2004
Posts: 3

PostPosted: Sun Aug 22, 2004 10:59 pm    Post subject: Setting Image size for JPEG export Reply with quote

I am using the basic macros posted by Danny B to successfully convert PPT to JPEG.

However, I want to convert it to a different size (as opposed to 960 x 720, which it is doing currently).

When within OpenOffice you use the HTML wizard you can set the output resolution of the JPEG, but I cannot find any documentation on what parameters to pass to impress_jpe_Export to control the export image pixel size.

Any ideas?
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Aug 23, 2004 8:03 am    Post subject: Reply with quote

I have never seen any documentation on filter options.

This thread, which contains a lot of speculation and experimentation, plus a different technique to export to EPS files, might give you some insight.

http://www.oooforum.org/forum/viewtopic.php?t=6769

I wish all of the filter options were documented.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
TimH
Newbie
Newbie


Joined: 22 Aug 2004
Posts: 3

PostPosted: Mon Aug 23, 2004 5:03 pm    Post subject: Reply with quote

Thanks DannyB - does anyone know exactly where the source code is for impress_jpg_Export? I've had a quick dig around but I am new to the system. I assume from looking at the source I can figure out what FilterData name/value pairs are accepted.

Thanks TimH
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Mon Aug 23, 2004 9:00 pm    Post subject: Reply with quote

It depends of course from which cvs server you get HEAD and modules from, for the official OOo CVS server this list contains the information you need:
http://tools.openoffice.org/modules.html

it points to svtools/source/filter.vcl and after searching a little bit through lxr I have found filter.vcl/eps which is the directory for exporting to EPS I guess.

Everything generally related to impress is in the "sd" module.

Hope that helps.
Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
TimH
Newbie
Newbie


Joined: 22 Aug 2004
Posts: 3

PostPosted: Tue Aug 24, 2004 10:27 pm    Post subject: HTML & JPEG parameters Reply with quote

Thanks to both DannyB and Christian - I can now control the output resolution.

In fact I moved over from using impress_jpg_Export to impress_html_Export. The reason is that the native jpg filter only allows you to control quality and color/greyscale. With the HTML filter, there are a lot more options, including resetting the final jpg pixel size.

Also, whilst the html conversion generates a lot of html files I don't need, it is much more faster than the SlideSplitter program (although less flexible in naming conventions etc).

I've included here the code I used - basically DannyB's PPT to HTML macro with FilterData added. This came from looking up the code (sd/source/filter/html/pubdlg.cxx). If you are looking for parameters for other filters, be aware that they are somewhat spread out among the source tree.

Code:

Sub Main()
   ' This is the name of the Impress document to convert to html.'

  cImpressDocToSplit = "C:/invexp112.ppt"

   ConvertPPTtoHTML( cImpressDocToSplit )
End Sub

Sub ConvertPPTtoHTML( cFile )
   cURL = ConvertToURL( cFile )
   
   ' Open the document.
   ' Just blindly assume that the document is of a type that OOo will
   '  correctly recognize and open -- without specifying an import filter.
   oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array(MakePropertyValue( "Hidden", True ),) )

   cFile = Left( cFile, Len( cFile ) - 4 ) + ".html"
   cURL = ConvertToURL( cFile )
   
   ' Set the filter data
   Dim aFilterData(0) as new com.sun.star.beans.PropertyValue
   aFilterData(0).Name = "Width" 
   aFilterData(0).Value = 800
   
   ' Save the document using a filter.   
   oDoc.storeToURL( cURL, Array(MakePropertyValue( "URL", cURL ),MakePropertyValue( "FilterName", "impress_html_Export" ),MakePropertyValue( "FilterData", aFilterData() ),)
   
   oDoc.close( True )
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
   oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function


You'll note here I've only passed "Width" as a parameter, it can take the values 640, 800, or 1024, and these result in actual widths of 480,640, 800 respectively. The three fixed values come from the radio buttons in the HTML wizard, and they are shrunk as the overall page is factored to that resolution with the slide image being smaller than that. Not perfect, but good enough for what I need.
Back to top
View user's profile Send private message
saranbabu
General User
General User


Joined: 07 Nov 2006
Posts: 8

PostPosted: Fri Dec 22, 2006 12:52 am    Post subject: Reply with quote

thanx first this post helped me lot

please list all possible propertyValues (and filterData) that can be used while exporting PPT to HTML.

Quote:
With the HTML filter, there are a lot more options, including resetting the final jpg pixel size.


TimH can u list the options
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Impress All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group