Frage

Hello I have the following code and I am trying to convert a html page into a pdf. I am using abcpdf.

My code is below :

Doc theDoc = new Doc();
    theDoc.Rect.Inset(72, 144);

    theDoc.Page = theDoc.AddPage();
    int theID;
    **theID = theDoc.AddImageUrl("http://www.templateworld.com/free_templates.html/");**

    while (true)
    {
        theDoc.FrameRect(); // add a black border
        if (!theDoc.Chainable(theID))
            break;
        theDoc.Page = theDoc.AddPage();
        theID = theDoc.AddImageToChain(theID);
    }

    for (int i = 1; i <= theDoc.PageCount; i++)
    {
        theDoc.PageNumber = i;
        theDoc.Flatten();
    }

    theDoc.Save(Server.MapPath("pagedhtml.pdf"));
    theDoc.Clear();

At the following line :

theID = theDoc.AddImageUrl("http://www.templateworld.com/free_templates.html/");

it throws an error saying "HTML render is blank". I tried the same on Firefox and chrome too. I tried using other urls too. I get the same error.

Anyone know of any solution to this problem ?

War es hilfreich?

Lösung 2

Both the answers by trueamerican420 and McAden really helped.

I am using ABCPDF version 7 on Internet explorer 10. I removed the update and downgraded to internet explorer 9. and everything works perfectly now

Andere Tipps

Check out this other Stack Overflow article. Maybe it will help you out.

ABCPDF6 issue: "HTML render is blank" but web page output is fine

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top