つやぴん氏(@tuyapin)作「HNBridge」を使用して、iTextSharpでPDFの情報を読み出すテスト
つやぴん氏(@tuyapin)作「HNBridge」を使用して、iTextSharpでPDFの情報を読み出すテスト
/**つやぴん氏作「HNBridge」を使用して、iTextSharpでPDFの情報を読み出すテスト【このプログラムを実行するには!】※ 2014/08/13現在、http://tuyapin.net/hsp/hnbridgeで入手可能なバージョン(1.0.0_45)は、IDictionaryの操作をサポートしていない為、https://github.com/tuyapin/HNBridgeで入手可能なソースコードをVisualStudioでビルドして出力されたHNBridge.dllを使用する必要があります。また、HNBridge.asファイルに、#func global _GetDProperty "GetDProperty" sptr, sptr, var#defcfunc GetDProperty str p1, str p2hoge = "";_GetDProperty p1, p2, hogereturn hoge;を追加する必要があります。将来のバージョンでは修正されている可能性があります。*/#include "HNBridge.as"#module#defcfunc safeNull str p1if p1 == "hdn://NULL" : return ""return p1#globaltitle "HNBridgeを使用して、iTextSharpでPDFの情報を読み出すテスト"LoadAssembly "itextsharp.dll"CreateObjectFromClassName "iTextSharp.text.pdf.PdfReader"dialog "pdf", 16if stat == 0 : endfname = refstrmes "ファイル名: \t\t"+fnameCreateInstanceWithOneArg fnamemes "PDF変換: \t\t"+safeNull(GetDProperty("Info", "Producer"))mes "作成日時: \t\t"+safeNull(GetDProperty("Info", "CreationDate"))mes "題名: \t\t\t"+safeNull(GetDProperty("Info", "Subject"))mes "アプリケーション: \t"+safeNull(GetDProperty("Info", "Creator"))mes "キーワード: \t\t"+safeNull(GetDProperty("Info", "Keywords"))mes "編集日時: \t\t"+safeNull(GetDProperty("Info", "ModDate"))mes "タイトル: \t\t"+safeNull(GetDProperty("Info", "Title"))mes "PDFページ数: \t\t"+GetProperty("NumberOfPages")mes "PDFバージョン: \t\t1."+GetProperty("PdfVersion")InvokeMethodWithZeroArgs "Close"UnloadAssembly