Sample code is for WebSupergoo ABCpdf.NET v5.
WebSupergoo ABCpdf.NET is installed in the Global Assembly Cache on
Windows 2003/IIS 6 DiscountASP.NET web servers. It is not supported on
our Windows2008 / IIS 7 or later servers.
Please
read these limitations related to ABCpdf.NET.
VB.NET Code Sample
<%@ Assembly name="ABCpdf, Version=5.0.0.6, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169" %>
<!--- The above line can be omitted, if you load the assembly in the application web.config file. See this Knowledge Base article for details -->
<%@ import Namespace="WebSupergoo.ABCpdf5" %>
<script runat="server" Language="VB">
Sub page_load()
Dim theID As Integer = 0
Dim theText As String = "This PDF file is generated by WebSupergoo ABCpdf.NET on the fly"
Dim theDoc As Doc = New Doc()
theDoc.Width = 4
theDoc.FontSize = 32
theDoc.Rect.Inset(20, 20)
theDoc.FrameRect()
theID = theDoc.AddHTML(theText)
While theDoc.GetInfo(theID, "Truncated") = "1"
theDoc.Page = theDoc.AddPage()
theDoc.FrameRect()
theID = theDoc.AddHTML("", theID)
End While
theDoc.Save(Server.MapPath("textflow.pdf"))
theDoc.Clear()
response.write ("PDF file written<br>")
response.write ("<a href=""textflow.pdf"">View PDF File</a>")
End Sub
</script>
C# Code Sample
<%@ Assembly name="ABCpdf, Version=5.0.0.6, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169" %>
<!--- The above line can be omitted if you load the assembly in the application web.config file. See KB article 10239 for details -->
<%@ import Namespace="WebSupergoo.ABCpdf5" %>
<script runat="server" Language="C#">
void Page_Load(object sender, System.EventArgs e)
{
int theID = 0;
string theText = "This PDF file is generated by WebSupergoo ABCpdf.NET on the fly";
Doc theDoc = new Doc();
theDoc.Width = 4;
theDoc.FontSize = 32;
theDoc.Rect.Inset(20, 20);
theDoc.FrameRect();
theID = theDoc.AddHtml(theText);
while (theDoc.GetInfo(theID, "Truncated") == "1") {
theDoc.Page = theDoc.AddPage();
theDoc.FrameRect();
theID = theDoc.AddHtml("", theID);
}
theDoc.Save(Server.MapPath("textflow.pdf"));
theDoc.Clear();
Response.Write ("PDF file written<br>");
Response.Write ("<a href=\"textflow.pdf\">View PDF File</a>");
}
</script>
Article ID: 124, Created On: 11/6/2008, Modified: 5/20/2010