ASP - VBScript via COM Interop

Pré-requisitos

Exemplo Hello World! em VB Script


<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<html>
    <head>
        <title> usando Aspose.PDF para .NET em exemplo clássico de ASP</title>
    </head>
<body>

<h3>criação de um documento PDF de exemplo usando Aspose.PDF para .NET com ASP clássico e VBScript</h3>

<%

'set license
Dim lic
Set lic = CreateObject("Aspose.PDF.License")
lic.SetLicense("D:\ASPOSE\Licences\Aspose.Total licenses\Aspose.Total.lic")

'Instantiate Pdf instance by calling its empty constructor
Dim pdf
Set pdf = CreateObject("Aspose.PDF.Generator.Pdf")

'Create a new section in the Pdf object
Dim pdfsection
Set pdfsection = CreateObject("Aspose.PDF.Generator.Section")

'Add section to Pdf object
pdf.Sections.Add(pdfsection)

' Create Text object
Dim SampleText
Set SampleText = CreateObject("Aspose.PDF.Generator.Text")

'Add Text Segment to text object
Dim seg1
Set seg1 = CreateObject("Aspose.PDF.Generator.Segment")

'Assign some content to the segment
seg1.Content = "HelloWorld usando ASP e VBScript"

'Add segment (with red text color) to the paragraph
SampleText.Segments.Add(seg1)

' Add Text paragraph to paragraphs collection of a section
pdfsection.Paragraphs.Add(SampleText)

' Save the PDF document
pdf.Save("d:\pdftest\HelloWorldinASP.pdf")

%>

    </body>
</html>

Extraindo Texto usando VBScript