/* Antenna House PDF Tool API V8.0 .Net Interface sample program 概要:レイヤーのフラット化 Copyright 2025 Antenna House, Inc. */ using System; using PdfTkNet; namespace FlatLayer { class Program { static void Main(string[] args) { if (args.Length < 2) { Console.WriteLine("usage: FlatLayer.exe in-pdf-file out-pdf-file"); return; } try { using (PtlParamInput input = new PtlParamInput(args[0])) using (PtlParamOutput output = new PtlParamOutput(args[1])) using (PtlPDFDocument doc = new PtlPDFDocument()) { // PDFファイルをロードします。 doc.load(input); doc.flatLayer(); doc.save(output); } } catch (PtlException pex) { Console.WriteLine(pex.getErrorCode() + " : " + pex.getErrorMessageJP()); pex.Dispose(); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Console.WriteLine("-- 完了 --"); } } } }