0

Heloo ,

I am stuck in this error while generating Pdf from HTML using ABCPdf8 my code is

    Dim PdfDocument As New WebSupergoo.ABCpdf8.Doc()
    Dim PdfId As Integer

    PdfDocument.Page = PdfDocument.AddPage()
    PdfId = PdfDocument.AddImageHtml(HTML)  // Crash over here
    PdfDocument.Transform.Translate(0, -10)

    While True
        If Not PdfDocument.Chainable(PdfId) Then
            Exit While
        End If
        PdfDocument.Page = PdfDocument.AddPage()
        PdfId = PdfDocument.AddImageToChain(PdfId)
    End While

    For index As Integer = 0 To PdfDocument.PageCount Step 1
        PdfDocument.PageNumber = index
        PdfDocument.Flatten()
    Next

    If PdfDocument.PageCount > 1 Then
        PdfDocument.PageNumber = 1
    End If

Same code is working fine on local machine and also on different environment but not working when i deploy it on live as well on some machines also. i have tried all the permission related fixes but not working in my case.

Can any body help me in this ??

Sohail Hameed
  • 978
  • 2
  • 9
  • 25

3 Answers3

3

I've had the same issue and for me it worked adding the next line:

Dim PdfDocument As New WebSupergoo.ABCpdf8.Doc()
Dim PdfId As Integer

PdfDocument.HtmlOptions.Engine=WebSupergoo.ABCpdf8.EngineType.Gecko //add this line
PdfDocument.Page = PdfDocument.AddPage()

[...]
David Aleu
  • 3,922
  • 3
  • 27
  • 48
0

Most likely this is because the older version of ABCpdf which you are using is not compatible with the environment on these newer machines.

Upgrading to the current release should be your first port of call.

For details of supported systems and features for different versions see:

http://www.websupergoo.com/abcpdf-8.htm

0

I had the same issue where on some websites it worked and on some it didn't. These websites were on the same server!

I fixed it like this: - Open IIS Manager - Goto 'Application Pools' - Click on the Name of the application in question - Open the 'Advanced Settings' - Set 'Load user profile' to False - Restart the pool and the website

That did it for me, after more than an hour of searching.