Rank: Administration
Groups: Moderators, Administration, Member Joined: 7/16/2009(UTC) Posts: 30   Location: Groesbeek Thanks: 1 times
|
In some cases a loop may occure if the following code is used to create a PDF file. The exact reason for this endless loop is unknown. Quote: While True thedoc.FrameRect() If thedoc.GetInfo(TheId, "Truncated") <> "1" Then Exit While End If thedoc.Page = thedoc.AddPage() TheId = thedoc.AddImageToChain(TheId) End While The following code solves this problem. Quote: 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>")
|
|
|
|
Rank: Administration
Groups: Administration
Joined: 10/8/2008(UTC) Posts: 190  Was thanked: 1 time(s) in 1 post(s)
|
With this solution, sometimes you end up with empty pages Iy you use in this case also "AddImageToChain" it might works better Code:
While brutpdf.GetInfo(brutID, "Truncated") = "1"
brutpdf.Page = brutpdf.AddPage()
brutID = brutpdf.AddImageToChain(brutID)
End While
edit: The TheDoc.FrameRect() In Joey's example will create a border around the rect, The websupergoo examples also use this, but It's easyer to not use it. Edited by user Wednesday, March 21, 2012 2:15:57 PM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Sienn Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close