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.

Thu Sep 22, 2016 10:36 am

When I convert HTML to PDF using Spire.pdf maximum pages is 30. Why? Can you help me to solve this problem?

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Fri Sep 23, 2016 2:24 am

Dear goga77,

Thanks for your inquiry.
There is no any limitations on the page count when convert html to PDF. And sorry that we cannot reproduce the issue you mentioned at our end.
Could you please provide us the HTML and the codes you were using so that we can look into it further ?

Thanks,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 23, 2016 6:29 am

Dim htmlLayoutFormat As New PdfHtmlLayoutFormat() With { _
.IsWaiting = True, _
.LoadHtmlTimeout = 1000000, _
.Layout = PdfLayoutType.Paginate, _
.FitToHtml = Clip.Both _
}

Dim path As String = Dts.Variables("User::PDFName").Value.ToString


Dim setting As New PdfPageSettings()

setting.Size = PdfPageSize.A4

pdf.PageScaling = PdfPrintPageScaling.ActualSize


For Each row As DataRow In dt.Rows
For Each column As DataColumn In dt.Columns
stringhtml += row(column.ColumnName).ToString()
Next
stringhtml += vbCr & vbLf
Next

pdf.LoadFromHTML(stringhtml, True, setting, htmlLayoutFormat)

pdf.SaveToFile(path, FileFormat.PDF)
pdf.Close()
pdf.Dispose()

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Fri Sep 23, 2016 7:17 am

Dear goga77,

Thanks for the codes.
I have tesed the codes with Spire.PDF Pack(Hot Fix) Version:3.7.292 and found you use PdfLayoutType.Paginate and FitToHtml = Clip.Both together, and it will throw an expection. So I comment FitToHtml = Clip.Both. Finally, I can create a pdf which has 170 pages. Please make sure the html code you used is unbroken. And if the issue still exists, please provide us your sample HTML for investigation.
Here is my testing code for your kind reference:
Code: Select all
Dim dt As New DataTable()
dt.Columns.Add("test", GetType(String))
For i As Integer = 0 To 4999
   dt.Rows.Add("<p>testing</p>")
Next

Dim pdf As New PdfDocument()
   'FitToHtml = Clip.Both
Dim htmlLayoutFormat As New PdfHtmlLayoutFormat() With { _
.IsWaiting = True, _
 .LoadHtmlTimeout = 1000000, _
.Layout = PdfLayoutType.Paginate _
}

Dim stringhtml As String = Nothing
For Each row As DataRow In dt.Rows
   For Each column As DataColumn In dt.Columns
      stringhtml += row(column.ColumnName).ToString()
   Next
Next

Dim setting As New PdfPageSettings()
setting.Size = PdfPageSize.A4
pdf.PageScaling = PdfPrintPageScaling.ActualSize
pdf.LoadFromHTML(stringhtml, True, setting, htmlLayoutFormat)
pdf.SaveToFile("8642.pdf", FileFormat.PDF)


Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 23, 2016 8:14 am

I coment "FitToHtml = Clip.Both", actualy that was just a try. Does not work. Spire always try to pack PDF to 30 page max. Sometimes when a html string is not so big it pass but with very small letter. When is very big it cut it on 30 page.

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Fri Sep 23, 2016 8:35 am

Dear goga77,

Thanks for your prompt reply.
Please provide us sample html code so that we can look into it.

Thanks in advance,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 23, 2016 9:28 am

This is one sample html.

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Fri Sep 23, 2016 10:01 am

Dear goga77,

Thanks for your HTML code.
We will look into this issue. In addition, there is another method to convert HTML to PDF, please have a try.
http://www.e-iceblue.com/Tutorials/Spir ... lugin.html
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 23, 2016 2:02 pm

It does not work.

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Mon Sep 26, 2016 3:05 am

Dear goga77,

Sorry for late reply as weekend.
Here is a demo which includes two methods to convert HTML to PDF for your kind reference.
http://www.e-iceblue.com/downloads/atta ... ethods.zip
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Sep 29, 2016 8:46 am

Dear goga77,

Did you test the demo ? Has your issue been resolved ?

Thanks,
Betsy
E-iceblue support team
User avatar

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

Fri Oct 21, 2016 8:45 pm

I want to convert html to pdf in SSIS package. I do not know where to copy new plugin.

goga77
 
Posts: 7
Joined: Fri Mar 04, 2016 8:22 am

Mon Oct 24, 2016 6:09 am

Dear goga77,

Thanks for your inquiry.
Here is the article(http://www.e-iceblue.com/Tutorials/Spir ... lugin.html). Please click HTMLConvertor-0.2.3.3.zip, it will download a package, and then unzip it, you can find the folder 'plugins'.
And then copy the folder 'plugins' under the same folder of Spire.Pdf.dll. Or add the following code to specify the plugins path directly, as below.
Code: Select all
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.PluginPath = @"F:\demo\SSIS\plugins\";

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Oct 28, 2016 8:36 am

Dear goga77,

How is your issue now ? Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar

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

Wed Sep 01, 2021 2:25 pm

I am working on converting a Html file to PDF using Spire.PDF 2.6.0 and Spire.Doc 9.7.14. I am using .Net Core 3.1. The html file had style and page breaks. However the generated PDF file doesn't look like the html file, the text is overlapping and on the top of it the document shows html tags and this text is superimposed "Evaluation Warning: The document was created with Spire.Doc for .NET". We are using license version of Spire. We need technical support to resolve this issue. Please advise how to engage support team to fix it

Thanks

anayak22
 
Posts: 1
Joined: Wed Sep 01, 2021 2:12 pm

Return to Spire.PDF