ABCPDF未显示完整表格数据 [英] ABCPDF not showing full table data

查看:120
本文介绍了ABCPDF未显示完整表格数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参考下图:

由于宽度,它切断了一些表格数据.我的表格宽度超过1000像素.我知道The default document size for ABCpdf is 612 by 792.

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;

我想显示所有表格数据.我需要修改表的大小吗?还是我需要修改pdf的文档页面大小?

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?

谢谢

Siva

推荐答案

阅读HTML之后,我认为我可以为您提供一些解决问题的技巧:

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

1-使用Gecko引擎进行PDF渲染:

1- Use the Gecko Engine for PDF Rendering:

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

在ABCPdf中进行渲染时,Gecko引擎可提供更好的Css遵从性.

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

2-在Css中,将inner-containeroverflow-x设置为scroll.这会导致您看到的行为.我将以下Css添加到Css的底部:

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%;
    }
}

请注意@media print,它使css仅在打印期间有效,并且不会影响它在屏幕上显示的方式.

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

3-最后,您可以尝试使用浏览器宽度进行播放:

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

doc.HtmlOptions.BrowserWidth = 1200;

BrowserWidth属性的唯一问题是它将影响文档的缩放.所有的文字字体都会变小.

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

祝你好运...

这篇关于ABCPDF未显示完整表格数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆