简体   繁体   中英

Using PrinceXML in Symfony 1.4

I'm trying to use PrinceXML in my project to generate a PDF to document, I tried to make a simple PDF file with it but does not appear to create a PDF file. So I did a little bit of debugging and tried to run the exe of PrinceXML.

public function executePrincePDF(sfWebRequest $request)
{
  $output = system("D:\\Program Files\\xampp\\htdocs\\leave\\lib\\vendor\\prince\\Engine\\bin\prince.exe --version");
  echo $output;

  return sfView::NONE;
}

But there is no output, I've seen the expected output because I tried running the code above with a plain php file and the output is this:

Prince 8.1 rev 4 Copyright 2002-2012 YesLogic Pty. Ltd. Non-commercial License Non-commercial License

How do I use PrinceXML in Symfony 1.4? Is there something I need to do before I use PrinceXML?

Just use the provided php wrapper class. http://www.princexml.com/download/wrappers/

Rename it to Prince.class.php and put it into the lib directory so symfony will autoload it and read the readme file to see how can you use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM