![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
fluent-poppler
Advanced tools
A Node.js wrapper for pdftoppm (from poppler-utils) that converts PDF files to various image formats with extensive configuration options.
$ npm install fluent-poppler
This package requires poppler-utils
to be installed on your system:
$ sudo apt-get install poppler-utils
$ brew install poppler
Download and install poppler from: Poppler Packaged for Windows
The PdfInfo class extracts metadata and information from PDF files.
import { PdfInfo } from 'fluent-poppler';
// Initialize with file path or buffer
const pdfInfo = new PdfInfo('path/to/file.pdf');
// OR
const buffer = Buffer.from('...');
const pdfInfoFromBuffer = new PdfInfo(buffer);
const info = await pdfInfo
.firstPage(1) // Start from specific page
.lastPage(5) // End at specific page
.boxInfo() // Include page box information (MediaBox, CropBox, etc)
.metadata() // Include document metadata
.customMetadata() // Include custom metadata
.javaScript() // Include JavaScript content
.structure() // Include document structure (Tagged-PDF)
.structureText() // Include structural text content
.urls() // Include all URLs in annotations
.isoDates() // Use ISO-8601 date format
.rawDates() // Use raw date format
.execute();
// Example response
console.log(info);
/* {
fileName: "example.pdf",
title: "Document Title",
author: "Author Name",
creator: "PDF Creator",
producer: "PDF Producer",
creationDate: "2024-01-01T12:00:00Z",
modDate: "2024-01-02T12:00:00Z",
tagged: true,
pageCount: 5,
encrypted: false,
pageSize: {
width: 612,
height: 792
},
fileSize: 1024576,
optimized: true,
linearized: false
} */
StreamPdfToPpm converts PDF pages to image buffers in memory.
import { StreamPdfToPpm } from 'fluent-poppler';
const converter = new StreamPdfToPpm()
.input('path/to/file.pdf');
// JPEG output with options
converter.jpeg({
quality: 100, // 0-100
progressive: true, // Enable progressive encoding
optimize: true // Enable optimization
});
// PNG output
converter.png();
// TIFF output with compression
converter.tiff('none' | 'packbits' | 'jpeg' | 'lzw' | 'deflate');
// Monochrome output
converter.monochrome();
// Grayscale output
converter.grayscale();
converter
.resolution(300) // Set DPI
.resolutionXY(300, 150) // Set different X/Y DPI
.scaleTo(1000) // Scale to fit within 1000 pixels
.scaleToXY(800, 600) // Scale to exact dimensions
.crop(100, 100, 500, 500) // Crop output (x, y, width, height)
.cropSquare(500); // Crop to square
converter
.antiAliasing(true, true) // Font and vector anti-aliasing
.thinLineMode('none' | 'solid' | 'shape')
.freeType(true) // Enable FreeType font renderer
.forcePageNumber() // Force page numbers in output
.overprint(); // Enable overprint preview
converter
.ownerPassword('ownerpass') // Set owner password
.userPassword('userpass'); // Set user password
// Convert single page
const buffer = await converter.convert(1);
await writeFile('page-1.jpg', buffer);
// Convert multiple pages in parallel
const pageCount = 5;
const buffers = await Promise.all(
Array.from({ length: pageCount }, (_, i) =>
converter.convert(i + 1)
)
);
PdfToPpm converts PDF pages to image files on disk.
import { PdfToPpm } from 'fluent-poppler';
const converter = new PdfToPpm()
.input('path/to/file.pdf')
.outputPrefix('output/page');
const fileNames = await converter
.firstPage(1) // Start from page 1
.lastPage(5) // End at page 5
.jpeg({ // Output as JPEG
quality: 90,
progressive: true,
optimize: true
})
.resolution(300) // Set resolution
.convert();
console.log(fileNames);
// ['output/page-1.jpg', 'output/page-2.jpg', ..., 'output/page-5.jpg']
converter
// Quality settings
.antiAliasing(true, true)
.thinLineMode('solid')
.freeType(true)
// Layout
.scaleTo(1000)
.crop(0, 0, 500, 500)
// Security
.ownerPassword('pass')
.userPassword('pass')
// Output control
.forcePageNumber()
.overprint();
try {
await converter.convert();
} catch (error) {
if (error.message.includes('not found')) {
console.error('Poppler utilities not installed');
} else if (error.message.includes('permission denied')) {
console.error('PDF is password protected');
} else {
console.error('Conversion failed:', error);
}
}
// Set custom Poppler path
import { setPopplerPath } from 'fluent-poppler';
setPopplerPath('/usr/local/bin');
// Or use environment variable
process.env.POPPLER_PATH = '/usr/local/bin';
// Otherwise location of the executable will be located via `which`
FAQs
A fluent API to Poppler (https://poppler.freedesktop.org/)
We found that fluent-poppler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.