I create my initial file using the richviewedit and I save the html to sql with
rvespImageFileName,and savehtmlEx using the rvsoOrverrideimages and rvsouseItemImagefileNames.
Like:
RveSDS.SaveHTMLEx('C:\'+ dmcat.adoQCat_dataNumber.AsString+'.txt',
dmcat.adoQMSDSNumber.AsString,'','','','',[rvsoOverrideImages, rvsoUseItemImageFileNames]);
This works perfectly.
then I try to reload the HTML back into a richviewedit using
HTMLViewer1.LoadFromString(dmcat.adoQMSDSSdsHTML.asstring);
RVHtmlViewImporter1.ImportHtmlViewer(HTMLViewer1,RveSDS);
NormalizeRichView(RveSDS.RVdata);
RveSDS.Format;
this works perfectly.
But when I make a change to the richviewedit and repeat the above first step, it changes my picture locations, how can I preserve the original file locations?
Image locations change on resaves
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
That would be much to difficult, but I did find a solution that will work, it is based on where I run the exe from. I do however have another issue that maybe you can help with. upon using the following
HTMLViewer1.LoadFromString(dmcat.adoQMSDSSdsHTML.asstring); //works perfect
RVHtmlViewImporter1.ImportHtmlViewer(HTMLViewer1,RveSDS);
NormalizeRichView(RveSDS.RVdata);
RveSDS.Format;
It seems that it adds new duplicate styles to the style sheet and loses the paragraph style for my tables. where can I adjust so that it only uses the styles from the style sheet and doesn't lose the formatting on the tables?
HTMLViewer1.LoadFromString(dmcat.adoQMSDSSdsHTML.asstring); //works perfect
RVHtmlViewImporter1.ImportHtmlViewer(HTMLViewer1,RveSDS);
NormalizeRichView(RveSDS.RVdata);
RveSDS.Format;
It seems that it adds new duplicate styles to the style sheet and loses the paragraph style for my tables. where can I adjust so that it only uses the styles from the style sheet and doesn't lose the formatting on the tables?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I have both of the richviewedits hooked to the same style and no matter what settings I use it always recreates the styles, it never reuses and existing style.
/* ========== Text Styles ========== */
hr { color: #000000}
body, table, span.rvts0 /* Normal text */
{
font-size: 10pt;
font-family: 'Arial', 'Helvetica', sans-serif;
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* MSDS Header */
{
font-size: 40pt;
font-weight: bold;
}
span.rvts2 /* Material Safety Data Sheet */
{
font-size: 16pt;
font-weight: bold;
}
span.rvts3 /* ChemicalName ID */
{
font-size: 14pt;
font-family: 'Arial Rad';
color: #000080;
}
span.rvts4 /* ChemicalNameSize10 */
{
font-family: 'Arial Rad';
}
span.rvts5 /* Bold Italic */
{
font-style: italic;
font-weight: bold;
}
span.rvts6 /* Bold */
{
font-weight: bold;
}
span.rvts7
{
font-size: 40pt;
font-weight: bold;
}
span.rvts8
{
font-size: 16pt;
font-weight: bold;
}
span.rvts9
{
font-size: 14pt;
font-family: 'arial rad';
color: #000080;
}
span.rvts10
{
}
span.rvts11
{
font-weight: bold;
}
span.rvts12
{
font-family: 'arial rad';
}
span.rvts13
{
font-style: italic;
font-weight: bold;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
.rvps2 /* Indent */
{
text-indent: 5px;
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
.rvps3 /* DoubleIndent */
{
margin: 0px 0px 0px 30px;
}
.rvps4
{
background: #ff0000;
margin: 10px 0px 10px 0px;
}
.rvps5
{
text-align: center;
}
.rvps6
{
background: #c0c0c0;
margin: 10px 0px 10px 0px;
}
.rvps7
{
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
.rvps8
{
text-indent: 5px;
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
doesn't seem to matter of the rvHtmlImporter1.rtfreadproperties.
/* ========== Text Styles ========== */
hr { color: #000000}
body, table, span.rvts0 /* Normal text */
{
font-size: 10pt;
font-family: 'Arial', 'Helvetica', sans-serif;
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* MSDS Header */
{
font-size: 40pt;
font-weight: bold;
}
span.rvts2 /* Material Safety Data Sheet */
{
font-size: 16pt;
font-weight: bold;
}
span.rvts3 /* ChemicalName ID */
{
font-size: 14pt;
font-family: 'Arial Rad';
color: #000080;
}
span.rvts4 /* ChemicalNameSize10 */
{
font-family: 'Arial Rad';
}
span.rvts5 /* Bold Italic */
{
font-style: italic;
font-weight: bold;
}
span.rvts6 /* Bold */
{
font-weight: bold;
}
span.rvts7
{
font-size: 40pt;
font-weight: bold;
}
span.rvts8
{
font-size: 16pt;
font-weight: bold;
}
span.rvts9
{
font-size: 14pt;
font-family: 'arial rad';
color: #000080;
}
span.rvts10
{
}
span.rvts11
{
font-weight: bold;
}
span.rvts12
{
font-family: 'arial rad';
}
span.rvts13
{
font-style: italic;
font-weight: bold;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
.rvps2 /* Indent */
{
text-indent: 5px;
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
.rvps3 /* DoubleIndent */
{
margin: 0px 0px 0px 30px;
}
.rvps4
{
background: #ff0000;
margin: 10px 0px 10px 0px;
}
.rvps5
{
text-align: center;
}
.rvps6
{
background: #c0c0c0;
margin: 10px 0px 10px 0px;
}
.rvps7
{
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
.rvps8
{
text-indent: 5px;
page-break-inside: avoid;
margin: 0px 0px 0px 5px;
}
doesn't seem to matter of the rvHtmlImporter1.rtfreadproperties.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I just tried a simple test with loading a simple HTML containing a table.
Initially, RVStyle1.TextStyles.Count=6
After loading HTML, RVStyle1.TextStyles.Count=7 (one style is added).
After the second loading of the same HTML, RVStyle1.TextStyles.Count=7 (no styles are added, the existing style is reused).
So TrvHtmlViewImporter works as expected.
In your CSS, I really can see duplicate styles (rvts0 = rvts10, rvts6=rvts11, rvts5=rvts13). Are you sure that duplicate styles were added as a result of HTML import? In this case, I need a simple compilable project to reproduce this problem.
Initially, RVStyle1.TextStyles.Count=6
After loading HTML, RVStyle1.TextStyles.Count=7 (one style is added).
After the second loading of the same HTML, RVStyle1.TextStyles.Count=7 (no styles are added, the existing style is reused).
So TrvHtmlViewImporter works as expected.
In your CSS, I really can see duplicate styles (rvts0 = rvts10, rvts6=rvts11, rvts5=rvts13). Are you sure that duplicate styles were added as a result of HTML import? In this case, I need a simple compilable project to reproduce this problem.
I can view the html created upon savehtmlex, which i convert to be stored in SQl, then I reload it via the
HTMLViewer1.LoadFromString(dmcat.adoQMSDSSdsHTML.asstring); //works perfect
RVHtmlViewImporter1.ImportHtmlViewer(HTMLViewer1,RveSDS);
then i resave using savehtmlex and the extra styles are there.
HTMLViewer1.LoadFromString(dmcat.adoQMSDSSdsHTML.asstring); //works perfect
RVHtmlViewImporter1.ImportHtmlViewer(HTMLViewer1,RveSDS);
then i resave using savehtmlex and the extra styles are there.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: