多くの圧縮PDF ファイルは、さらに圧縮できます。
通常、PDF ファイルのサイズは次のように縮小できます。
- 未使用のオブジェクトの削除 (存在する場合)
- 余分な空白文字をファイルから (ビジュアル コンテンツからではなく) 削除する
- オブジェクト ストリームの使用 (PDF 1.5 の機能)
Crystal Report が PDF をどの程度圧縮できるかはわかりませんが、Docotic.Pdf ライブラリと次のコードを試して、ファイルをより適切に圧縮できるかどうかを確認してください。
public static void CompressExistingDocument(string original, string output)
{
using (PdfDocument pdf = new PdfDocument(original))
{
pdf.SaveOptions.Compression = PdfCompression.Flate;
pdf.SaveOptions.UseObjectStreams = true;
pdf.SaveOptions.RemoveUnusedObjects = true;
pdf.SaveOptions.WriteWithoutFormatting = true;
pdf.Save(output);
}
FileInfo originalFileInfo = new FileInfo(original);
FileInfo compressedFileInfo = new FileInfo(output);
MessageBox.Show(
String.Format("Original file size: {0} bytes;\r\nCompressed file size: {1} bytes",
originalFileInfo.Length, compressedFileInfo.Length));
System.Diagnostics.Process.Start(output);
}
免責事項: 私はライブラリのベンダーで働いています。