簡體   English   中英

文檔周圍出現空白以進行預覽

[英]White spaces appear around the document to preview

我有使用打印的WPF應用程序。 我有從“ DocumentPaginator”繼承的類

class ReportPaginator : DocumentPaginator
{
    private Size pageSize;

    public override IDocumentPaginatorSource Source
    {
        get { return null; }
    }

    public override bool IsPageCountValid
    {
        get { return true; }
    }

    public override int PageCount
    {
        get { return pageCount; }
    }

    public override Size PageSize
    {
        get { return pageSize; }
        set
        {
            if (value != null)
            {
                pageSize = value;
                CalculatesPage();
            }
        }
    }

    public override DocumentPage GetPage(int pageNumber)
    {
       // some code.
    }  
}

當我從此分頁器獲得FixedDocumentSequence時,可以在打印之前預覽文檔。 “ pageSize”屬性不適用於此DocumentPage,並且頁面周圍有空格如何解決此問題

僅當有人遇到相同問題的情況下。
我的問題是在我自己的代碼中(特別是在GetPage()方法中生成Page的部分GetPage() ,當實現GetPage方法時,我在頁面本身周圍生成了空白。

如果您遇到相同的問題,則可能需要GetPage檢查GetPage方法可能會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM