Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Creationg PDF document from HTML string loses background color.

$
0
0
Hi,

I have a XML and XSLT content which is transformed in to a HTML string. Trying to create a PDF document from this HTML string using Pdf.BindHtml. The content is displayed correctly but the background color is missing.

code:
-------
string html = DoTransform(xmlDocument,Xslt stylesheett);
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
pdf.BindHTML(html, "");
pdf.Save(@"FolderLocation");

Attached is the html string from 'DoTransform" and the .pdf file that created using Pdf.BindHtml.

Please help me, how I can achieve the background color to the PDF file as specified in .

Also, is it possible to have multiple Html strings to store in the same PDF file.
I have n documents, where I need to loop through all the documents, get the xml and xslt content. Transform in to html string and save them all to a single PDF file.
I tried saving all the html strings to same PDF file, If I use the same PDF object to save .
e.g:
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
For(int i=0;i
{
string html=doTransform(doc[i],xslt[i]);
pdf.BindHTML(html, "");

}
pdf.Save(@fileLocation);

Am I doing it correct to save different html to a single PDF file?.

Viewing all articles
Browse latest Browse all 3131

Trending Articles