0

C# を使用して PDF ファイルを PostScript に変換する必要があります。サードパーティの DLL を使わなくても可能ですか? または、同じオープン ソース プロジェクトはありますか?

4

3 に答える 3

5

The "cheapest" way to do this (I will not give my definition of 'cheap' in this context, though) would be to call one of the commandline utilities out there which can convert PDF to PostScript:

  • gswin32c.exe (Win), gs (*nix): Ghostscript, multiplatform, GPL v3 license,...
  • pdftops.exe (Win), pdftops (*nix): part of XPDF by Foolabs, multiplatform, GPL v2 license,...
  • pdftops (*nix), from the "poppler" fork of XPDF (in theory a Windows version should be easy to compile, but there are no obvious places on the 'net to grab ready-made ones from)

Here are example commandlines, first for Ghostscript, assuming Windows (quotes for cases where names have spaces):

 "c:/path/to/gswin32c.exe" ^
     -sDEVICE=ps2write ^
     -o "c:/path/to/OUTPUT.pdf" ^
     "c:/path/to/INPUT.pdf"

and second for XPDF/pdftops (skipping paths, assuming files are in current directory):

 pdftops.exe ^
     -level3 ^
     INPUT.pdf ^
     OUTPUT.ps
于 2010-08-16T14:23:32.653 に答える
1

要件を再検討する必要があります。PDFが非常に特殊な形式でない限り、PDFの解釈は大きな仕事です。

于 2010-08-16T11:43:56.920 に答える
0

これは、サードパーティのアプリケーションまたはコンポーネントなしでは実行できないと思います。

PostScript プリンタ ドライバを使用して PDF を PostScript に変換し、出力をキャプチャできる場合がありますが、そのためには PDF ドキュメントを印刷できる必要があります。これを行うには、PDF レンダリング コンポーネントまたは PDF リーダー アプリケーションが必要です。

まともな変換ライブラリにいくらかのお金を使うことを検討してください。私はあなたがそれがよく使われたお金を見つけると思います。

オープンソース ツールが必要な場合は、ghostscript を調べてください。ほとんどの「無料」の PDF コンバーターはこれを使用しています。

于 2010-08-16T11:51:21.707 に答える