Hello Guys, I write some codes to render a pdf file into a view page. For some pfd file, they works fine, while others files got different errors. The errors are like: Invalid char `\XXX' in expression, OR unexpexted tCONSTANT / tIDENTIFIER, expecting 'XX' ... Do you guys have any idea how to get ride of these errors? --> Here is my action: def show_pdf respond_to do |format| format.pdf do render :file =>params[:pdfName]+'.pdf', :layout => false end end end --> Errors in Log file: Processing Admin::TracksController#show_pdf (for 64.180.102.109 at 2010-09-22 16:31:44) [GET] Parameters: {"name"=>"test", "action"=>"show_pdf", "controller"=>"admin/tracks"} Rendering /test.pdf ActionView::TemplateError (compile error /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\237' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\237' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\036' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\005' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\231' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\223' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' ...:úŒ- ŸŸ;aR <Ë'Ä Ó‰÷ÛjX ™“çRãk++jÑÊÕUuïYˆsÌÆu. ¢˜ °I"Ç'ЇuÜa... ^ /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\217' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\242' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\230' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\027' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: Invalid char `\260' in expression /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:820: syntax error, unexpected tSTRING_BEG, expecting kEND ... ™“çRãk++jÑÊÕUuïYˆsÌÆu. ¢˜ °I"Ç'ЇuÜa±ÍrD·- µò´DÇç... ^ /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:822: syntax error, unexpected tIDENTIFIER, expecting kEND ...夛 ¤IbÐØ <øâž yÒ§Ú ‘snAÐ¥Ç63"Ä´ ׉ A£5P¦…Ÿ=¹t¯Ø*'[åø¸M‘ÆVÞl¼... ^ /home/app/rails/app/vendor/extensions/track/app/views/test.pdf:822: Invalid char `\240' in expression) on line #820 of vendor/extensions/track/app/views/test.pdf: 817: 3Ðåf$ÌÒtɆ‡7½%Ëe·ø@¦N Ué ž¶»U ¯¨’¼Ð“éµK:e ¾N4 êý#þ9œcB$ ’6ê š =žçCßp|1›Ìæ‘ ˜ÿ 818: Lš2ïWÕ/.Ûurñ ^é =(«š<ý¯ ÜûÉš ßݹÁP¶šß.®¬˜\SúêæÖwþÞ}¯Ë$q©ëëfþrÁ* —®8·ûß= žÄ ;Çaå:‡û¦ ¶€N ÷Ñ €Ic F¥ª„þ0a'žúl9?;DœfªÐQº U° F4 ³œhx H ˜TT ŽÍA} D• ¶ãpn c4ïÍî [}äÚÃZkO!â8où²90Á™:¾c úñ* ”‡m 6 aÔO¯þ±iìÌ™7¡ Ÿ˜€g- ŸÈ W@ Ò ÍRP X¨ B—ºC†˜:b¹òá°„¥ Â×Ñ ˜só_p : œÃt „Iýn¼6¼*kð¤€CÃÒ´’ˆ0`•jNƒw^žä0µ 819: ðŒ‚WA€×ÄK!á‚påB,ÇG ´ /› ±|Z 9ÐAÓp ºSÿöUßµ ˜‚î Ö¶ |ôJ¦éi s` Lw†s0w*Ÿ]§÷0 `-Î s £í6À9RÕ¬×frhÕl»à°µ»Û„mjµÖkŠ§ á¥iœ ì^ã " $ …úä„.;9B!ÙÆý†áUÖ cëiž sfxCůá #2y¸-fªþ Ký…EEnN«Lk|yó®·O *|aêd >uñâAƒHU•¬)›6õ 7P…6wLÑÔ¶½MŸÌát +òÇ•Î2 ÙöaÇP½oº ßíu|·&Ùáà…€]g <{X ‡ mÚ#Ò6ž¶&УxÎ+挢ù,[ÔpäÀÛÓ î nE£ ÖµHýB 820: ÔDÑÈZI4N¤˜ ãÆ͘’›‹Ò Ÿ¼¼ì@cðãÙ«íô—Íèö ÞÜ6 á¦p!Ë ¤_ Ð è ôgôdZñZ o~×é 8 Ùqï]’A ’,V k;+ˆí| » 8ô^ HòÒ¹’— ã ëù s(Bæ ~ã*£<%kÈÿí ÑÚóèR ?;ýí¡Cßž:ú Œ- ŸŸ;aR <Ë'Ä Ó‰÷ÛjX ™“çRãk++jÑÊÕUuïYˆsÌÆu. ¢˜ °I"Ç'ЇuÜa±ÍrD·- µò´DÇç ¯Á&tã E x+;R£ ƒé„‹r§ ‹ò Ö±jÎGÛ·ì/[á€ZDÍFýÛ× ‚9Í›†üÅÓ –á 821: ¹ÿÑ]-@Q]gø?çܽû`—}°/\@–— à*+Âò° ] µ„Zƒ)Í J‹ µtƒˆ Z²Šu¨µ¶15 Ç: ZëL Xè:Q M«±36“é8ŽãÀÄÉÄZm Ѹ\úŸ{ï jÛ½ó͹{ çü÷ÿþÇw‚Õä & bW úÏ ¡>˜¯£š ´ñ÷¹£šáŒÂaÛ@Æ Ï˜Ct ÀòÜæ$’ŸS’—ïöùd/rŸ¹Ôºxo‚ïïî_æYËu¼ê¶ENâ·«¥ ‹£•G¬Òʸo !MÚ‰P^¿¢’ Sœž¿¶ñg¾²…ù‹Š ÕÕùº AîÔ¿(©ª_ ¤ ,îY¿á ^é¤.CûdzK ˯ ý Ñòʪêšòß½»Î”žùæ+ J=@‰f ” Ó’Ì: ‡u r6…Åto =ÉicT€¥nK¼òR¼òª¼×›@adQs å î ”Jîrd)éåwd[ ;:¾¿Û Ìà ó6nd ®tÿb;cïÑœ‚Î+ñ îO© u¡?ç øj°(=3ÃbEßÙMçE}^Ôž 3$ž³ dÄ 822: CFz C¾>; ü._¡Z î A¡ÿ QU%$Tí<¯S‰ÇÙ Pâ×$’̺$ u¥g ï8=J‰žù‹BUY›B¿ øñ‰ç^öJÒ÷V,)©Ã€iùå`ñòºÝ?ÌÊÛ°±:H ià 1„B½ öIŸ~²ë ñ¿³•çY »ÌfŒ_Yk1ÑfÔƒ9* ‘ $1}© 2XlW´>¯¤h8o VYiZ•Í ž¨¹ &†ìmÏîØ-I¾òúe˜×)ËWýtO¼›é6Õ kÛÔ\ô#Ê-² ×cØ×<A hbdD ) `± i“7 ã W ¥`Oã夛 ¤IbÐØ <øâž yÒ§Ú ‘snAÐ¥Ç63"Ä´ ׉ A£5P¦…Ÿ=¹t¯Ø*'[åø¸M‘ÆVÞl¼L‹† 823: ÿ$©Òm’+Ý:Y "ü&9.ÕM• ëß–^à ¾´Ò Ô‘ à^ ,² Æå‰Ð,QPºT î bdd¡rœïõ¸møšž˜!à 5¢#c© ÐÏq3ê +3 ° ¼8[6Ï´¸,á•LÃíÂx¼r¼˜· ®Np ¿CÉ©§Ý<sÒóhᎠÏíð”lûÆÞ}Ò e«ë*¤G¥µ+¿"D"Ïׯy¦¡öÐÏã{èØÞÆç·L¹èƒ—›[6N ¬£Í)°4˜f3 #*í1 0jS¨W™Wlœ!ߪ&’×ñßì‹ó·6pö—T-/ "áúÕ vendor/extensions/track/app/views/test.pdf:822:in `compile!' vendor/radiant/vendor/plugins/haml/rails/./lib/haml/helpers/action_view_mods.rb:14:in `render' vendor/extensions/track/app/controllers/admin/tracks_controller.rb:39:in `show_pdf' vendor/extensions/track/app/controllers/admin/tracks_controller.rb:35:in `show_pdf' vendor/radiant/vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:19:in `process' passenger (2.2.5) lib/phusion_passenger/rack/request_handler.rb:95:in `process_request' passenger (2.2.5) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:378:in `start_request_handler' passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:181:in `spawn_application!' passenger (2.2.5) lib/phusion_passenger/utils.rb:183:in `safe_fork' passenger (2.2.5) lib/phusion_passenger/railz/application_spawner.rb:153:in `spawn_application!' passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:272:in `spawn_rails_application' passenger (2.2.5) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' passenger (2.2.5) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application' passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application' passenger (2.2.5) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `__send__' passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `main_loop' passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' Rendering /home/app/rails/app/public/500.html (500 Internal Server Error) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.