Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/docs/src/content/docs/markforge/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ sidebar:
description: Release history and version notes for @masumdev/markforge.
---

## [0.5.2] - 2026-09-11

### OS-Specific PDF Page Normalization

- **Platform-Aware Blank Page Pruning**:
- Implemented platform-aware handling for Chromium headless print. On Windows (`win32`), DirectWrite renders page bounds with subpixel precision without trailing pages, while on Linux/Unix, trailing overflow blank pages after 100vh sections are cleanly pruned, ensuring exact and consistent page counts across all operating systems.

---

## [0.5.1] - 2026-09-11

### Cross-Platform PDF Back Cover Preservation
Expand Down
8 changes: 8 additions & 0 deletions packages/markforge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to **@masumdev/markforge** will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.2] - 2026-09-11

### Fixed
- **OS-Specific PDF Page Normalization**:
- Implemented platform-aware handling for Chromium headless print. On Windows (`win32`), DirectWrite renders page bounds with subpixel precision without trailing pages, while on Linux/Unix, trailing overflow blank pages after 100vh sections are cleanly pruned, ensuring exact and consistent page counts across all operating systems.

---

## [0.5.1] - 2026-09-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/markforge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@masumdev/markforge",
"version": "0.5.1",
"version": "0.5.2",
"description": "Modern, high-performance Markdown & MDX multi-format document publishing engine and CLI (DOCX, PDF, HTML, and Images) with embedded HTML/CSS, image inliner, and Ink terminal UI.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
8 changes: 8 additions & 0 deletions packages/markforge/src/core/pdf/pdfBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@ export async function buildPdfDocument(



// OS-Specific Handling for Chromium Headless Print:
// In Linux / Unix, Chromium's font rasterizer generates a trailing overflow page after the 100vh back cover section.
// On Windows (DirectWrite / Edge / Chrome), Chromium computes layout with subpixel precision and does NOT produce this trailing page.
// We conditionally remove the trailing overflow page only on non-Windows environments to ensure cross-platform consistency.
if (process.platform !== "win32" && resolved.backCover?.enabled && pdfDoc.getPageCount() > 2) {
pdfDoc.removePage(pdfDoc.getPageCount() - 1);
}

if (resolved.watermark) {
const wmPng = generateWatermarkPngBuffer(chromePath, resolved.watermark);
if (wmPng) {
Expand Down
Loading