rasha1489
(Rasha1489)
June 15, 2013, 9:07pm
1
i need to open a document in yii application in order to print it.
in a folder i have a x.php file, and a y.docx file
in x.php file i wrote:
<h3> <?php echo CHtml::link('Back', array('/site/page', 'view'=>'y.docx'));?> </h3>
<a href="y.docx">Click</a>
in the first link the result is : The requested view "y.docx" was not found.
the second link’result is: The system is unable to find the requested action “y.docx”.
can anyone help me, how to generally open a document file?
Hodges
(Dev)
June 16, 2013, 6:08am
2
You’ll need an external library to do what you want.
Here’s one that should allow you to open a Word document: http://www.phpdocx.com/
rasha1489
(Rasha1489)
June 16, 2013, 7:12pm
3
it seems that this library generate docx report. i already used the mpdf extension to generate docx and pdf reports. the problem now is to open the generated reports or any other docx documents.
for example if i generated a report using one of these libraries or extension, and i put the output result in protected/reports folder. and i created a link to open the generated documents, how to write this link?
thank you
fouss
(Jsfousseni)
June 17, 2013, 12:19am
4
May be the document is not linked correctly
<a href="path_to_y.docx">Click</a>
rasha1489
(Rasha1489)
June 19, 2013, 8:19pm
5
i generated a pdf report under \protected\reports\StudentReports\certificate.pdf folder
when i generate the report, it redirect me to the following path:
http://localhost/yii/basapp/index.php/site/page/view/studentReport/studentID/3333-10103/term/4
in this page, i need to make a link to the studentReports to open certificate.pdf
anyone have any idea how to make this happen.
thank you