Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Apr 19, 2017 7:16 am

Hi,

I am using Spire.PDF to convert my HTML to PDF but in that I an facing issues like
1) åäutö ÅÄÖ Swedish alphabet are not displayed properly.
2) My requirement is, I need to display one table with few column and headers, and it is long table cannot fit in one page so if page changes, I need to repeat table headers, so how can I do that?

Any solutions for above issues?

Thank You,
Nirmal

nirmalitpath
 
Posts: 4
Joined: Wed Apr 19, 2017 6:44 am

Wed Apr 19, 2017 9:38 am

Dear Nirmal,

Thanks for your inquiry.
1) I have tested the case you mentioned with the latest Spire.PDF Pack(Hot Fix) Version:3.9.27, but didn't find the issue you mentioned. Please try to use this version.
If the issue still happens, please provide us with the HTML and code you were using for testing.
2)Sorry that at present Spire.PDF doesn't support that when converting HTML to PDF.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Apr 19, 2017 10:49 am

Hi Betsy.jiang,

1) I have check this and found same error, please check attachment you will get more idea.

2) If page break happen do we have any event that raised or anything from we can identify that page break will happen?

nirmalitpath
 
Posts: 4
Joined: Wed Apr 19, 2017 6:44 am

Thu Apr 20, 2017 2:36 am

Dear nirmalitpath,

Thanks for the information.
1)Please provide us with the HTML and the code you were using, so we can investigate the issue on our side.
2)Sorry that there is no such way for you to identify if page break happens when converting HTML to PDF.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Apr 20, 2017 6:52 am

Hi Betsy.jiang,

Thank for your help, I found a way to fix it. It is issue if we use different overload of LoadFromHTML method of PdfDocument, that accept a Url of as first argument but if we use overload that accept htmlSourceCode, it works.

Thank You,
Nirmal

nirmalitpath
 
Posts: 4
Joined: Wed Apr 19, 2017 6:44 am

Thu Apr 20, 2017 7:39 am

Dear Nirmal,

Glad to hear that the issue has been fixed.
If you have any question while using our products, please do not hesitate to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Apr 24, 2017 1:18 pm

Hi,

Can I add PdfTable inside a PdfTable cell and HTML string inside PdfTable cell?

Thank You,
Nirmal

nirmalitpath
 
Posts: 4
Joined: Wed Apr 19, 2017 6:44 am

Tue Apr 25, 2017 7:58 am

Dear Nirmal,

Thanks for your inquiry.
Sorry that there is no way to add PdfTable in a PdfTable cell at present, but PdfGrid can achieve this. And sorry that there is no direct way to insert HTML to PdfGrid cell either, it needs to set the position by yourself according to your requirement.
Here is sample code for your kind reference.
Code: Select all
            PdfDocument pdfdoc = new PdfDocument();
            PdfPageBase page = pdfdoc.Pages.Add();
            //create one grid as original grid
            PdfGrid grid = new PdfGrid();
            grid.Columns.Add(2);
            PdfGridRow row = grid.Rows.Add();
            row.Height = 100;
            //create new grid
            PdfGrid SubGrid = new PdfGrid();
            SubGrid.Columns.Add(1);
            SubGrid.Columns[0].Width = 50;
            PdfGridRow row2 = SubGrid.Rows.Add();
            row2.Height = 20;
            row2 = SubGrid.Rows.Add();
            row2.Height = 20;
            //insert the new grid in the first cell of the first row of the original grid
            grid.Rows[0].Cells[0].Value = SubGrid;           
            //draw the grid on page
            grid.Draw(page, new PointF(0, 10));
            //draw HTML to the second cell of the first row of the original grid
            string HTML = "<p>Hello</p>";
            PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", 20f));
            page.Canvas.DrawString(HTML, font, PdfBrushes.Black, grid.Columns[0].Width + 10, 15, true);
            pdfdoc.SaveToFile("10380grid.pdf");

Hope this helps. If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF