andyhutch77 / MvcRazorToPdf

Create pdf documents within an asp .net mvc project by generating your views as normal but returning a PdfActionResult. This converts regular produced razor/html to pdf documents in the browser using the iTextXmlWorker.
125 stars 105 forks source link

The ability to merge the rendered pdf with other pdf's #16

Open andyhutch77 opened 10 years ago

andyhutch77 commented 10 years ago

I have already done this in another project I just need to repeat the steps taken and add it the project and example.

Time permitting I will get around to this.

ElanHasson commented 10 years ago

@andyhutch77 Cool-- Let me know if you would like me to tackle.

surrealist commented 9 years ago

It would be a nice feature I'm looking for.

Spencerooni commented 8 years ago

Hi @andyhutch77

Is there a simple way of doing this currently? Or any tips or articles you could refer to? I've found some articles about combining generated byte[]. Not sure if I'm on the right track or not...

http://codereview.stackexchange.com/questions/112326/better-way-to-merge-pdfs http://www.dotnetbull.com/2013/12/merging-multiple-pdfs-using-itextsharp.html

Thanks

andyhutch77 commented 8 years ago

Hi @Spencerooni I wish I had pulled it into the project when I originally done this on another project, it was that long ago now I have virtually forgotten.

However, the second link looks like what I did at the time, I would give that a whirl.

If you submit a pull request I will include any changes in the project, good luck. :+1:

Spencerooni commented 8 years ago

@andyhutch77 Thanks for quick reply! The code in the second link did indeed work for combining multiple generated pdf byte arrays. However, in my case this library MvcRazorToPdf was giving me an error that no pages existed in the pdf file when I trying to create them from an action. I had a look at an alternative called "Rotativa" which seems to do something similar. I'll revisit this when I have some time. Thanks again!

andyhutch77 commented 8 years ago

I recall there was something missing from all the examples I found & it was something to do with closing or flushing an I text object that made it work. I found that buried away in an old stackoverflow answer at the time.