MvcRazorToPdf icon indicating copy to clipboard operation
MvcRazorToPdf copied to clipboard

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

Open andyhutch77 opened this issue 10 years ago • 6 comments

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.

andyhutch77 avatar Oct 10 '14 18:10 andyhutch77

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

ElanHasson avatar Oct 10 '14 18:10 ElanHasson

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

surrealist avatar Jun 18 '15 01:06 surrealist

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

Spencerooni avatar Apr 08 '16 15:04 Spencerooni

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:

andyhutch77 avatar Apr 08 '16 15:04 andyhutch77

@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!

Spencerooni avatar Apr 08 '16 21:04 Spencerooni

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.

andyhutch77 avatar Apr 09 '16 06:04 andyhutch77