Render pdf file with errors: Invaild Char etc

Hello G.s,

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·ø@¦NU鞶»U¯¨’¼Ð“éµK:e¾N4aêý#þ9œcB$’6êš=žçCßp|1›Ì摘ÿ
818:
Lš2ïWÕ/.Ûurñ­^é=(«š<ý¯ÜûÉšaßݹÁP¶šß.®¬˜\SúêæÖwþÞ}¯Ë$q©ëëfþrÁ—®8·ûß=žÄ;Çaå:‡û¦¶€N÷Ñ
€IcF¥ª„þ0a’žúl9?;DÅ“fªÐQºU°
F4
³œhxH˜TTŽÍA}aD• ¶ãpnc4ïÍî[}äÚÃZkO!â8où²90Á™:¾caúñ
”‡me6aÔO¯þ±iìÌ™7¡
Ÿ˜€g-ŸÈ[email protected] ÒÍRPX¨B—ºC†˜:b¹òá°„¥Â×јsó_p
:œÃt„Iýn¼6¼kð¤€CÃÒ´’ˆ0•jNƒw^žä0µ 819: ðŒ‚WA­€×ÄK!á‚påB,ÇG´ /›±|Z9ÐAÓpºSÿöUßµ˜‚î Ö¶|ôJ¦éis
Lw†s0w
Ÿ]§÷0-ÃŽ s£í6À9RÕ¬×frhÕl»à °µ»Û„mjµÖkŠ§á¥iϓ^ã" $…úä„.;9B!ÙÆý†áUÖacëižsfxCůá#2y¸-fªþKý…EEnN«Lk|yó®·O*|aêd>uñâAÆ’HU•¬)›6õ7P…6wLÑÔ¶½MŸÌát+òÇ•Î2ÙöaÇP½oºaßí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;+ˆí|e» 8ô^HòÒ¹’—eãëù 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: ¹ÿÑ][email protected]]gø?çܽû—}°/@–— à +Âò°]
µ„Zƒ)ÍJ‹µtƒˆZ²Šu¨µ¶15Ç:ZëLXè:Qe­M«±36“é8ŽãÀÄÉÄZmѸ\úŸ{ïjÛ½ó͹{çü÷ÿþÇw‚Õä&bWúÏ
¡>˜¯£š´ñ÷¹£šáŒÂaÛ@ƐϘCtÀòÜæ$’ŸS’—ïöùd/rŸ¹Ôºxo‚ïïî_æYËu¼ê¶ENâ·«¥‹£•G¬Òʸo!MÚ‰P^¿¢’Sœž¿¶ñg¾²…ù‹ŠÕÕùºAîÔ¿(©ª_¤,îY¿áa^é¤.CûdzK˯ýÑòʪêšòß½»Î”žùæ+[email protected]‰f
”Ó’Ì:‡ur6…Åto=ÉicT€¥nK¼òR¼òª¼×›@adQsåJîrd)éåwd[a;:¾¿ÛÌÃó6nd®tÿb;cïÑœ‚Î+ñîO©u¡?çÂøj°(=3ÃbEßÙMçE}^Ôž3$ž³dÄ
822: ­CFzC¾>;ü._¡Z îaA¡ÿQU%$Tí<¯S‰ÇفPâ×$’̺$u¥g
ï8=J‰žù‹BUY›B¿øñ‰ç^öJÒ÷V,)©Ã€iùåñòºÝ?ÌÊÛ°­±:Hià 1„B½öIŸ~²ëñ¿³•çY»ÌfŒ_Yk1ÑfÔƒ9*‘$1}©2XlW´>¯¤h8oVYiZ•Íaž¨¹&†ìmÏîØ-I¾òúe˜×)ËWýtO¼›é6ÕkÛÔ\ô#Ê-²×cØ×<AhbdD)±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ê+3a°¼8[6Ï´¸,á•LÃíÂx¼r¼˜·a®Np¿CÉ©§Ý<sÒóhᎍÏíð”lûÆÞ}Òe«ë*¤G¥µ+¿"D"Ïׯy¦¡öÐÏã{èØÞÆç·L¹èƒ—›[6N¬£Í)°4˜f3#*í10jS¨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:inshow_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:inprocess’
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:inmain_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:inspawn_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:inspawn_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:insynchronize’
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:inspawn_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:inhandle_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:inmain_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)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs