Skip to main content

Publish a PDF

Optimize a PDF without rasterizing pages

Apply deterministic lossless PDF optimization, deduplication, compression, or Fast Web View and retain the original when a candidate is not smaller.

Practical steps

Optimize a PDF with an explicit profile

Choose a lossless policy, inspect the candidate result, and keep the smaller safe artifact.

  1. SelectChoose one PDF and note its original size.
  2. ProfileChoose Balanced, Maximum Compression, Web, or Archival behavior.
  3. ReviewDownload the result and inspect saved bytes, actions, skipped opportunities, and linearization evidence.

OfficeIMO optimization works on PDF structure and streams without rasterizing pages. Text remains text, and the operation does not deliberately trade fidelity for a smaller scan image.

Optimize from .NET

using OfficeIMO.Pdf;

PdfDocument source = PdfDocument.Open("report.pdf");
PdfOptimizationActionResult result =
    source.Optimization.Apply(PdfOptimizationProfile.Web);

File.WriteAllBytes("report.optimized.pdf", result.Bytes);
Console.WriteLine($"Saved bytes: {result.SavedBytes}");
Console.WriteLine($"Returned original: {result.ReturnedOriginal}");

If the optimized candidate is not smaller, the result can retain the original bytes rather than making the file larger merely to claim success. The action report records requested profile, candidate and returned sizes, applied actions, skipped opportunities, and linearization state.

Compression boundaries

This is not scan downsampling, JPEG recompression, or page rasterization. Those policies can remove selectable text, accessibility information, vector quality, and signature meaning. OfficeIMO keeps that lossy workflow separate until it has explicit quality controls and evidence.