We are experiencing a few issues with our Umbraco site, and would welcome any solutions or fixes you could provide.
The first problem is that some pages are simply not giving us any PDF output, but instead show an error, for example:
Data at the root level is invalid. Line 2, position 1.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: Data at the root level is invalid. Line 2, position 1.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[XmlException: Data at the root level is invalid. Line 2, position 1.]
ibex4.xml.IntermediateFormatCreator.readXMLIntoIntermediateForm(RenderingContext rc) +405
ibex4.logical.FODocument_Implementation.commonCreationAndClose(RenderingContext rc, IntermediateFormatCreator intermediate_format_creator, Boolean close_output_stream, Stream output_stream, String xsl_swap_file_name, Stream fo_stream) +56
ibex4.logical.FODocument_Implementation.generateStreams(Stream xml_stream, Stream xsl_stream, Stream output_stream, Boolean closeOutputStream, Hashtable xsltParams) +1443
ibex4.logical.FODocument_Implementation.generateStreams(Stream template, Stream output, Boolean closeOutputStream) +99
FergusonMoriyama.Pdf.Application.Filter.FoFilter.Flush() +96
FergusonMoriyama.Pdf.Application.Filter.FoFilter.Close() +19
System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +188
System.Web.HttpResponse.FilterOutput() +104
System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +49
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
Some pages output fine, some throw this error, and I've yet to figure out what is causing it. Special characters or improperly formatted HTML don't seem to be the problem.
"Some pages output fine, some throw this error, and I've yet to figure out what is causing it. Special characters or improperly formatted HTML don't seem to be the problem."
How have you concluded this. Have you removed all content from the affected pages and still have the problem? Have you replaced all content fields in the PDF with static text to see if that works?
To avoid confusion could you post your second issue as a separate forum topic so that we can correspond on each issue separately.
So to give you some context - we provide users with the option to generate and download the PDF of a recipe that's displayed on the website. It takes the current content/layout of the recipe and outputs it as PDF.
At first I thought our content managers unintentionally created the issue by messing up the HTML while writing the recipe inside Umbraco, but I checked it and it's all properly formatted. I even stripped all the classes from it and special characters (we are a Croatian agency so we have letters like šđćčž), but that wasn't the problem either.
Here are two examples...
This recipe gives an error when someone tries to download the PDF (the button called Preuzmi Recept):
If there is an error in the script file you'll need to goto /trace.axd and find the error that occured - or set your macro errors to throw in umbracosettings.config - it doesn't look like this is to do with PDF creator.
PDF output problem
Hello everyone,
We are experiencing a few issues with our Umbraco site, and would welcome any solutions or fixes you could provide.
The first problem is that some pages are simply not giving us any PDF output, but instead show an error, for example:
Some pages output fine, some throw this error, and I've yet to figure out what is causing it. Special characters or improperly formatted HTML don't seem to be the problem.
Thanks for any help you can provide,
Tomislav
On the first error:
"Some pages output fine, some throw this error, and I've yet to figure out what is causing it. Special characters or improperly formatted HTML don't seem to be the problem."
How have you concluded this. Have you removed all content from the affected pages and still have the problem? Have you replaced all content fields in the PDF with static text to see if that works?
To avoid confusion could you post your second issue as a separate forum topic so that we can correspond on each issue separately.
Many Thanks.
So to give you some context - we provide users with the option to generate and download the PDF of a recipe that's displayed on the website. It takes the current content/layout of the recipe and outputs it as PDF.
At first I thought our content managers unintentionally created the issue by messing up the HTML while writing the recipe inside Umbraco, but I checked it and it's all properly formatted. I even stripped all the classes from it and special characters (we are a Croatian agency so we have letters like šđćčž), but that wasn't the problem either.
Here are two examples...
This recipe gives an error when someone tries to download the PDF (the button called Preuzmi Recept):
http://www.jamnica.hr/hr/jakuham/japamtim/patka-s-mlincima-i-narancom-za-blagdanski-rucak
This one (and the majority of them) works fine however:
http://www.jamnica.hr/hr/jakuham/jakreiram/domaci-umaci-za-tjesteninu-u-20-minuta/
Thanks!
Tomislav
Could you comment out the header that makes the PDF render:
You should then get some XML instead - the FO itself.
Could you provide that XML here - and also check that it is well formed?
I've done as you suggested and the output for the bugged recipe is now:
And then nothing below it. That is very strange.
Can you attach a screen grab of that please?
Here you go:
http://i.imgur.com/4ahY0H2.png
Could you remove: Response.ContentType = "text/xsl";
And see what happens.
Can you render this page with an alternative HTML template?
This is going to be pretty difficult to troubleshoot without access to Umbraco.
It only says:
I'll see if we can do anything about access, I'm the front-end guy here so I'm not that great with back-end things, and especially Umbraco.
If there is an error in the script file you'll need to goto /trace.axd and find the error that occured - or set your macro errors to throw in umbracosettings.config - it doesn't look like this is to do with PDF creator.
Your Umbraco dev should know how to do this.
Thanks.
is working on a reply...