| View previous topic :: View next topic |
| Author |
Message |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Fri Dec 21, 2007 9:23 pm Post subject: html file opening by GUI and Macro differs |
|
|
If I open my html file using open dialog I get Writer/Web and it displays html properly. If on the other hand I use this macro
| Code: |
cFile = "C:\my.html"
' Convert filename to URL.
cUrl = ConvertToURL( cFile )
oDoc = StarDesktop.loadComponentFromURL( cUrl, "_blank", 0,Array())
|
I get document in which images (gifs) are very small. I did try to specify:
| Code: | | Array(MakePropertyValue( "FilterName", "HTML (StarWriter)" ) | But the result was the same (it did open it in Writer as opposed to Writer/Web). Is there other options I'm missing there? How do I make sure that the macro opens the document the same way?
Thanks. _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Sun Dec 23, 2007 3:28 am Post subject: Re: html file opening by GUI and Macro differs |
|
|
try
| Code: | | Array(MakePropertyValue( "FilterName", "writer_web_HTML_help" ) |
Good luck,
ms777 |
|
| Back to top |
|
 |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Sun Dec 23, 2007 7:47 am Post subject: Re: html file opening by GUI and Macro differs |
|
|
| ms777 wrote: | | writer_web_HTML_help |
Thanks ms777, but it did not change the result. How can I get the list of supported FilterNames? Maybe I can find one that works. _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Sun Dec 23, 2007 8:37 am Post subject: |
|
|
That is strange ... I just tried | Code: | sub main
sUrl = "file:///C:/test.html"
Dim arArgs(0) as New com.sun.star.beans.PropertyValue
arArgs(0).Name = "FilterName"
arArgs(0).Value = "writer_web_HTML_help" ' do not ask me why you need _help here ...
oWebDoc = StarDesktop.LoadComponentFromUrl(sUrl,"_default",0,arArgs())
end sub | and it perfectly opens in writer/web, not writer
Browse the forum for filter and list, and specify DannyB as the author to get a filter list. Specifying DannyB as the author is always a good idea, if you get too many results on searches ... |
|
| Back to top |
|
 |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Sun Dec 23, 2007 8:58 am Post subject: |
|
|
| ms777 wrote: | | and it perfectly opens in writer/web, not writer |
I did not explain it properly in my first post. I can open it in writer/web or in writer. Both applications show the page in a wrong way. If I use Open Dialog and load the same file manually it shows correctly in writer/web. The problem is that gif images look very small when the document is opened from this macro in writer/web.
| ms777 wrote: |
Browse the forum for filter and list, and specify DannyB as the author to get a filter list. Specifying DannyB as the author is always a good idea, if you get too many results on searches ... | I've made the search and I could not find information how to get the list of filters I tried to look at api for MediaDescriptor function, but could not get to the list from there either. _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
|
| Back to top |
|
 |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Sun Dec 23, 2007 9:25 am Post subject: |
|
|
Thanks for the link to the list. I looked through it and tried another web filter, but with the same results . So here is the html:
| Code: |
<html><title>Report</title><body><h1>Report</h1>
<p>Some text here</p>
<p><a name="Test" ><img src="Test.gif" ><br><hr>
</body></html>
|
And gif image is here. Place them in the same directory:
http://img341.imageshack.us/img341/8840/testxd1.gif
I also tried to convert gif into jpg, but it did not change anything. If I go to image properties in the open document and click "Original Size" then the image is displayed properly. Maybe when macro loads the document it does not use original image size... I'm guessing here.
Thanks a lot for your help! _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Sun Dec 23, 2007 10:17 am Post subject: |
|
|
I tried it, and got absolutely identical results. Both with dialog and OO Basic opening the chart was there, and in correct size ...
It seems to be more complicated.
Good luck,
ms777 |
|
| Back to top |
|
 |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Sun Dec 23, 2007 10:26 am Post subject: |
|
|
The worst case scenario is here ... Let's see... I am using Vista Professional with OpenOffice 2.2.0. Given that it's the latest version of OpenOffice I have an urge to blame it on Vista. But could it be Java version problem? How do I find out what java version is used by OpenOffice? If I type in java in command prompt I get
| Code: |
C:\Program Files\OpenOffice.org 2.2\program>java -version
java version "1.6.0-oem"
Java(TM) SE Runtime Environment (build 1.6.0-oem-b104)
Java HotSpot(TM) Client VM (build 1.6.0-oem-b104, mixed mode, sharing) |
[/code] _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Sun Dec 23, 2007 10:42 am Post subject: |
|
|
I am on XP, and still on OO 2.1.
I do not think that java is involved here ...
Ho do other sites look like (e.g. http://www.google.com) when opened by macro ?
BTW, your html is syntactically incorrect. This may contribute, too. |
|
| Back to top |
|
 |
sjcomp General User

Joined: 06 Apr 2005 Posts: 15
|
Posted: Sun Dec 23, 2007 11:08 am Post subject: |
|
|
| ms777 wrote: | | I am on XP, and still on OO 2.1. | Could be that there is something changed in 2.2
Images look fine. But they use width and height attributes in the img tag. If I add these attributes then my page is displayed fine as well. Which maybe a temporary solution for me as well.
| ms777 wrote: |
BTW, your html is syntactically incorrect. This may contribute, too. | Making it XHTML 1.0 Strict did not help. _________________ Regards, Alexander. http://sjcomp.com |
|
| Back to top |
|
 |
mathi Newbie

Joined: 18 Jun 2012 Posts: 1
|
Posted: Mon Jun 18, 2012 5:31 am Post subject: |
|
|
Hello sjcomp
I am facing a same exact problem like you (images are smaller when html is exported to PDF). I am using Libre office 3.5 and its JAVA SDK on Windows XP.
Have you found any solution for your problem.
If yes, could you please share here,
It would be of great help
Thank you very much |
|
| Back to top |
|
 |
|