johnny7 General User

Joined: 21 May 2004 Posts: 10
|
Posted: Mon Jun 07, 2004 2:32 am Post subject: |
|
|
I tried to search for the graphic objects and do some manipulating.
The following macro doesn't work, the generated document contains a wrongly scaled image.
| Code: |
Sub ConvertHTMLToSXW( )
'cURL = ConvertToURL( cFile )
cFile = "file://c:/testoo/test.html"
cURL = ConvertToURL( cFile )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array(_
MakePropertyValue( "FilterName", "HTML (StarWriter)" ),_
) )
oImages = oDoc.getGraphicObjects()
For i=0 to oImages.count - 1
'Print "height: "+oImages(i).Height+";width: "+oImages(i).Width
Next
cFile = Left( cFile, Len( cFile ) - 4 ) + "sxw"
cURL = ConvertToURL( cFile )
' Save the document using a filter.
oDoc.storeToURL( cURL, Array(_
MakePropertyValue( "FilterName", "StarOffice XML (Writer)" ),_
)
oDoc.close( True )
End Sub
|
The contents of test.html
| Code: |
<html><body><img src="distress_sigs.jpg" width=350></body></html>
|
If I however remove the comment quote in the macro from the following line
| Code: |
'Print "height: "+oImages(i).Height+";width: "+oImages(i).Width
|
the generated document contains a well-scaled image.
This seems a bug to me. Any ideas or comments? |
|