I'm just starting to use this plugin, but I have a problem/question. I would like to place a Download button on one of my cshtml page, with which the users can generate/download a part of the page, just images.
For example I have a cshtml, within a foreach, which is generate an image list, e.g:
foreach (var coverImage in coverImagesCollection.Where("Visible"))
{
<img src="@coverImage.Url" />
}
I would like to place a button to this page, which is generate a PDF with these images. How can I do this. I don't fully understand where should I place the FO code (same cshtml or somewhere else). If this should be in one file, how can I use together (my foreach and the FO code).
OK, so I have a cshtml with my images, and I have another cshtml with the FO template, which is go through the images what I need. Just one thing I still don't know that how can I link the FO template to my normal cshtml page?
Download link on the site
Hi,
I'm just starting to use this plugin, but I have a problem/question.
I would like to place a Download button on one of my cshtml page, with which the users can generate/download a part of the page, just images.
How can I do that? I little help would be great.
Thanks
Hi Levente - I'm not sure I understand the question.
You want to create a PDF containing images that are part of the page?
The samples that come with PDF creator should show how to do that. If they aren't helpful then please provide some more detail.
Many Thanks.
For example I have a cshtml, within a foreach, which is generate an image list, e.g:
I would like to place a button to this page, which is generate a PDF with these images. How can I do this. I don't fully understand where should I place the FO code (same cshtml or somewhere else). If this should be in one file, how can I use together (my foreach and the FO code).
I hope this helps.
Thanks
You'll need a separate Umbraco template to output the pdf and you can link to that from within your Umbraco page.
There are some sample FO templates that come with PDF creator that should get you started. Have you read the manual and watched the video tutorials?
Thanks.
OK, so I have a cshtml with my images, and I have another cshtml with the FO template, which is go through the images what I need.
Just one thing I still don't know that how can I link the FO template to my normal cshtml page?
You just pust the name of the template on the end of the URL e.g.
/my/page/url/pdftemplate
or use Umbraco altTemplate syntax e.g.
/my/page/url?altTemplate=pdftemplate
Thank you.
Probably something wrong in my code. I tried with the attached example template (PdfMvcHelloWord.cshtml), but I got 404.
or
I'm going to keep trying.
My url path was wrong. I used alttemplate and it worked perfectly.
Thank you for your help!
Maybe just another question. It' about the generated filename. I try to make it dynamic, but I have some problem with the pdf extension.
I've tried different way, maybe you already managed somehow.
This is what I have now, but still got an error:
This is working within root, just not here.
Any idea?
Hi,
Thank you for your help!
is working on a reply...