-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Printers
- Mobile Printing & Cloud Printing
- How to print border less from android without any plugin and...

Create an account on the HP Community to personalize your profile and ask a question
05-23-2024 04:03 AM
How can I implement borderless printing of PDFs in my Android application without relying on plugins? I need to ensure that when users print PDF documents through my app, the printed output has no borders or margins. How can I achieve this functionality within my app's printing feature?
05-25-2024 08:30 AM
Hi @Tatarao,
Welcome to HP Support Community.
Thank you for posting your query, I will be glad to help you.
To achieve borderless printing of PDFs from your Android application without relying on plugins, you can utilize the Android Print Framework along with PDF rendering libraries. Here's a general outline of the steps you can follow.
- PDF Rendering: Choose a PDF rendering library compatible with Android, such as PdfiumAndroid or AndroidPdfViewer. These libraries allow you to render PDF documents within your app.
- Custom Print Document Adapter: Implement a custom PrintDocumentAdapter to handle the printing process. This adapter will be responsible for rendering the PDF content and preparing it for printing.
- Set Print Attributes: Configure the print attributes to specify the desired print settings, including borderless printing. You can set attributes like media size, margins, and color mode.
- Render PDF Content: Use the chosen PDF rendering library to render the PDF content onto the printed page. Ensure that the rendering process accounts for any necessary adjustments to achieve borderless printing.
- Handle Printing: Implement the printing functionality in your app, allowing users to select a PDF document and initiate the printing process. Use the custom PrintDocumentAdapter to handle the printing task.
- Test and Iterate: Test the printing functionality thoroughly to ensure that borderless printing works as expected on different devices and printer configurations.
I hope this helps.
Take care and have a good day.
Please click “Accepted Solution” if you feel my post solved your issue, it will help others find the solution. Click the “Kudos/Thumbs Up" on the bottom right to say “Thanks” for helping!
Alden4
HP Support
HP Support Community Moderator
05-27-2024 11:45 PM
Thank you for your response.
However, I would like to clarify that the Android Print Service does not include a specific option for borderless printing. While there are options to set the size and margins, even when I set the margins to zero and the size to A4, I still receive a printout with a 3 mm whitespace on every side.
For your reference, I have created a repository, which you can find at: https://github.com/dontaskit28/print-pdf-kotlin.
Here is the image, hoe the print looks like:
Could you please advise on how to achieve true borderless printing with this service?
Thank you.
05-28-2024 09:31 AM
Hi @Tatarao,
Thank you for your response,
I'm sending a private message to assist you with the next action.
Please check your Private message icon on the upper right corner of your HP Community profile Next, to your profile Name, you should see a little blue envelope, please click on it or simply click on this link.
I hope this helps! Keep me posted.
Alden4
HP Support
HP Support Community Moderator