Kind: Service
Source: Pams/Core/Pams.Core/Pams.Core.csproj (line 1)
Part of: Pams
NuGet package dependency
itextsharp.xmlworker is a NuGet package dependency referenced by Pams.Core.csproj. It supports XHTML and CSS processing when Pams.Core generates PDF content from markup.
Diagram
mermaidsequenceDiagram participant Client participant PamsCore as Pams.Core participant XMLWorker as itextsharp.xmlworker participant PDF as PDF Output Client->>PamsCore: Send HTML content PamsCore->>XMLWorker: Parse XHTML and CSS XMLWorker-->>PamsCore: Render PDF elements PamsCore->>PDF: Write generated document PDF-->>Client: Return PDF data
Usage
tsasync function generatePdf(html: string): Promise<Blob> {
const response = await fetch("/api/documents/pdf", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ html }),
});
if (!response.ok) {
throw new Error("PDF generation failed");
}
return response.blob();
}
const pdf = await generatePdf(`
<html>
<body>
<h1>Document title</h1>
<p>Content rendered by Pams.Core with itextsharp.xmlworker.</p>
</body>
</html>
`);
AI Coding Instructions
- Keep
itextsharp.xmlworkerreferenced through thePams.Coreproject dependency rather than from client-side code. - Pass valid XHTML and supported CSS when generating PDF markup.
- Treat HTML input as untrusted unless it has been validated or sanitized before PDF generation.
- Keep PDF generation logic in the .NET service layer; JavaScript clients should send markup or document data through an application API.
Used by
1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Injected or called by (1)
Pams.Core—Pams/Core/Pams.Core/Pams.Core.csproj:1
Was this page helpful?