列印檔案
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 使用者經常只在裝置上查看內容,但有時在顯示螢幕時,並不適合分享資訊。從 Android 應用程式列印資訊,可讓使用者在應用程式中查看較大尺寸的內容,或是與其他未使用您應用程式的對象分享。此外,列印功能還能讓他們建立資訊快照,不需依賴裝置、電力充足或無線網路連線。
在 Android 4.4 (API 級別 19) 以上版本中,這個架構提供了直接透過 Android 應用程式列印圖片和文件的服務。這項訓練課程會說明如何在應用程式中啟用列印功能,包括列印圖片、HTML 網頁及建立要列印的自訂文件。
課程
-
列印相片
- 本課程將說明如何列印圖片。
-
列印 HTML 文件
- 本課程將說明如何列印 HTML 文件。
-
列印自訂文件
- 本課程將說明如何連線至 Android 列印管理員、建立列印轉接器及建構內容。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Printing files\n\nAndroid users frequently view content solely on their devices, but there are times when\nshowing someone a screen is not an adequate way to share information. Being able to print\ninformation from your Android application gives users a way to see a larger version of the\ncontent from your app or share it with another person who is not using your application.\nPrinting also allows them to create a snapshot of information that does not depend on having a\ndevice, sufficient battery power, or a wireless network connection.\n\n\nIn Android 4.4 (API level 19) and higher, the framework provides services for printing images and\ndocuments directly from Android applications. This training describes how to enable printing in\nyour application, including printing images, HTML pages and creating custom documents for\nprinting.\n\nLessons\n-------\n\n\n**[Printing a photo](/training/printing/photos)**\n: This lesson shows you how to print an image.\n\n\n**[Printing an HTML document](/training/printing/html-docs)**\n: This lesson shows you how to print an HTML document.\n\n\n**[Printing a custom document](/training/printing/custom-docs)**\n: This lesson shows you how you connect to the Android print manager, create a print adapter\n and build content for printing."]]