OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to Print HTML as A4 Format Without Rendering in Browser Using Solid.js?

  • Thread starter Thread starter user21662545
  • Start date Start date
U

user21662545

Guest
I need to print a document created using HTML, but it should not be rendered on the screen. When a print button is clicked, the HTML should be printed directly without any preview.

Requirements:

No Screen Rendering: The document must not be rendered on the screen.

A4 Format: The document should be formatted as A4.

Client-Side Only: The solution must be implemented on the client side using Solid.js.

Specific Issues:

Converting HTML to a bitmap image suitable for printing without rendering it in the browser.

Ensuring the document is split into A4-sized pages if the content overflows.

Any guidance or suggestions on how to approach this problem would be greatly appreciated. Thank you!

Note: If there is another solution for printing without using bitmaps feel free to let me know. I just want to print it no matter how.

What I Have Tried:

dom-to-image and html2canvas: These libraries rely on the browser’s rendering to capture a screenshot, but my document should not be rendered on the screen.

Manual Page Splitting: I considered creating an image for each page, but I am unsure how to split the document correctly if the content exceeds the A4 format.

<p>I need to print a document created using HTML, but it should not be rendered on the screen. When a print button is clicked, the HTML should be printed directly without any preview.</p>
<p><strong>Requirements:</strong></p>
<p>No Screen Rendering: The document must not be rendered on the screen.</p>
<p>A4 Format: The document should be formatted as A4.</p>
<p>Client-Side Only: The solution must be implemented on the client side using Solid.js.</p>
<p><strong>Specific Issues:</strong></p>
<p>Converting HTML to a bitmap image suitable for printing without rendering it in the browser.</p>
<p>Ensuring the document is split into A4-sized pages if the content overflows.</p>
<p>Any guidance or suggestions on how to approach this problem would be greatly appreciated. Thank you!</p>
<p>Note: If there is another solution for printing without using bitmaps feel free to let me know. I just want to print it no matter how.</p>
<p><strong>What I Have Tried:</strong></p>
<p>dom-to-image and html2canvas: These libraries rely on the browser’s rendering to capture a screenshot, but my document should not be rendered on the screen.</p>
<p>Manual Page Splitting: I considered creating an image for each page, but I am unsure how to split the document correctly if the content exceeds the A4 format.</p>
 

Latest posts

S
Replies
0
Views
1
Sarertt Pontampon
S
Top