Hi,
I am trying to convert an xml file to pdf using an
xsl. IE engine generates the correct pdf (almost correct, that is why I
am trying to use WebKit), Webkit generates a pdf not formatted. Attached
both of them with xsl used.
Below the code; to test engines I
comment declaration of HtmlConverter and Settings accordingly.
WriteFattura_GetWkSettings() has many settings but disabling them result
does not change. I spent all day performing several test without
success, any idea?
Thanks
Private Sub WriteFattura
Dim Writer = Xml.XmlWriter.Create(FullXmlFilename, New System.Xml.XmlWriterSettings With {.Indent = True})
Writer.WriteProcessingInstruction("xml-stylesheet", "type=""text/xsl""
rel='nofollow' rel='nofollow' href=""" & FullXslFilename & """")
WriteXml(Writer)
Writer.Close()
'Dim HtmlConverter As New
Syncfusion.HtmlConverter.HtmlToPdfConverter(Syncfusion.HtmlConverter.HtmlRenderingEngine.WebKit)
Dim HtmlConverter As New
Syncfusion.HtmlConverter.HtmlToPdfConverter(Syncfusion.HtmlConverter.HtmlRenderingEngine.IE)
'Dim Settings = WriteFattura_GetWkSettings()
Dim Settings = WriteFattura_GetIESettings()
HtmlConverter.ConverterSettings = Settings
Dim PdfDocument As Syncfusion.Pdf.PdfDocument
PdfDocument = HtmlConverter.Convert(FullXmlFilename)
PdfDocument.Save(FullPrintFilename)
PdfDocument.Close()
End Sub
Private Function WriteFattura_GetWkSettings() As Syncfusion.HtmlConverter.WebKitConverterSettings
Dim S As New Syncfusion.HtmlConverter.WebKitConverterSettings
S.WebKitPath = Environment.CurrentDirectory & "\QtBinaries"
S.AdditionalDelay = 5000
S.MediaType = Syncfusion.HtmlConverter.MediaType.Print
S.EnableJavaScript = True
S.EnableOfflineMode = True
S.EnableRepeatTableFooter = True
S.EnableRepeatTableHeader = True
Return S
End Function
Private Function WriteFattura_GetIESettings() As Syncfusion.HtmlConverter.IEConverterSettings
Dim S As New Syncfusion.HtmlConverter.IEConverterSettings
S.AdditionalDelay = 5000
S.EnableJavaScript = True
'IESettings.AspectRatio = Syncfusion.HtmlConverter.AspectRatio.KeepWidth
'IESettings.Margin.Left = 130
'IESettings.Margin.Right = 30
'Dim Margin = New Syncfusion.Pdf.Graphics.PdfMargins()
'Margin.All = 30
'IESettings.Margin = Margin
Return S
End Function
Attachment:
Attachments_4ddd5602.zip