Skip to content

Latest commit

 

History

History
180 lines (127 loc) · 6.88 KB

README.it.md

File metadata and controls

180 lines (127 loc) · 6.88 KB

Librerie e strumenti da riga di comando Office-to-PDF leggeri, veloci e nativi per .NET.

NuGet GitHub stars DOI License

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Italiano | Français

Demo online · Release · Segnala un problema

La tua stella o donazione può rendere MiniPdf migliore.

🤝 Cerchiamo co-sviluppatori: Contribuisci subito

MiniPdf converte direttamente i documenti Office in PDF senza richiedere Microsoft Office, LibreOffice, Adobe Acrobat o automazione COM durante l'esecuzione.

.NET

Implementazione Input Interfacce Maturità Documentazione Risultati visivi
.NET XLSX, DOCX, PPTX Libreria, CLI, binari Native AOT Stabile Guida .NET XLSX
DOCX
PPTX

Avvio rapido

.NET

dotnet add package MiniPdf
using MiniSoftware;

MiniPdf.ConvertToPdf("workbook.xlsx", "workbook.pdf");
MiniPdf.ConvertToPdf("report.docx", "report.pdf");
MiniPdf.ConvertToPdf("slides.pptx", "slides.pdf");

byte[] pdfBytes = MiniPdf.ConvertToPdf("report.docx");

Per la riga di comando:

dotnet tool install --global MiniPdf.Cli
minipdf report.docx -o report.pdf
minipdf workbook.xlsx -o workbook.pdf --compress
minipdf slides.pptx -o slides.pdf
minipdf --help

Per l'uso, consulta la guida .NET.

Usage examples

Convert streams

using System.IO;
using MiniSoftware;

using var input = File.OpenRead("report.docx");
using var output = File.Create("stream-output.pdf");
MiniPdf.ConvertToPdf(input, output);

Dispose the input and output streams in the calling code. Use the overload returning byte[] when an in-memory result is needed.

Select Excel sheets and control layout

using MiniSoftware;

MiniPdf.ConvertToPdf("workbook.xlsx", "summary.pdf", new MiniPdfConversionOptions
{
    Sheets = new[] { "Summary" },
    Landscape = true,
    FitToPage = true,
    Compress = true,
});

Sheet names, 1-based SheetIndexes, orientation, print scale, and fit-to-page options apply to XLSX input. See the conversion options for the complete list.

Set Word page size and margins

using MiniSoftware;

MiniPdf.ConvertToPdf("report.docx", "a4-report.pdf", new MiniPdfConversionOptions
{
    PageSize = MiniPdfPageSize.A4,
    Margins = new MiniPdfMargins(left: 36, top: 48, right: 36, bottom: 48),
});

PageSize and Margins apply to DOCX input. Dimensions use PDF points: 72 points equal one inch. They do not override XLSX worksheet or PPTX slide sizes.

Reduce memory for large, simple Excel tables

using System.IO;
using MiniSoftware;

using var input = File.OpenRead("workbook.xlsx");
using var output = File.Create("low-memory.pdf");
MiniPdf.ConvertToPdf(input, output, new MiniPdfConversionOptions
{
    LowMemory = true,
    Compress = true,
});

Low-memory XLSX conversion requires writable temporary storage. Features such as formulas, merged cells, and drawings are unsupported and return an error; there is no automatic fallback. Read the supported features and limitations before enabling it. Returning byte[] still retains the complete PDF in memory.

Provide fonts for headless hosts

using System.IO;
using MiniSoftware;

MiniPdf.RegisterFont("Arial", File.ReadAllBytes(Path.Combine("Fonts", "arial.ttf")));
MiniPdf.ConvertToPdf("report.docx", "font-report.pdf");

Supply licensed .ttf or .ttc files that contain the required glyphs. Register fonts once at application startup: registrations are process-wide. MiniPdf does not distribute these font files.

See the .NET library guide and CLI reference for more examples and options.

Perché MiniPdf

  • Nessuna suite Office richiesta: la conversione viene eseguita nell'applicazione o nella CLI.
  • Distribuzione essenziale: poche dipendenze e nessun processo esterno.
  • Adatto a server e CI: funziona in container, servizi cloud e pipeline.

MiniPdf punta alla conversione pratica dei documenti, non alla compatibilità completa con il layout di Microsoft Office. I modelli complessi possono essere visualizzati diversamente; usa la demo online o i report di benchmark per valutare file rappresentativi.

Contributing

See the contribution guide for setup, tests, and reviews. For bug reports, include a small input file and the steps needed to reproduce the problem.

Risorse del progetto

Risorsa Descrizione
Demo online Prova la conversione nel browser
Documentazione .NET Uso della libreria stabile e della CLI
Benchmark XLSX .NET Risultati visivi per i fogli di calcolo
Benchmark DOCX .NET Risultati visivi per i documenti
Governance della comunità Decisioni, ruoli, votazioni e selezione dei maintainer
Roadmap Ambito del progetto, stato delle implementazioni e priorità
Sicurezza Segnalazione privata delle vulnerabilità e versioni supportate
Contribuire Ambiente, test, revisioni e requisiti di provenienza
GitHub Releases Pacchetti e binari autonomi
Issues Bug, problemi di compatibilità e richieste di funzionalità

Licenza

Apache License 2.0. L'uso commerciale è benvenuto.