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

html file opening by GUI and Macro differs

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Fri Dec 21, 2007 9:23 pm    Post subject: html file opening by GUI and Macro differs Reply with quote

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
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Dec 23, 2007 3:28 am    Post subject: Re: html file opening by GUI and Macro differs Reply with quote

try
Code:
 Array(MakePropertyValue( "FilterName", "writer_web_HTML_help" )


Good luck,

ms777
Back to top
View user's profile Send private message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Sun Dec 23, 2007 7:47 am    Post subject: Re: html file opening by GUI and Macro differs Reply with quote

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
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Dec 23, 2007 8:37 am    Post subject: Reply with quote

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
View user's profile Send private message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Sun Dec 23, 2007 8:58 am    Post subject: Reply with quote

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 Sad 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
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Dec 23, 2007 9:09 am    Post subject: Reply with quote

Hi,

can you post your html and the needed gifs somewhere ?

The filter list is here: http://www.oooforum.org/forum/viewtopic.phtml?t=3549

Good luck,

ms777
Back to top
View user's profile Send private message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Sun Dec 23, 2007 9:25 am    Post subject: Reply with quote

Thanks for the link to the list. I looked through it and tried another web filter, but with the same results Sad. 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
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Dec 23, 2007 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Sun Dec 23, 2007 10:26 am    Post subject: Reply with quote

The worst case scenario is here Sad... 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
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Dec 23, 2007 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message
sjcomp
General User
General User


Joined: 06 Apr 2005
Posts: 15

PostPosted: Sun Dec 23, 2007 11:08 am    Post subject: Reply with quote

ms777 wrote:
I am on XP, and still on OO 2.1.
Could be that there is something changed in 2.2
ms777 wrote:

Ho do other sites look like (e.g. http://www.google.com) when opened by macro ?

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
View user's profile Send private message Visit poster's website
mathi
Newbie
Newbie


Joined: 18 Jun 2012
Posts: 1

PostPosted: Mon Jun 18, 2012 5:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API 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