Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27136

    content += “

    “;

    PD4ML pd4ml = new PD4ML();
    PD4PageMark header = new PD4PageMark();
    StringBuilder strstyle = new StringBuilder();
    pd4ml.HtmlWidth = (htmlWidth);

    pd4ml.addStyle(“@page : body{font-family: Calibri, Helvetica, sans-serif, Verdana;}.innertext{font-family: Calibri, Helvetica, sans-serif, Verdana;color: #efefef;}”, true);
    pd4ml.enableTableBreaks(true);
    pd4ml.addStyle(“TABLE,DIV {page-break-inside: auto !important}”, true);

    pd4ml.PageSize = PD4Constants.getSizeByName(“A4”);
    Byte[] byteArray = Encoding.ASCII.GetBytes(content);
    MemoryStream stream = new MemoryStream(byteArray);
    pd4ml.render(stream, new System.IO.FileStream(stroutpath, System.IO.FileMode.Create));

    Response.ContentType = “Application/pdf”;
    Response.AppendHeader(“Content-Disposition”, “attachment; filename=” + pdfname + “.PDF”);
    Response.TransmitFile(Server.MapPath(“GeneratePDF/” + pdfname + “.PDF”));
    Response.End();

    stream.Flush();
    stream.Close();
    stream.Dispose();

    #30012

    You may define a page background with the API call:

    [language=java:x8menc5o]PD4PageMark footer = new PD4PageMark();
    // footer.setPageBackgroundColor(Color.green);
    footer.setPageBackgroundImageUrl(“file:i/background.jpeg”);
    pd4ml.setPageFooter(footer); // or setPageHeader() – both methods are ok[/language:x8menc5o]

    #30013

    but im not able to get setPageFooter() keyword so what to do for that is any namespace missing??
    i am getting this error…..

    #30014

    You are right. In C# it can be done slightly different:

    [language=java:1djjzu7x]pd4ml.PageHeader = footer;[/language:1djjzu7x]

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘PD4ML Tips & Tricks’ is closed to new topics and replies.