Generate HTML

0
Hi,  I create an Entity with generalization System.FileDocument. In a microflow i use the activity Generate document for generate html file and download file. I download my document without problem but it's a XSL Fo Document...  how can i have directly the html and not a XSL ?    
asked
3 answers
1

Hi Dylan,

Are you trying to get the html string? Or a different format when you download the html file?

If you are trying to get the html string, you can try using the community commons java action "stringFromFile"

answered
0

Hi, 

I print the content before the generation all is fine, no "extra-xml". I try pdf format, its better the file content only my html string.

I'll try with the "StringFromFile" 

answered
0

@Ronald Catersels 

screen of my generate document activity, html is selected.

Here you have an extract of the result generate document :

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>XSL FO Document</title><META http-equiv="Content-Style-Type" content="text/css"><style type="text/css">
        a { color: black; border: none; text-decoration: none; }
        img { border: none; }
      </style></head><body bgcolor="white" marginwidth="6" marginheight="6" leftmargin="6" topmargin="6"><br><div valign="top"><div style="color: #000000; font-family: arial; font-size: 10pt; font-style: normal; font-weight: normal;"><div><table style="text-align: left;" valign="top" cellspacing="0pt"><tbody><tr><td style="padding: 0pt; text-align: left;"><pre style="white-space: pre-wrap;"><div></div></pre></td></tr><tr><td style="padding: 0pt; text-align: left;"><pre style="white-space: pre-wrap;"><div><pre style="white-space: pre-wrap;"><div>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&#xD;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
&lt;head&gt;&#xD;
&lt;meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8"/&gt;&#xD;
&lt;meta http-equiv="X-UA-Compatible" content="IE=8"/&gt;&#xD;
&lt;title&gt;Template_Test_CV&lt;/title&gt;&#xD;
&lt;/head&gt;&#xD;
&lt;body style="margin:auto;"&gt;&#xD;
&lt;link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"&gt;&lt;table border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff;white-space:normal;"&gt;&lt;tr&gt;&lt;td width="50%" style="background-color:#ffffff;"/&gt;&#xD;
&lt;td width="37" height="1" valign="top" style="background-color:#ffffff;min-width:37px;"&gt;&lt;div style="height:1"&gt;&lt;img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="37" height="1" border="0" style="display:block;"/&gt;&#xD;
&lt;/div&gt;&lt;/td&gt;&#xD;
&lt;td width="718" height="1" valign="top" style="background-color:#ffffff;min-width:718px;"&gt;&lt;div style="height:1"&gt;&lt;img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="718" height="1" border="0" style="display:block;"/&gt;&#xD;
&lt;/div&gt;&lt;/td&gt;&#xD;
&lt;td width="2" height="1" valign="top" style="background-color:#ffffff;min-width:2px;"&gt;&lt;div style="height:1"&gt;&lt;img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="2" height="1" border="0" style="display:block;"/&gt;&#xD;
&lt;/div&gt;&lt;/td&gt;&#xD;
&lt;td width="37" height="1" valign="top" style="background-color:#ffffff;min-width:37px;"&gt;&lt;div style="height:1"&gt;&lt;img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="37" height="1" border="0" style="display:block;"/&gt;&#xD;
&lt;/div&gt;&lt;/td&gt;&#xD;
&lt;td width="50%" style="background-color:#ffffff;"/&gt;&#xD;
&lt;/tr&gt;&#xD;

If you copy-paste this code in a html file and open it with a browser you'll see the html code below. 

Here is the content of my FileDocument. it's what you can see if you copy-paste the code above:

(Result is a blank page but it's normal) 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
<title>Template_Test_CV</title>
</head>
<body style="margin:auto;">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"><table border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff;white-space:normal;"><tr><td width="50%" style="background-color:#ffffff;"/>
<td width="37" height="1" valign="top" style="background-color:#ffffff;min-width:37px;"><div style="height:1"><img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="37" height="1" border="0" style="display:block;"/>
</div></td>
<td width="718" height="1" valign="top" style="background-color:#ffffff;min-width:718px;"><div style="height:1"><img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="718" height="1" border="0" style="display:block;"/>
</div></td>
<td width="2" height="1" valign="top" style="background-color:#ffffff;min-width:2px;"><div style="height:1"><img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="2" height="1" border="0" style="display:block;"/>
</div></td>
<td width="37" height="1" valign="top" style="background-color:#ffffff;min-width:37px;"><div style="height:1"><img src="images/04336836571352041FC1A2DDA7CC73D3D23C4C57.png" alt="" width="37" height="1" border="0" style="display:block;"/>
</div></td>
<td width="50%" style="background-color:#ffffff;"/>
</tr>

 

 

all works 

I use the stringToFile to set my fileDocument content, delete the generate Document and now when i download my fileDocument all is correct !

Thank !

answered