OFDファイルは、Cypresslogic Systems Inc.によって開発されたObjectView Form Definitionです。OFDは、一般的にObjectView Form Definitionファイルに関連付けられているファイル拡張子です。今日は、C#でFree.Spire.PDFを使ってPDFドキュメントをOFDに変換に変換する方法を紹介します。
下準備
1.E-iceblueの公式サイトからFree Spire.PDF無料版をダウンロードしてください。
2.Visual Studioを起動して新規プロジェクトを作成してから、インストールされたファイルにあった相応しいSpire. PDF.dllを参照に追加してください。
(Net 4.0を例としたら、デフォルトパスは“Bin→NET4.0→PDF.dll”というようです。)
namespace PDFtoOFD
{
class Program
{
static void Main(string[] args)
{
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile("test.pdf");
pdf.SaveToFile("ToOFD.ofd", FileFormat.OFD);
}
}
}
</blockquote>
<h4><strong>実行結果</strong></h4>
<p><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/l/lendoris/20210908/20210908152221.png" alt="f:id:lendoris:20210908152221p:plain" width="554" height="599" loading="lazy" title="" class="hatena-fotolife" itemprop="image" /></p>
<p style="margin: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 1.6; color: #000001; overflow-wrap: break-word; padding: 0px;"> </p>