Bihar Police Notebook produces print-ready A4 output directly from the browser. There is no server-side rendering — the app builds the full-geometry print HTML in the browser window and opens the system print dialog, where you can send it to a printer or choose Save as PDF.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/arverma/Bihar-Police-Notebook/llms.txt
Use this file to discover all available pages before exploring further.
Starting a Print or PDF Export
- Keyboard Shortcut
How Export Works
TherunPdfExport() function in editor/js/main.js handles the entire export pipeline:
Build the print HTML
Depending on the active template, the app calls either:
letterPagesHtml(pages)— assembles the letter page cards into a single HTML string with full A4 geometry.diaryPagesHtml(model)— renders each diary page with its FIR header (if shown), the column titles row, and the left/right writing cells at their exact pixel heights.
Load the print stylesheet
The matching CSS (
letterPrintCss() or diaryPrintCss()) is embedded in a <style> tag in the new window. It sets @page { size: A4; margin: 12.7mm; } and all the geometry constants that govern font size, line height, and column widths.Open a new window and wait for fonts
window.open('', '_blank') creates a blank pop-up. The Noto Sans Devanagari font is loaded via a Google Fonts <link>. The app waits for document.fonts.ready before calling window.print() so that Devanagari characters render correctly rather than falling back to a system font.Print dialog opens
The browser’s native print dialog appears. Choose your printer or select Save as PDF, set Paper size to A4, and confirm.
Screen Preview vs. Print Geometry
The on-screen pages may appear smaller than A4 depending on your browser window size. This is a visual-only scale transform applied byinitPageScale() to make pages fit the viewport comfortably — it has no effect on printing.
| Context | Geometry used |
|---|---|
| On-screen preview | Scaled down to fit the viewport (CSS transform: scale(…)) |
| Print / PDF output | Always full unscaled A4 — 210 × 297 mm with 12.7 mm margins |
Saving as PDF in Each Browser
Chrome
In the print dialog, open the Destination drop-down and choose Save as PDF. Set Paper size to A4 under More settings. Click Save.
Firefox
Click Print to File in the printer list, or select the PDF option from the printer drop-down on macOS. Confirm paper size is A4 before saving.
Edge
Select Save as PDF from the Printer drop-down. Edge shares Chromium’s print pipeline so the A4 geometry is identical to Chrome.
Some browsers block pop-ups by default. If the export window does not open, look for a Pop-up blocked notification in your browser’s address bar and click Allow for the Bihar Police Notebook URL, then try again.
Tips for Clean PDFs
- Set paper size to A4. The document geometry is calculated in millimetres for A4. Printing to Letter or other sizes will shift margins and may clip content.
- Set margins to “None” or “Default”. The app already embeds the correct 12.7 mm margin in the print CSS via
@page. Adding browser margins on top will shrink the content area. - Disable headers and footers in the browser’s print settings if you do not want the browser to add the page URL or date to the printed output.
- Keep scale at 100 %. The print CSS uses physical millimetre units; scaling in the print dialog will distort the A4 geometry.