Hello and thank you in advance for your help!
My company (Wespath Benefits and Investments) already has a license for Spire.PDF and Spire.Excel. I am trying to use it, but ran into few issues.
1. I was using Spire.PDF conversion process to convert HTML to PDF, but quality of the PDF text does not satisfactory for us. The text is blurry and kinds of out of focus. So this is my first issue. Any suggestions? Here is my code using Spire.PDF.dll.
Dim pdfDoc As New PdfDocument
Dim pdfSetting As New PdfPageSettings
Dim pdfFormat As New HtmlConverter.PdfHtmlLayoutFormat
pdfDoc.CompressionLevel = PdfCompressionLevel.BestSpeed
pdfDoc.DocumentInformation.Author = "Wespath "
pdfDoc.UseHighQualityImage = True
pdfFormat.Layout = Graphics.PdfLayoutType.Paginate
pdfFormat.FitToPage = HtmlConverter.Clip.Both
pdfSetting.Size = PdfPageSize.Letter
pdfSetting.Orientation = PdfPageOrientation.Portrait
pdfDoc.LoadFromHTML(strHTML, True, pdfSetting, pdfFormat)
pdfDoc.SaveToFile(PdfFileName, Spire.Pdf.FileFormat.PDF)
pdfDoc.Close()
2. I read some of your articles and switches to Spire.Doc.dll instead. The quality of the pdf is MUCH better, but I have few issues with this too.
a. If we decided to go with it, we will buy the license, but can I get a temporary license so I can test it without warning message on the top?
b. Some HTML tags are not recognized by Spire.Doc.dll. For example: <hr> is not converted at all; <table> tag ‘style’ is not recognized till I wrap <table> with <p> tags. Any suggestions?
c. And last one Is there a way to change a page number (in red below) font/size? I only found it for header/footer, but not for a page number. Here is my code.
Using Spire.Doc
Using Spire.Doc.Documents
Dim doc As New Document()
Dim sec As Section
Dim footer As HeaderFooter
Dim footerParagraph As Paragraph
Dim par As Spire.Doc.Documents.Paragraph
doc.BuiltinDocumentProperties.Company = "Wespath"
sec = doc.AddSection
sec.PageSetup.Orientation = PageOrientation.Portrait
sec.PageSetup.PageSize = PageSize.Letter
par = sec.AddParagraph()
footer = sec.HeadersFooters.Footer
footerParagraph = footer.AddParagraph()
footerParagraph.AppendText(" Page ")
footerParagraph.AppendField("page number", FieldType.FieldPage)
footerParagraph.AppendText(" of ")
footerParagraph.AppendField("number of pages", FieldType.FieldNumPages)
footerParagraph.Format.HorizontalAlignment = Documents.HorizontalAlignment.Right
par.AppendHTML(strHTML)
doc.SaveToFile(PdfFileName, Spire.Doc.FileFormat.PDF)
doc.Close()
Tanya Lerner
(847) 866-4329
tlerner@wespath.org