Guest User

Untitled

a guest
Jan 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. ## SuccessView.php
  2.  
  3. <?php
  4. public function executeRtf(AgaviRequestDataHolder $rd) {
  5. $rtf = new FRTF();
  6. $rtf->Open();
  7. $rtf->SetPaperSize('A4');
  8. $rtf->SetPageOrientation('L');
  9. $rtf->SetViewKind('Page');
  10. $rtf->SetViewScale(100);
  11. $rtf->SetViewZk('None');
  12. $rtf->Write("The first text to be diplayed");
  13. $rtf->Write("This string will be displayed continously", 'no');
  14. $rtf->Write('Another string in a new paragraph');
  15. //$rtf->Output();
  16. $rtf->Close();
  17. $rtf_body = $rtf->buffer;
  18. echo $rtf_body;
  19. }
  20. ?>
  21.  
  22. ## Expected output
  23.  
  24. {\rtf1\ansi\ansicpg{\info{\creatim\yr2011\mo03\dy31\hr16\min03\sec54}}\viewkind1\viewscale100\viewzk0\paperw16839\paperh11907\psz9\landscape\par \pard\plain The first text to be diplayed This string will be displayed continously\par \pard\plain Another string in a new paragraph}
  25.  
  26. ## Actual output
  27.  
  28. {1{{20110331160915}}11000009 The first text to be diplayed This string will be displayed continously Another string in a new paragraph}
  29.  
  30. ## Output Type (output_types.xml)
  31.  
  32. <output_type name="rtf">
  33. <ae:parameter name="http_headers">
  34. <ae:parameter name="Content-Type">application/rtf</ae:parameter>
  35. <ae:parameter name="Content-disposition">inline; filename=QualitativeData.rtf</ae:parameter>
  36. </ae:parameter>
  37. </output_type>
  38.  
  39. ## Routing (routing.xml)
  40.  
  41. <route name="rtf" pattern=".rtf$" stop="false" cut="true" output_type="rtf" />
  42.  
  43. ## URL generation
  44.  
  45. <?php echo $ro->gen('route_name+rtf'); ?>
Add Comment
Please, Sign In to add comment