tag:blogger.com,1999:blog-5396570633771229267.post6801366821355822503..comments2024-03-03T14:43:52.399+01:00Comments on The BalusC Code: PDF handlingBalusChttp://www.blogger.com/profile/00299057045960008647noreply@blogger.comBlogger86125tag:blogger.com,1999:blog-5396570633771229267.post-57418235061083252772019-02-14T16:34:11.553+01:002019-02-14T16:34:11.553+01:00hI, I create a jsf form from a xhtml file named 1n...hI, I create a jsf form from a xhtml file named 1ndex333.xhtml with intellij<br />the story goes ;<br />1.The user fills the form <br />2.my goal is to export this filled form to pdf<br /> questions <br />a.how can i access this form ?<br />b.how can i create a pdf file from my url: http://localhost:8080/index333+jsessionid<br />c.i used your code at<br /> https://stackoverflow.com/questions/spyroshttps://www.blogger.com/profile/11763907921997978361noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-23558066344766422422017-03-15T11:20:42.675+01:002017-03-15T11:20:42.675+01:00Great work and very helpful as always. Thanks Balu...Great work and very helpful as always. Thanks BalusC!<br /><br />PDF-download was working fine on Edge, Chrome and FF but I had a problem in InternetExplorer 11: PDF-Plugin cancelled with "No access".<br /><br />The most simple sollution I could find was to hint, that the PDF should be downloaded rather than inline-edit:<br /><br />response.setHeader("Content-Disposition", &Anonymoushttps://www.blogger.com/profile/12205197927383822171noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-12172191575027258552016-09-30T16:58:59.061+02:002016-09-30T16:58:59.061+02:00hi, I change your method for work with pdfStamper,...hi, I change your method for work with pdfStamper, i proved the same but it don't work i don't have any warning or error but my pdf don't see in my browser. can you help me??<br />this is my code<br />public void crearPdf() throws ServletException, IOException, DocumentException{<br /> System.out.print("Este es el ingreso al metodo crear PDF");<br /> Calendar c = Anonymoushttps://www.blogger.com/profile/18255837016192626404noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-3754754817763833212016-09-22T11:44:06.936+02:002016-09-22T11:44:06.936+02:00Hi, thanks for your code. It's works perfectly...Hi, thanks for your code. It's works perfectly but I would like generate PDF by a bean. Is it possibile? <br />I use Primefaces 5. User save some data clicking a botton in my jsf page; this botton has an action to call a bean method (I set ajax=false). Within this method I try to insert your "DownloadPDF" call but doesn't work. I would like views my pdf in a new window browser Anonymoushttps://www.blogger.com/profile/10622115723836710653noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-88621153518005419412016-09-13T18:30:20.394+02:002016-09-13T18:30:20.394+02:00This is great info and it works, but I want to pas...This is great info and it works, but I want to pass the filename in the header so the user can then save the pdf with that name. How do I accomplish that?<br /><br />Thank you, <br />FrancesFranceshttps://www.blogger.com/profile/04143348786155188296noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-30210570984610860842015-12-23T15:48:08.773+01:002015-12-23T15:48:08.773+01:00Hi Balu, everything works but some how mu download...Hi Balu, everything works but some how mu downloaded xml file has xhtm page source attached at the end. If u have any idea why this might occur please let me know... Anonymoushttps://www.blogger.com/profile/11363522238981244567noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-83788491317852190642015-04-16T09:22:36.165+02:002015-04-16T09:22:36.165+02:00Hey Balu,
My iText PDF has links in it but when I...Hey Balu,<br /><br />My iText PDF has links in it but when I click on these links in an iPad, they don't open in a window. How can I correct this?<br /><br />Thanks for you time.<br />PriyankAnonymoushttps://www.blogger.com/profile/03618147548805696559noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-63774677707514800702015-04-12T02:28:29.214+02:002015-04-12T02:28:29.214+02:00Nice example. Working properly. Only one issue: as...Nice example. Working properly. Only one issue: assuming that there is no error and PDF is displayed in a window. However say, when there is an error occurred while displaying a PDF (e.g. statusMessages is not empty) and I want to display the error validation message in the page instead of displaying the PDF. How to achieve this? <br /><br />[We cannot use ajax due to technology limitation/M Chistyhttps://www.blogger.com/profile/12628189108377300462noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-65558310926458390942015-03-18T14:23:57.090+01:002015-03-18T14:23:57.090+01:00it works .. but ? I have the h:form component in a...it works .. but ? I have the h:form component in a main template and I use primefaces p:commandButton so we must use ajax="false". We can use js to set form target on _blank using onclick but onComplete doesn't work to reset target to default. can you hel me?Anonymoushttps://www.blogger.com/profile/04399833906443170942noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-16901058656045987472015-01-01T20:39:21.586+01:002015-01-01T20:39:21.586+01:00Thank's Balusc, you save me!!!Thank's Balusc, you save me!!!Meu Amigo Normalhttps://www.blogger.com/profile/10560214714228680791noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-18513157289753397532014-10-10T10:43:13.468+02:002014-10-10T10:43:13.468+02:00Wow! It worked really well! It allows to save the ...Wow! It worked really well! It allows to save the file as PDF (File/save as...) as I wanted. Once more thank you to the JSF master, have a nice day!Rubenhttps://www.blogger.com/profile/10440832040879094743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-60899896741249369642014-10-10T10:43:05.844+02:002014-10-10T10:43:05.844+02:00Wow! It worked really well! It allows to save the ...Wow! It worked really well! It allows to save the file as PDF (File/save as...) as I wanted. Once more thank you to the JSF master, have a nice day!Rubenhttps://www.blogger.com/profile/10440832040879094743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-72295367035072616302014-10-10T10:42:59.667+02:002014-10-10T10:42:59.667+02:00Wow! It worked really well! It allows to save the ...Wow! It worked really well! It allows to save the file as PDF (File/save as...) as I wanted. Once more thank you to the JSF master, have a nice day!Rubenhttps://www.blogger.com/profile/10440832040879094743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-42767389317247196282014-10-10T10:42:02.531+02:002014-10-10T10:42:02.531+02:00Wow! It worked really well! It allows to save the ...Wow! It worked really well! It allows to save the file as PDF (File/save as...) as I wanted. Once more thank you to the JSF master, have a nice day!Rubenhttps://www.blogger.com/profile/10440832040879094743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-86850891688778700342014-10-10T10:41:45.774+02:002014-10-10T10:41:45.774+02:00Wow! It worked really well! It allows to save the ...Wow! It worked really well! It allows to save the file as PDF (File/save as...) as I wanted. Once more thank you to the JSF master, have a nice day!Rubenhttps://www.blogger.com/profile/10440832040879094743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-28414609460942406532014-09-05T08:47:06.690+02:002014-09-05T08:47:06.690+02:00Hey Bauke Your tutorials are really of great help....Hey Bauke Your tutorials are really of great help. I need help in converting xhtml page to pdf. Can you guide on those lines with some reference.Anonymoushttps://www.blogger.com/profile/11837750212342339772noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-20295661910292526352014-04-17T05:50:12.854+02:002014-04-17T05:50:12.854+02:00Hi Balu , this code helped me alot.
I am putting b...Hi Balu , this code helped me alot.<br />I am putting bytearray in iframe and opening the editable pdf in the browser . now I want to read the editable pdf content fro the browser in jsf . Can you suggest how can this be achieved.<br /><br />Thanks in advance...<br /><br />shamuhttps://www.blogger.com/profile/00347599546078769109noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-45922801530827183242014-04-03T14:23:23.636+02:002014-04-03T14:23:23.636+02:00This comment has been removed by the author.Hasanhttps://www.blogger.com/profile/04606832850232672599noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-64547646045037799252014-02-28T19:55:35.573+01:002014-02-28T19:55:35.573+01:00Hi Balu.
Thanks for the article. It worked well fo...Hi Balu.<br />Thanks for the article. It worked well for me in IE, Chrome n firefox.<br />Is there a way where i can do the same for ipad, tables and smart phone. I failed using the same method for samsung tabletsAmr Eshhttps://www.blogger.com/profile/03934080913009010658noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-10440582397084063642014-02-07T12:11:07.305+01:002014-02-07T12:11:07.305+01:00Hi Bauke,
I keep stumbling upon your blogs for a ...Hi Bauke,<br /><br />I keep stumbling upon your blogs for a while now, always clear and well explained info which helps me lot in dev life! A big thumbs up there! However this one didn't do it for me =( Don't know why, there is just nothing happening, no useful log entries, nada.<br />I managed to fix it though by combining your fileservlet blog with a simple prettyfaces mapping. Overkillmaartenbayhttps://www.blogger.com/profile/00649308831962074743noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-21596317298353593822013-12-19T18:04:26.881+01:002013-12-19T18:04:26.881+01:00This xmas gonna toast in your name! Thank you for ...This xmas gonna toast in your name! Thank you for this post and for all java and primefaces content in stackoverflow, you really made my life less painful!<br /><br />Cheers and Props from Brazil!<br />Happy holydays.Anonymoushttps://www.blogger.com/profile/00770798428753718981noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-88671140664398244192013-07-16T23:48:04.244+02:002013-07-16T23:48:04.244+02:00Hi Balusc,
This article has been really helpful, ...Hi Balusc,<br /><br />This article has been really helpful, thanks a lot!!!<br /><br /><br /><br />Michael Rojashttps://www.blogger.com/profile/01099019563374005552noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-15664947472351236902013-07-04T14:27:36.988+02:002013-07-04T14:27:36.988+02:00Hi BalusC,
I getting NullPointerException at
outpu...Hi BalusC,<br />I getting NullPointerException at<br />output.write(bytes)<br />I am not getting why output is null<br />output = response.getOutputStream();Shivarajhttps://www.blogger.com/profile/16015090368872418444noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-17446626851772744062013-04-05T11:50:08.322+02:002013-04-05T11:50:08.322+02:00Hello BalusC i tried your code and its interesting...Hello BalusC i tried your code and its interesting<br />Its fine in a dynamic web project<br />but when moving to a portlet application i am facing a null pointer exception in responce.getOutputStream() where i rediefined in your code by changing <br /> HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();<br /><br />to <br /><br />PortletResponse portalResponse = (primeFaceUserhttps://www.blogger.com/profile/17730977575050306741noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-7574453195998852172013-04-04T22:54:30.487+02:002013-04-04T22:54:30.487+02:00am i using an iframe not a command button since i ...am i using an iframe not a command button since i want to display the pdf in an iframe so i dont have a component which has ajax my code is calling downloadPdf in a PostConstruct method and the iframe is taking the file name as src<br /><br />iframe src="myPdf.pdf"<br /><br />where myPdf.pdf is a file in desktop derectoryooosshttps://www.blogger.com/profile/17627719388496159542noreply@blogger.com