檢視原始碼 wxHtmlEasyPrinting (wx v2.4.3)

這個類別提供了非常簡單的介面來進行列印架構的操作。

它允許您僅使用幾個指令即可列印 HTML 文件。

注意:請勿僅在堆疊上建立此類別。您應該在應用程式啟動時建立一個實例,並將此實例用於所有列印操作。原因是此類別會在其中儲存各種設定。

wxWidgets 文件: wxHtmlEasyPrinting

摘要

函式

銷毀物件

傳回此類別使用的 wxPageSetupDialogData 實例的指標。

傳回此類別使用的 wxPrintData 實例的指標。

等同於 new([])

建構子。

顯示頁面設定對話方塊,並允許使用者修改設定。

預覽 HTML 檔案。

預覽 HTML 文字(非檔案!)。

列印 HTML 檔案。

列印 HTML 文字(非檔案!)。

設定字型。

設定頁尾。

設定頁首。

類型

-type wxHtmlEasyPrinting() :: wx:wx_object().

函式

-spec destroy(This :: wxHtmlEasyPrinting()) -> ok.

銷毀物件

連結到此函式

getPageSetupData(This)

檢視原始碼
-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData()
                          when This :: wxHtmlEasyPrinting().

傳回此類別使用的 wxPageSetupDialogData 實例的指標。

您可以設定其參數(透過 SetXXXX 方法)。

-spec getPrintData(This) -> wxPrintData:wxPrintData() when This :: wxHtmlEasyPrinting().

傳回此類別使用的 wxPrintData 實例的指標。

您可以設定其參數(透過 SetXXXX 方法)。

-spec new() -> wxHtmlEasyPrinting().

等同於 new([])

-spec new([Option]) -> wxHtmlEasyPrinting()
             when Option :: {name, unicode:chardata()} | {parentWindow, wxWindow:wxWindow()}.

建構子。

-spec pageSetup(This) -> ok when This :: wxHtmlEasyPrinting().

顯示頁面設定對話方塊,並允許使用者修改設定。

連結到此函式

previewFile(This, Htmlfile)

檢視原始碼
-spec previewFile(This, Htmlfile) -> boolean()
                     when This :: wxHtmlEasyPrinting(), Htmlfile :: unicode:chardata().

預覽 HTML 檔案。

如果發生錯誤,則傳回 false - 請呼叫 wxPrinter:getLastError/0 以取得有關錯誤類型的詳細資訊。

連結到此函式

previewText(This, Htmltext)

檢視原始碼
-spec previewText(This, Htmltext) -> boolean()
                     when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

等同於 previewText(This, Htmltext, [])

-spec previewText(This, Htmltext, [Option]) -> boolean()
                     when
                         This :: wxHtmlEasyPrinting(),
                         Htmltext :: unicode:chardata(),
                         Option :: {basepath, unicode:chardata()}.

預覽 HTML 文字(非檔案!)。

如果發生錯誤,則傳回 false - 請呼叫 wxPrinter:getLastError/0 以取得有關錯誤類型的詳細資訊。

連結到此函式

printFile(This, Htmlfile)

檢視原始碼
-spec printFile(This, Htmlfile) -> boolean()
                   when This :: wxHtmlEasyPrinting(), Htmlfile :: unicode:chardata().

列印 HTML 檔案。

如果發生錯誤,則傳回 false - 請呼叫 wxPrinter:getLastError/0 以取得有關錯誤類型的詳細資訊。

連結到此函式

printText(This, Htmltext)

檢視原始碼
-spec printText(This, Htmltext) -> boolean()
                   when This :: wxHtmlEasyPrinting(), Htmltext :: unicode:chardata().

等同於 printText(This, Htmltext, [])

-spec printText(This, Htmltext, [Option]) -> boolean()
                   when
                       This :: wxHtmlEasyPrinting(),
                       Htmltext :: unicode:chardata(),
                       Option :: {basepath, unicode:chardata()}.

列印 HTML 文字(非檔案!)。

如果發生錯誤,則傳回 false - 請呼叫 wxPrinter:getLastError/0 以取得有關錯誤類型的詳細資訊。

連結到此函式

setFonts(This, Normal_face, Fixed_face)

檢視原始碼
-spec setFonts(This, Normal_face, Fixed_face) -> ok
                  when
                      This :: wxHtmlEasyPrinting(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata().

等同於 setFonts(This, Normal_face, Fixed_face, [])

-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok
                  when
                      This :: wxHtmlEasyPrinting(),
                      Normal_face :: unicode:chardata(),
                      Fixed_face :: unicode:chardata(),
                      Option :: {sizes, [integer()]}.

設定字型。

有關詳細說明,請參閱 wxHtmlDCRenderer::SetFonts (在 wx 中未實作)。

連結到此函式

setFooter(This, Footer)

檢視原始碼
-spec setFooter(This, Footer) -> ok when This :: wxHtmlEasyPrinting(), Footer :: unicode:chardata().

等同於 setFooter(This, Footer, [])

-spec setFooter(This, Footer, [Option]) -> ok
                   when
                       This :: wxHtmlEasyPrinting(),
                       Footer :: unicode:chardata(),
                       Option :: {pg, integer()}.

設定頁尾。

可以在其中使用下列巨集: @DATE@ 會被替換為預設格式的目前日期 @PAGENUM@ 會被替換為頁碼 @PAGESCNT@ 會被替換為總頁數 @TIME@ 會被替換為預設格式的目前時間 @TITLE@ 會被替換為文件標題

連結到此函式

setHeader(This, Header)

檢視原始碼
-spec setHeader(This, Header) -> ok when This :: wxHtmlEasyPrinting(), Header :: unicode:chardata().

等同於 setHeader(This, Header, [])

-spec setHeader(This, Header, [Option]) -> ok
                   when
                       This :: wxHtmlEasyPrinting(),
                       Header :: unicode:chardata(),
                       Option :: {pg, integer()}.

設定頁首。

可以在其中使用下列巨集

  • @DATE@ 會被替換為預設格式的目前日期

  • @PAGENUM@ 會被替換為頁碼

  • @PAGESCNT@ 會被替換為總頁數

  • @TIME@ 會被替換為預設格式的目前時間

  • @TITLE@ 會被替換為文件標題