
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
preactjs-pdf
Advanced tools
This is a Preact library for creating PDF documents using a component-based approach, similar to @react-pdf/renderer.
npm install preact-pdf
import { Document, Page, Text, View, PDFViewer } from 'preact-pdf';
const App = () => (
<PDFViewer style={{ width: '100%', height: '100vh' }}>
<Document>
<Page>
<Text>Hello, World</Text>
</Page>
</Document>
</PDFViewer>
);
import { Document, Page, Text, PDFDownloadLink } from 'preact-pdf';
const MyDoc = () => (
<Document>
<Page>
<Text>Hello, World</Text>
</Page>
</Document>
);
const App = () => (
<PDFDownloadLink document={<MyDoc />} fileName="document.pdf">
{({ loading }) => (loading ? 'Loading document...' : 'Download now!')}
</PDFDownloadLink>
);
The library exports the following components:
Document - The root component for a PDF documentPage - Represents a page in the PDF documentView - A container for other componentsText - For displaying textImage - For displaying imagesLink - For creating hyperlinksNote - For adding notes to the PDFSvg - Container for SVG elementsRect, Circle, Line, Path, G, LinearGradient, Stop, Defs - SVG elementsPDFViewer - Component for previewing the PDF in the browserBlobProvider - Component to get the blob of the PDFThe props of these components are basically the same as the component props in @react-pdf/renderer. You can refer to components and svg
FAQs
这是一个 Preact 库,用于通过基于组件的方法创建 PDF 文档,类似于 @react-pdf/renderer。
We found that preactjs-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.