HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Deployment / Configuration issues › pd4ml transform tag renders weird characters
- This topic has 7 replies, 3 voices, and was last updated Apr 19, 2019
17:57:03 by jones302.
-
AuthorPosts
-
April 18, 2017 at 13:54#27142
I’m using pd4ml to generate pdf using pd4ml taglib. The jsp is rendered with wired characters instead of showing pdf. we are using tiles for rendering jsp.
ex: %PDF-1.4 %Çåôåð 1 0 obj << /Filter /FlateDecode /Length 940 >> stream xÚÅWmsÚ8þÅ»IfcùÇÌäKBÒÒÐë]aPk[$pé¯ïÊÉÌ&×aÒJÚgß´»Ü[?Á ë÷9¼^D` nuß>ÚÎ_$@úõí#ùÏQ*¡mÜ»ä)Ç”áù¤çqé)s¡×í@ö:;»ùcüûÕäcÿ]ßýY÷ü”ïÑnؽßò+åïßN¿Î_§Þdø.|E#ÉèõHEô¯LtòâÁÊÂ^ë>@24óxq>ì[8ø9ZÍ«x:ÎÌIÊsP3Ë +@iٮƻ×OrRãáãàôÚÁÌüÐ7{Ìoâ?Îj¬v¸{o5ÈRóãEHE-gC«aÀ&VãøRäú KçLó4!àÀpl5hObï;ág«q1´njµ¿Ýºê¤ºÈÙ_jz1³Xó9nj}*ã)¸ w¨z]ñão%ÿpÊÆ3)®üí·[&çThanks,
SureshApril 18, 2017 at 13:58#30031The “garbage” is PDF bytes, shown as plain text. Obviously “Content-type” HTTP response header is overridden with a wrong value. Check the server/webapp setting.
April 19, 2017 at 06:26#30026Thanks for your response.
I have changed the weblogic server start parameter to add
-Dweblogic.webservice.i18n.charset=utf-8 and restarted the server. No luck.then I added the below parameter and restarted the server.
-Dfile.encoding=utf8Weblogic Domain path-> bin folder -> setDomainEnv.sh under JAVA_OPTS added the below variable.
-Dfile.encoding=utf8.Still it is displaying the same characters. Plz help me what could be the problem.
Thanks,
April 19, 2017 at 08:15#30027It is not about charset / character encoding.
Your webapp should send “Content-type: application/pdf” with HTTP response.
PD4ML taglib implicitly sets the correct HTTP header. (Do you use PD4ML taglib?)
It your case it seems to be overridden with “Content-type: text/plain“.April 19, 2017 at 08:30#30028This is the code
<%@ taglib prefix="pd4ml" uri="/WEB-INF/taglib/pd4ml.tld"%>HI This is test :response:
%PDF-1.4 %Çåôåð 1 0 obj % [24] << /Filter /FlateDecode /Length 458 >> stream xÚµQ[OÛ0~ÅáaÒ&ÑÌÎ¥!ú2ÒÒmÆ&·q[Cc§±!ê~ý3PÙÛ^¦ÄÊñw¾K|¼'
GÓkxZe¦fÆÆe~uøô'¿¹=ÂwRº5@ßgØÉ¡VºjÁyÍ8@Üã<òp5*z³¼¯ô(6µú6T_æéýP³ñâÒyÒÊï£zZNÆ«û}~{ôX,h°( âqBÓÐyË_"GþÂ}ÞZ?P.ì¡¥Ýâ4>Ý ¹ÙÚA°(ÊkÞI&ð
=`îÄÚvÅR[««®l:¬Á³Áó×| ±¥Î±â¦ÞImEbESë·H[óq åKвüÉQL¦Ýwu£ßÆL0Ü Ópи ¤ ç¼>SBýô,âÓ{;²Wcr©ÀX®HA¤¿®ÅÅ_Ûfóç³’ûê>AÌó¾Ä;sL(Jâ}ie¼Ó[è+’Pl¥|0²OP> endobj 4 0 obj << /Resources << /Font << /FontTimes-Roman0 3 0 R >> /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] >> /Type /Page /Parent 2 0 R /Contents 1 0 R /MediaBox [0 0 595 421] /Annots [ ] >> endobj 2 0 obj << /Type /Pages /Count 1 /Kids [ 4 0 R ] >> endobj 5 0 obj << /Pages 2 0 R /Type /Catalog /PageLayout /OneColumn >> endobj 6 0 obj << /Creator /Producer /CreationDate (D:20170419135915+05'30') >> endobj xref 0 7 0000000000 65535 f 0000000016 00000 n 0000000856 00000 n 0000000554 00000 n 0000000653 00000 n 0000000915 00000 n 0000000987 00000 n trailer << /Info 6 0 R /Root 5 0 R /Size 7 /ID [<79bcfcd74b67c0cb1345fcede7652884><79bcfcd74b67c0cb1345fcede7652884>] >> startxref 1425 %%EOF April 19, 2017 at 08:33April 19, 2017 at 09:07#30030You published as “response” returned HTTP content, which looks correct.
HTTP server also sends so-called “HTTP Header”, which should have “Content-type: application/pdf” entry.
Your JSP code also seems to be ok. So first I would suspect your web application has a config mapping “JSP -> plain/text”, and the configuration overrides “Content-type: application/pdf” set by PD4ML taglib.
April 19, 2019 at 17:57#30032thanks for tips
-
AuthorPosts
The forum ‘Deployment / Configuration issues’ is closed to new topics and replies.