前のページに戻る
以下の2 aspファイルを作成してください。: form.asp と easypdf.asp. そして、各対応ファイルの中に以下のコードをコピー&ペーストしてください。
========= form.asp ================
<html> <head> <title> easyPDF SDK ASP demo</title> </head> <body> <H2>This demo will do the following:<br></h2> <font color=#0033cc> 1. Grab 2 URLs/Web pages. <br> 2. Convert them into PDF files.<br> 3. Merge the resulted PDFs into a single PDF file.<br> 4. Convert the merged PDF file to text file.<br> 5. Provide the links to the PDF and text file.<P> </font> <h3>Please enter 2 URLs below</h3> <FORM action="./easypdf.asp" method= "post"> Web Page 1: <input type="text" value="http://www.google.com" name="inURL1"><br> Web Page 2: <input type="text" value="http://www.bcltechnologies.com" name="inURL2"><br><br> <input type=submit> </FORM> </body> </html>
========= easypdf.asp ================
<%@ Language=VBScript %> <% Option Explicit Dim oLoader Dim oPrinter Dim oPrintJob Dim oPDFProcessor Dim inUrl1, inUrl2 Dim fs, f inUrl1 = Request.Form("inUrl1") inUrl2 = Request.Form("inUrl2") ' For ASP, instead of getting the Printer object directly, ' get it through the easyPDF SDK Loader object. Set oLoader = Server.CreateObject("easyPDF.Loader.6") Set oPDFProcessor = oLoader.LoadObject("easyPDF.PDFProcessor.6") ' get the printer and printjob objects Set oPrinter = oLoader.LoadObject("easyPDF.Printer.6") Set oPrintJob = oPrinter.IEPrintJob On Error Resume Next ' Convert to PDF. Call oPrintJob.PrintOut(inUrl1, Server.MapPath("./output1.pdf")) Call oPrintJob.PrintOut(inUrl2, Server.MapPath("./output2.pdf")) 'Merge the 2 PDFs Call oPDFProcessor.Merge(Server.MapPath("./output1.pdf"), Server.MapPath("./output2.pdf"), Server.MapPath("./merged.pdf")) 'Extract pdf as text file Call oPDFProcessor.ExtractText(Server.MapPath("./merged.pdf"), Server.MapPath("./merged.txt")) If Err Then Response.Write("<B>Failed!</B> " + Err.Description + "<BR>") Response.Write("Conversion Result: " + oPrintJob.ConversionResultMessage + "<BR>") Response.Write("Printer Result: " + oPrintJob.PrinterResultMessage + "<BR>") Response.End End If Response.Write("<B>Success!</B><BR>") Response.Write("Below is the merged PDF result: <BR>") %> <A href="./merged.pdf">merged PDF</A><br> <A href="./merged.txt">merged txt</A><br>
販売代理店一覧 エクセルソフト株式会社 http://www.xlsoft.com/jp TEL:03-5440-7875 FAX:03-5440-7876 xlsoftkk@xlsoft.com
無料トライアルのダウンロード 無料トライアルは、30日間の期限付きで、全機能持ったソフトウエアです。