Forum How do I...?

How do I create a pdf from a .net web page?

ScrappyTexas
Hi, this must be something stupid that I'm missing

I have d/loaded the Prince.dll and referenced it in my Project, the full PrinceXML app is also installed.

When I try to create a pdf of "edition.aspx" from my page "create.aspx" nothing happens. I don't think the Convert function is being invoked or it fails on permissions?
Dim p As Prince
		Response.ContentType = "application/pdf"
		p = New Prince("C:\\Program Files (x86)\\Prince\\Engine\\bin\\prince.exe")
		p.Convert("http://10.0.0.15:6020/wine-sprirts/edition.aspx", "C:\\Users\\tthorp\\Desktop\\output2.pdf")

		Me.Response.End()


Any ideas? I'm brand new to PrinceXML, so I'm expecting a noobie / rookie mistake on my part.

Thanks,

Tom
mikeday
Calling SetLog may be helpful to create an error log file, or not create a log file if the executable is not being invoked. Can you try installing Prince in a directory that does not contain a space character? Some people have reported issues with this.
ScrappyTexas
Hi Mike,

I eventually got it working, it was a permissions issue as my site is an intra-net it has domain security. Once I'd cured that, I found that creation via web pages would not embed the fonts - even with forcing the embedding to true.

The standalone Prince application did this perfectly from my .net page saved as a HTML file - so I knew it was possible.

My final solution was to write an application that saved my web page as HTML and then called the conversion via command line (I wanted to save the files onto another machine, not display them in a browser, and this circumvented more domain security issues). I'm happy to share my app code for anybody having similar issues - it's so simple that it hurts.

It all works perfectly now. This is a fantastic product and it won't be a hard sell to get my manager to purchase a server licence now that I have proof of concept working flawlessly.

The CSS support is amazing and I was able to produce a magazine-style layout that you'd be sure had come from a DTP app.

Keep up the good work! Thanks,

Tom - A.K.A ScrappyTexas
mikeday
Great, I'm glad to hear it's all working well. :)
jim_albright
And Prince is even getting better!!!!! They keep adding features.

Jim Albright
Wycliffe Bible Translators