PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: pd4ml transform tag renders weird characters
   PostPosted: 18 Apr 2017, 15:54 
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þŒŖ™»IfˆcùÇÌäKBҒÒÐë]››a Pk[Ž$pé¯ïʐ ÉÌ&×aÒJÚgß´»Ü[?Á ë÷9“Š‹¼^D` n\uß>’‰ÚÎ_$@úõí#ùÏQ*¡mÜ»ä)–Ç"áù¤çqéŠ)s¡×í@ö:;»ùcüûÕäcÿˆ]ßýY÷ü"ïÑnØ ½ßœò+åïßN¿Î’_§Þdø.|E#ÉèõHEô“¯L„tòâÁÊ‚^€ë >@Ž‡24óxq>ì[Ž„8ø9ZÍ«x:ÎÌIÊsP3˅+‹@iٮƻ×O–rRã„áãàôÚÁÌüÐ7{ÌoâŽ?Îj¬v–¸{o5ÈRóãEHE-gC«aÀ&VãøRäú KçL󘝉4!àžÀpl5†hOb ï;„ág«q1´njµ¿Ýºê†¤†ºÈÙ_jz1³Xó9ƒnj}*ã)¸ w¨z]ñ‰ão%ÿpÊÆ3)®üí·[&ç

Thanks,
Suresh


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 18 Apr 2017, 15:58 
The "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.


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 19 Apr 2017, 08:26 
Thanks 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=utf8

Weblogic 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,


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 19 Apr 2017, 10:15 
It 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".


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 19 Apr 2017, 10:30 
This is the code
<%@ taglib prefix="pd4ml" uri="/WEB-INF/taglib/pd4ml.tld"%><pd4ml:transform
screenWidth="400"
pageFormat="A5"
pageOrientation="landscape"
pageInsets="100,100,100,100,points">
<div >
HI This is test :
</div>
</pd4ml:transform>

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Ókx‘Ze¦ 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&ð`u=`”žîÄÚvÅR[««®l:¬œÁ³Áó×|…±¥Î±â¦ÞI›mžE—bESë·H[óq åKвüÉQLŸ‰¦’ÝŒw–u£ßÆL0Ü Óp и…¤ ç¼>œSBýô,‰âÓ{­;²W•cr©ÀX ®H—„A‹¤¿®ÅÅ_Ûfó ç³'û“ê>A„Ìó¾Ä;sL(Jâ}ie ¼Ó[èŠ+Ž'Pl¥|­0²OP<oX9a¨[þ~ë~ï¿uçä77±Ðæ endstream endobj 3 0 obj << /Type /Font /Subtype /Type1 /Encoding /WinAnsiEncoding /BaseFont /Times-Roman >> 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


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 19 Apr 2017, 10:33 
After removing PD4ml transform tags response in jsp is:

HI This is test :

Thanks


  Subject: Re: pd4ml transform tag renders weird characters
   PostPosted: 19 Apr 2017, 11:07 
You 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.



[Reply]     [ 7 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share