I am not sure if you can mark your own post as solved, but any bugs/features regarding the our.umbraco site please use the new forums - but check to see if there is an existing topic already.
Although this item is already solved, for the record I made a PdfCreator package now for doing similar functionality using iTextSharp. You can check it out here.
This is for Tommy who created the PDFCreator package (here). I have successfully installed it and have it configured, however the file that is created has only the following error message within it:
Error! Could not find file 'C:\Windows\Temp\tmpYY.tmp'.
I have managed to sort this error out, the nodeId that was being passed in was empty. However I am now receiving the following error messages and am not sure at all as to why this is happening:
Create dynamic pdf
Hi!
I want to take the information from a field and dynamically create a pdf.
Is it possible to use some sort of application and integrate that with Umbraco or has someone created a package with this?
Don't think there's a package yet, not that i've seen anyway.
Should be able to use this along with the umbraco api to do it though -> http://www.pdfsharp.com/PDFsharp/
I did a bit of Googling, but couldn't find the article I was looking before. Someone's done it before, as far as I recall.
There's also this: http://fonet.codeplex.com/
Damn this non-editable post forum..... I meant "the article I was looking for"
Solved it!
I use iTextSharp and HtmlToPdfBuilder: http://somewebguy.wordpress.com/2009/05/08/itextsharp-simplify-your-html-to-pdf-creation/
Then its easy to, for instance attach it to a button. My Template then look like this:
<%@ Import Namespace="PdfSharp" %>
<%@ Import Namespace="PdfSharp.Pdf" %>
<%@ Import Namespace="PdfSharp.Drawing" %>
<%@ Import Namespace="PdfSharp.Pdf.IO" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="umbraco.BusinessLogic" %>
<%@ Import Namespace="umbraco.presentation.nodeFactory" %>
<%@ Import Namespace="PDFBuilder" %>
<%@ Import Namespace="System.IO" %>
<%@ Master Language="C#" MasterPageFile="/masterpages/CWS_Master.master" AutoEventWireup="true" %>
<script runat="server">
protected void PdfButton_Click(object sender, EventArgs e)
{
Node currentNode = Node.GetCurrent();
String bodyText = currentNode.GetProperty("bodyText").Value;
HtmlToPdfBuilder builder = new HtmlToPdfBuilder(iTextSharp.text.PageSize.LETTER);
HtmlPdfPage first = builder.AddPage();
first.AppendHtml(bodyText);
string Filename = "test.pdf";
byte[] thePdf = builder.RenderPdf();
File.WriteAllBytes(Server.MapPath("~/Images/Pdf/" + Filename),thePdf);
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment;test.pdf");
this.EnableViewState = false;
Response.WriteFile(Server.MapPath("~/Images/Pdf/" +Filename));
Response.Flush();
Response.Close();
}
</script>
And yes; editing posts is a must!
I am not sure if you can mark your own post as solved, but any bugs/features regarding the our.umbraco site please use the new forums - but check to see if there is an existing topic already.
Although this item is already solved, for the record I made a PdfCreator package now for doing similar functionality using iTextSharp. You can check it out here.
>Tommy
And now there is this example http://www.nibble.be/?p=72.
Maybe ABCpdf is better to use as its easier to layout images? That was my biggest problem using ITextSharp!
Also see: http://our.umbraco.org/projects/website-utilities/pdf-creator
This is for Tommy who created the PDFCreator package (here). I have successfully installed it and have it configured, however the file that is created has only the following error message within it:
Error! Could not find file 'C:\Windows\Temp\tmpYY.tmp'.
Do you have any idea as to what the issue may be?
I have managed to sort this error out, the nodeId that was being passed in was empty. However I am now receiving the following error messages and am not sure at all as to why this is happening:
Error! Illegal characters in path.
you can take a look at rasteredge's pdf add-on to see if it can integrate with the forum and creat dynamic pdf vb.net. i hope it will work for you.
is working on a reply...