RvHtmlImporter v0.0027 bugs

General TRichView support forum. Please post your questions here
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

RvHtmlImporter v0.0027 bugs

Post by wasuplee123 »

Hi,

I would be very interested in purchasing RichView, but I need to be able to save and load documents as HTML. The HTML export feature of TRichView is sufficient for me, but the import (via RvHtmlImporter v0.0027) is pretty buggy. For example, if I have the text:
This is a test.
When I export to HTML it's fine, but then when importing back, the spaces between different styles (i.e. the plain text, bold and italics) are removed. So I end up getting something like:
Thisisatest.
Has no one else come across this issue?
I realize the source code for RvHtmlImporter is available for free, but the whole point of me using TRichView would be so I don't have to spend hours to fix/code such stuff.

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem with spaces. Please send me this HTML file to [email protected]
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

Post by wasuplee123 »

I sent you an email over a week ago regarding this issue, but still haven't gotten a reply. I will just post the important part of my email here:

I reproduced the problem using the importing and exporting in the ActionTest application from the TRichView website. I noticed that if I export it as "HTML - simplified" (not using CSS), then it imports correctly, but I would like to save it as the normal HTML w/CSS styles. The export works fine in both cases. The import is the problem (only when using CSS styles).

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry for delay (there was many problems while moving site to the new location, so it caused delays in answers).

Open RVHtmlImport.pas, find procedure WriteTSCR, change the first "if" (line 2217) to

Code: Select all

   if (ts = ' ') and (GetCurParaNo>=0) then
      s := ''
    else
      s := ts;
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

Post by wasuplee123 »

Maybe I misunderstood your instructions, but I still have this issue.

In RVHtmlImport.pas, the first "if" (which is line 2216 for me) is:

Code: Select all

if (s[i1] = #13) then
It doesn't make much sense to replace that "if" with the code you provided above. I did notice the code you provided above is exactly what was already in the unit, commented on line 2212:

Code: Select all

{if ts = ' ' then s := '' else }s := ts;
I tried uncommenting that comment, but I still get the same issue with spaces not getting imported correctly.

So am I misunderstanding your instructions, or did you maybe not test this change?

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, line number was specified incorrectly
This new code must replace the line, {if ts = ' ' then s := '' else }s := ts; the first statement in WriteTSCR.
Note that is is not exactly the same as the commented code, "and (GetCurParaNo>=0)" is added.

But it's very strange, I cannot reproduce this problem with RvHtml v0.0027 any more, even without modification. But if I uncomment {if ts = ' ' then s := '' else }, this bug appears.
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

Post by wasuplee123 »

Thanks, that fixed that issue.

Now I see another issue though. I have the following HTML generated from TRichView, but when I import it becomes "This is a test." instead of "This is a test." (notice the space before the word "test" being underlined; the exported HTML seems fine, it looks like another issue w/RvHtmlImporter):

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
  margin: 5px 5px 5px 5px;
  background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal */
{
 font-size: 10pt;
 font-family: 'Arial', 'Helvetica', sans-serif;
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
 ;
}
span.rvts1
{
 font-weight: bold;
}
span.rvts2
{
 font-style: italic;
}
span.rvts3
{
 text-decoration: underline;
}
span.rvts4
{
 color: #000000;
}
span.rvts5
{
 font-weight: bold;
 color: #000000;
}
span.rvts6
{
 font-style: italic;
 color: #000000;
}
span.rvts7
{
 color: #000000;
 text-decoration: underline;
}
span.rvts8
{
 font-style: italic;
 font-weight: bold;
 color: #000000;
}
/* ========== Para Styles ========== */
p,ul,ol /* Left */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
--></style>
</head>
<body>

<p><span class=rvts4>This is </span><span class=rvts5>a</span><span class=rvts4> </span><span class=rvts7>test</span><span class=rvts4>.</span></p>

</body></html>
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I'll try to find what's wrong, but I am not sure that I will succeed. RvHtmlImporter was not written by me.
I have an idea of using another free thirdparty HTML parser, with much more capabilities. I'll check it next week.
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

Post by wasuplee123 »

Thank you very much for your help. I really appreciate it.
Good luck with your future work on this.

I'll check back here in a week or two.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I just uploaded (for registered users) a class for reading HTML from THTMLViewer ( http://www.pbear.com )
wasuplee123
Posts: 12
Joined: Mon May 12, 2008 11:29 pm

Post by wasuplee123 »

Thanks.
Is there any way I can test this without purchasing the product? The reason I think that would make sense is because without testing this I don't know if it is sufficient for my needs or if there are any other bugs.

I think it makes sense for it to be free for the same reason RvHtmlImporter is free. It's not really useful without the TRichView component, and this way people can evaluate the product better.

I just want to make it clear again that I will very likely purchase RichView if it can load documents correctly from HTML.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Ok, you can download it here:
http://www.trichview.com/resources/html ... import.zip
Before installing, open rvHtmlViewImport, find and remove {$DEFINE RVFULL}
See also installation instructions in ReadMe.txt
nicefive
Posts: 2
Joined: Fri Jun 20, 2008 4:11 pm

Post by nicefive »

As chance would have it I am in exactly the same situation.

I would like to load HTML templates (with style tags!) into an RvRichView and print them out (my code will change the HTML accordingly as it is loaded). I like the way RvRichView handles printing etc.

The problem is that on the “HTML import” side of things I can simply get nothing to work apart from the earlier version of RvHTMLImport but style tags are a must.

I am reluctant to buy anything until I have seen it working. We use BDS 2006 using C++ (not Delphi, sorry)

Additionally I am concerned about having an add-on (RvRichEdit) with a dependant add-on (RvHTMLViewImport) and then another dependant add-on (THMLViewer) but I guess the benefits of it all working are more important.

So, any help for C++ Builder 2006? I desperately need to get something that works so I can this title on the market.

Regards,

James
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you load HTMLViewer and HTMLViewImporter packages in C++Builder 2006? The packages provided in my zip file generate both Delphi (dcu) and C++Builder (obj+hpp) files.
nicefive
Posts: 2
Joined: Fri Jun 20, 2008 4:11 pm

Post by nicefive »

I must be getting confused about what to install.

In the zip there are these packages.

\rvHtmlViewImport2006.bdsproj
\THTML\pakage\FrameViewer2006.bdsproj

Do I need to install THML from pbear.com or is that included in your zip and follow the instructions in readme.txt with changing source etc?

I think I am confused because your zip also contains a FrameViewer2006 project and I may require some fool proof instructions on how it all hooks up.

James
Post Reply