Re: .NET C# MVC VIEW to PDF using iTextSharp
"Kostas" <[email protected]> Thu, 7 Jan 2016 08:47:20 +0200
| Newsgroups | gmane.comp.java.lib.itext.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format. --===============5867704605212462306== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0047_01D14928.06B0E1F0" Content-Language: el This is a multipart message in MIME format. ------=_NextPart_000_0047_01D14928.06B0E1F0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi. =20 Creating a PDF in memory: http://stackoverflow.com/questions/2815761/create-pdf-in-memory-instead-o= f-physical-file =20 To serve it in the browser you can return it as a file from an MVC = controller action that gets called/requested from an <iframe>, but you = must assume the user=E2=80=99s browser can display the PDF. =20 I hope this helps, KK =20 =20 From: R Balbo [mailto:[email protected]]=20 Sent: Tuesday, January 05, 2016 7:46 PM To: [email protected] Subject: [iText-questions] .NET C# MVC VIEW to PDF using iTextSharp =20 Hello, I am hoping you can help me. I am looking into how to create a PDF file = from a MVC View (formatted as a report - object is model or = model.tolist), without first saving it to the server disk , i.e. instead = just save it in memory and displaying it for the user for viewing or = saving to their local disk if so desired. I would greatly appreciate if you can send some samples my way. Thanks, RB ------=_NextPart_000_0047_01D14928.06B0E1F0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta = name=3DGenerator content=3D"Microsoft Word 14 (filtered = medium)"><style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman","serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif"; mso-fareast-language:EN-US;} @page WordSection1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEL link=3Dblue = vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Hi.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Creating a PDF in memory:<o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><a = href=3D"http://stackoverflow.com/questions/2815761/create-pdf-in-memory-i= nstead-of-physical-file">http://stackoverflow.com/questions/2815761/creat= e-pdf-in-memory-instead-of-physical-file</a><o:p></o:p></span></p><p = class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>To serve it in the browser you can return it as a file from an MVC = controller action that gets called/requested from an <iframe>, but = you must assume the user=E2=80=99s browser can display the = PDF.<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>I hope this helps,<o:p></o:p></span></p><p class=3DMsoNormal><span = lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>KK<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><b><span = lang=3DEN-US = style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>= </b><span lang=3DEN-US = style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> R Balbo = [mailto:[email protected]] <br><b>Sent:</b> Tuesday, January 05, 2016 = 7:46 PM<br><b>To:</b> = [email protected]<br><b>Subject:</b> = [iText-questions] .NET C# MVC VIEW to PDF using = iTextSharp<o:p></o:p></span></p><p = class=3DMsoNormal><o:p> </o:p></p><div><div><div><p = class=3DMsoNormal style=3D'margin-bottom:18.0pt'><span = style=3D'font-size:18.0pt'>Hello,<o:p></o:p></span></p></div><div><p = class=3DMsoNormal style=3D'margin-bottom:18.0pt'><span = style=3D'font-size:18.0pt'>I am hoping you can help me. I am = looking into how to create a PDF file from a MVC View (formatted as a = report - object is model or model.tolist), <u>without</u> first = saving it to the server disk , i.e. instead just save it in memory and = displaying it for the user for viewing or saving to their local disk if = so desired.<o:p></o:p></span></p></div><div><p class=3DMsoNormal = style=3D'margin-bottom:18.0pt'><span style=3D'font-size:18.0pt'>I would = greatly appreciate if you can send some samples my = way.<o:p></o:p></span></p></div><div><p class=3DMsoNormal><span = style=3D'font-size:18.0pt'>Thanks,<o:p></o:p></span></p></div><p = class=3DMsoNormal><span = style=3D'font-size:18.0pt'>RB<o:p></o:p></span></p></div></div></div></bo= dy></html> ------=_NextPart_000_0047_01D14928.06B0E1F0-- --===============5867704605212462306== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ --===============5867704605212462306== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php --===============5867704605212462306==--