I'm trying to create a Razor template to render a PDF but all I get is an empty PDF. It appears that some of FO is rendered as I can change the page size but "Hello World" isn't rendered. Compared HTTP response of my template and the PDFRazorHelloWorld template and they match almost exactly. CSHTML source and raw responses below
Hi Bob - having a crazy day - I'll have some time to look into this Thursday - but in the meantime have you taken a tool like beyond compare or similar to compare the raw responses and find the difference? (http://www.scootersoftware.com/)
Feel free to send me your .cshtml file to darren @ moriyama.co.uk and I will try and run it in our environments.
Exactly same situation here. I'm running MVC. I also noticed that during packag installation, the templtes install themselfs as masterpages.... This package needs some improvements to be 6.0.3 (fool) ready :-)
Empty PDF w/ Razor template?
I'm trying to create a Razor template to render a PDF but all I get is an empty PDF. It appears that some of FO is rendered as I can change the page size but "Hello World" isn't rendered. Compared HTTP response of my template and the PDFRazorHelloWorld template and they match almost exactly. CSHTML source and raw responses below
Any ideas?
PDFRazorHelloWorld raw response
My template raw response
Hi Bob - having a crazy day - I'll have some time to look into this Thursday - but in the meantime have you taken a tool like beyond compare or similar to compare the raw responses and find the difference? (http://www.scootersoftware.com/)
Feel free to send me your .cshtml file to darren @ moriyama.co.uk and I will try and run it in our environments.
Thanks
Thanks. Yeah, the only notable differences are in the X-AspNetMvc-Version and X-SourceFiles.
The contents of the .cshtml are in the 1st code block.
If you send me the razor file i'll see if it renders for me.
Sorry for the misunderstanding. The content of the razor file is in the 1st code block of the original post. I've pasted it again below.
Hi,
Exactly same situation here. I'm running MVC. I also noticed that during packag installation, the templtes install themselfs as masterpages.... This package needs some improvements to be 6.0.3 (fool) ready :-)
Merijn
You've correctly identified that the package doesn't ship with MVC views yet.
We'll do this for the next release.
I'll have a look into why PDFs don't render in MVC view mode and get back to you shortly.
Thanks.
I've managed to reproduce the problem, lookng into it now.
I've found the issue - ClientDependency appears to try and compress the output of all responses with content type text/xml.
It somehow modifies the PDF output to strip out all text which is strange.
I'll release a patch where you can use the mimetype text/xsl instead. We've tested this here and it works.
In the meantime you can disable the clientdependency modules in web.config
I've just uploaded a new release which will work with the MVC rendering engine.
Note: you'll need to use the content type text/xsl - as the example in the ~/Views folder does.
is working on a reply...