Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
996 views
in Technique[技术] by (71.8m points)

pdf - ABCPDF not showing full table data

Please refer to the image below:

enter image description here

It's cutting off some of the table data because of the width. My table width is more than 1000 px. I know The default document size for ABCpdf is 612 by 792.

Using the code below to set document width and height

            double w = doc.MediaBox.Width;
            double h = doc.MediaBox.Height;
            double l = doc.MediaBox.Left;
            double b = doc.MediaBox.Bottom;
            doc.Transform.Rotate(90, l, b);
            doc.Transform.Translate(w, 0);
            doc.Rect.Width = h;
            doc.Rect.Height = w;

I want to display all tabular data. Do I need to modify my table size? Or do I need to modify the document page size of the pdf?

How could i resolve this issue?

Thanks,

Siva

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After reviewing the HTML, I think that I can give you a few tips on how to resolve your issue:

1- Use the Gecko Engine for PDF Rendering:

doc.HtmlOptions.Engine = WebSupergoo.ABCpdf9.EngineType.Gecko;

The Gecko Engine provides better Css compliance when rendering in ABCPdf.

2- In your Css you have overflow-x set to scroll for the inner-container. This causing the behavior that you are seeing. I would add the following Css to the bottom of the Css:

@media print
{
    .outer-container {
        background-color: #ccc;
        position: absolute;
        top:0;
        left: 0;
        right: 300px;
        bottom:40px;
        overflow: visible;
        width: 100%;
    }
    .inner-container {
        width: 100%;
        height: 100%;
        position: relative;
        overflow-x: visible;

    }

    table
    {
        width: 100%;
    }
}

Notice the @media print which makes the css only effective during print and would not affect that way it shows on the screen.

3- Finally, you can try playing with the browser width:

doc.HtmlOptions.BrowserWidth = 1200;

The only problem with the BrowserWidth property is that it will affect the zoom on the document. All the text fonts will appear smaller.

Good luck...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...