Menu

#15 MetaVars added to XML-Output

open
nobody
None
5
2003-09-24
2003-09-24
Lars Werner
No

So far the MetaVars were not written into the XML
output. I implemented this feature by adding the
following method in HtmlOutputDev.cc:
--
GString* HtmlMetaVar::toXmlString()
{
GString *result = new GString("<");
result->append(name);
result->append(">");
result->append(content);
result->append("</");
result->append(name);
result->append(">");
return result;
}
--
I changed the method dumpMetaVars from
--
void HtmlOutputDev::dumpMetaVars(FILE *file)
{
GString *var;

for(int i = 0; i < glMetaVars->getLength(); i++)
{
HtmlMetaVar *t = (HtmlMetaVar*)glMetaVars->get(i);
var = t->toString();
fprintf(file, "%s\n", var->getCString());
delete var;
}
}
--
to
--
void HtmlOutputDev::dumpMetaVars(FILE *file)
{
GString *var;

for(int i = 0; i < glMetaVars->getLength(); i++)
{
HtmlMetaVar *t = (HtmlMetaVar*)glMetaVars->get(i);
if (!xml)
var = t->toString();
else
var = t->toXmlString();
fprintf(file, "%s\n", var->getCString());
delete var;
}
}
--
and inserted the following in the method HtmlOutputDev:
--
fprintf(page,"<title>%s</title>\n",
docTitle->getCString());
dumpMetaVars(page);
--
after fputs("<pdf2xml>\n",page);

Discussion


Log in to post a comment.