http://homepage3.nifty.com/e-papy/pdftool/index.html
からpdftool.zipをだうんろーどし、pdftool.dllを得る。



テキストファイルをpdfに変換。

#prompt

Declare Function WritePDFText Lib "pdftool.dll" (openfile As BytePtr,savefile As BytePtr) As Long

Dim opf(63) As Byte
Dim svf(63) As Byte
Dim rtn As Long

lstrcpy(opf,"readme.txt")
lstrcpy(svf,"readme.pdf")

rtn=WritePDFText(opf,svf)



ビットマップ画像をpdfに変換

#prompt

Declare Function WritePDFImage Lib "pdftool.dll" (openfile As BytePtr,savefile As BytePtr) As Long


Dim ofile(63) As Byte
Dim sfile(63) As Byte
Dim rtn As Long

lstrcpy(ofile,"testbm.bmp")
lstrcpy(sfile,"testbm.pdf")

rtn=WritePDFImage(ofile,sfile)



pdfファイルをテキストファイルに逆変換

#prompt

Declare Function GetPDFText Lib "pdftool.dll" (openfile As BytePtr,savefile As BytePtr) As Long

Dim opf(63) As Byte
Dim svf(63) As Byte
Dim rtn as Long

lstrcpy(opf,"sa.pdf")
lstrcpy(svf,"sa.txt")

rtn=GetPDFText(opf,svf)




二つのpdfファイルを結合してあたらしい一つのpdfファイルを作成

#prompt

Declare Function LoadPDF Lib "pdftool.dll" (openfile As BytePtr) As Long
Declare Sub FreePDF Lib "pdftool.dll" (lppdf As DWord)
Declare Function CombinePDF Lib "pdftool.dll" (lppdf1 As DWord,lppdf2 As DWord,savefile As BytePtr) As Long

Dim p1 As DWord
Dim p2 As DWord
Dim opf(63) Byte
Dim svf(63) As Byte
Dim rtn As Long

lstrcpy(opf,"readme.pdf")
p1=LoadPDF(opf)

lstrcpy(opf,"testbm.pdf")
p2=LoadPDF(opf)

lstrcpy(svf,"save.pdf")
rtn=CombinePDF(p1,p2,svf)

FreePDF(p1)
FreePDF(p2)