Welcome Guest Search | Active Topics | Sign In | Register

htmltopdf html tags inside acmtables Options
Nuno Nogueira
Posted: Friday, September 2, 2011 2:01:14 PM
Rank: Member
Groups: Member

Joined: 2/24/2011
Posts: 25
I would like to get some example of working with pdfcreator and htmltopdf.converthtml.

I usually create the tables in pdfcreator, and would like to put in the rows html converted.

From what I saw, the htmltopdf.converthtml saved directly to another page, document, or stream, sending the converted content into a table cell?

Example:


Dim htmlStr as string
HtmlToPdf.ConvertHtml("<div><span style=""color:#f00;"">TEXTHERE</span></div>", htmlStr)

Dim table As New AcmTable(-1,4)
CreateTableRow(table, "PlainText",htmlStr)

Someome can help me ?
eo_support
Posted: Friday, September 2, 2011 2:08:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

No. You don't use PDFCreator and HTML to PDF together that way. You can use them together, but usually for different "layers". For example, using HTML to PDF to output the main content at the bottom, then use PDF Creator to place a large "CONFIDENTIAL" stamp on top of it. Usually you would not use one method to render something inside an element of the other method ---- it is technical possible, but you would be basically calculating the layout yourself and that often is more complicated than using either method alone.

In your case, if you just need to have some text with different color in a table cell, you can use AcmText for that. Or you can use a single ConvertHtml that includes a <table> element to render the whole table. Either way will be easier than using AcmTable to do the table and ConvertHtml to do the table cell text.

In your case, just create the whole thing as an HTML table and then send it off to ConvertHtml should be the easiest way.

Thanks
Nuno Nogueira
Posted: Friday, September 2, 2011 2:25:18 PM
Rank: Member
Groups: Member

Joined: 2/24/2011
Posts: 25
Well, I'm trying to use your solution to build a PDF report.

Within this report there is a static content and some dynamic to the static already did all the work, now need to get a way to insert into these cells of HTML tables created content already converted. This content comes from my database in HTML format, you need to convert to insert into your acmtable.

It's not just color adjustments are made in these html's, if only it was easy to solve using the technique that you gave me.

So, this is not even possible? It makes no sense to convert some html tags and entire documents or entire pages, when we could use this conversion into smaller pieces, does not agree with me? Strange that, if you can help me thank you.
eo_support
Posted: Friday, September 2, 2011 2:51:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can do that but like I said you don't put one thing inside another. If you know where the empty table cell is, then you can set HtmlToPdf.Options.OutputArea to lock onto that position and have ConvertHtml to output straight to that position. Otherwise you will have to calculate where that table cell is (and how big) yourself first. That makes it harder to use than constructing a whole page and then call ConvertUrl or ConvertHtml to do the whole thing.

Most people won't use AcmRender to do a full report because it's just too much work. What they do is to create an ASPX page to render the report. You can code your page whatever way you want. For example, if you just want to update a table cell, put a Label there and then update that Label with your code. Once you produce the report in the browser, either call ConvertUrl on the page Url, or use ASPXToPDF control to render the whole page to PDF.

So what I am trying to say is : everything is possible, but there is a hard way and there is an easy way. If you stick with the hard way it will just waste yourself more time. So you need to trust us on this: do it with a full page will be much easier.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.