我如何使用php docx打开docx文件?

时间:2016-01-28 13:49:13

标签: php docx phpdocx

我正在尝试使用phpdocx打开Docx文件,但我收到此错误。

function open_docx(){


`require_once 'phpdocx/classes/CreateDocx.';
$docx = new TransformDoc();
$docx->setStrFile('submitted/2794849631Aresha.docx');
$docx->generateXHTML();
$html = $docx->getStrXHTML();
}`

致命错误:Class' TransformDoc'在第203行的C:\ xampp \ htdocs \ uni \ includes \ functions.php中找不到

tVp7c9pIEv + fTzFHUSfhBWS7bq / 27EDis3HWVXbsstmr3BmvSpYG0K1eNxoMzib72a97NJJGLyAhq0qw0PT8uqe7px8jWi3j4KBFDsiEWUE8C5lPLm7PPxIekruLSxIy8vHnyc01UCDRO9vidB6yV0LI3SJyQnstHkeW / Zs1p / CU8BQnoQ + JV + bOF5yQ8 + xWt7vkg8VsapE7FjpL23bDgMbkZulx16eOa5GHwfUAAdRLX3AenRjGarUaHPuOPbBDvyu4eK5Ng1iwV2iiREAkM1ZR3w4DTgNu8AX1aWx4KMoqZI4RsdCUCDhHIL5QFoNQiHh8ePS3wSH8 + 4fkFfwmBarnBVRGizIWMpPRKGTcDeb62Dy7viZ / JX + MzQ + 3k6vzcfe01bI9K45zxV + Eduv3VguRQdaYk4fzn8c3Z + bVzdn7MRjll5vxhwkZEk3yjW1YiRUPwogGa99DCIvDVzY3wtkMFgSASx + XfHx4 + HeDUc / isKZ44Uax4fpgL + 20yu328hLE + 97sihTAVzAWrodX + oe8s2ybglIi5r6Aq2WPXyxGYs5AlfKRIf5KMtIxHQn9TcgWY9ZrMzA4aRR / f5HXC + 57FVjYJ​​2ANtrR5E5 / lM3hrEVM8IrNlYKPKiWnaKYjeFRS / t9JdJG6 + VLhe0P2ZOvTreL6nnFM2IKlbfDvvOeUpSIU5o3zJAtLhCzfujxRH + bOFihWhOinbsnRlsWDDdb5CROGa ++ pNgOygN7kP / myhYkWoToR / NihNkKHSol2Eu3Q9upe2wMERY4uyJNU2aWRm3UOcB84EyDbjyVCzWZzbJY + WnMz21REIlUDtpqmctknAh + 9ivTi3XgfX2OBUkgZdaraDTHvaMFZs2InlXZO7CyuiYClhg3CZHJHFLF8mIdIJM0XvIJJiQWVis85yehQw3GrT + 8QNPrkRiSy + 2EWD5J30nbqsWlqE9RyH3pLT / 7jRHcBDHIHPivT4EMQFPCzVPMumuigFdM3Qe kSbTrVuj1xc3Y / PJ7f3 / zYfxndn92dw20umdk9VKMYxDon5JngOeIeeDacXXUde6FB9AybwBXk8GmjZbJUP4J / JtWXsdIUAyjJq2QuiS4msGPKJxe / wS1dZO17ujOjaQCPDoUJTkRnrZjdY0tOaueXJJQZ4JQqJwkgvyN4twn0h1IMCvjq9MOnxiSjcSgit6p30F9dPtC6sWidF1T3PPWoFZL + 9bSNGfXjuxFTQ3Aa4XVKv0N4sqOWMUEh1x6vml / Mmq7Awz / i6iarDVzSuxcwett + KBmHYxn0gHojvgRmE3JyFy8AZ / Dea46iCXOew6Cd / cWMIKrpC + Xj01C07S3EYDV1NXjX6ezxEWk07rbF / NXAWpg2qa08s8Man3BLtXZ / + B + M + DNvnSfPYn7xGtE20uqmyvxy2OV1zQ8hM7IXFYOnDJZ / 1f2oTY5RaigxK690SJzEVkcDy98vMGJA / AEjFHzl09CVriPAh43nmaEbuYjJPlvZxx3FfXIeW5w1gnhIIMuxuefpMSphFUmgfZ1g + Z7DKjC / EtjjGuvHappFYZIdW3EqB1PC + 1lPSqiQlbowLYfBCGc / OSPYu4QLKoBtsiBLpscqQBHRFIJedMXvhvlA14HewH7 / LCNM5 / RE + 1xuNJfalOresN2ovQqL9EljPYEpY6cwNHMIXNFl6SZFiwtrlqmDKNmQQ3C8s2FKqfOiPLPSFP2omkhgD / NTUxWWnCBi1MI7Tte + ZXmg5ZlIF6Bl4V7bSeOVZMAPoj + 6VEwmRF2GsLiXi88e22OlPmN7UA5qTk9pjkrrE11knMad2wRXqbFZisHL90kifXo7LMDwkwmsTiwE37akLcQY2bU24Kl / PVkzrABonVkdKe1lZTaETXhcSU0YJjy9ub6Srw13ez9cTl9IY5MDVCR7npfMwG2oYrpr5AUTE6Lw5FaaXZuhviujdH / RB90AfwePn0HkddUXBmH6TbHfR0Du58P4InfojtgFNAsfertqJv QROT73CNC + vrsemmfjDYGAAiYEHlseYpwbwTVO3j4rEocO2JeOPD9cT / ArRLWT6xhn9EezWkEEr8erReEEx / 8NYs4 / kSTqHyM6SJ2GqGVh7uXRUIk6htIcKPAC8NtYv0 / HGCP / 1x2l7Cl79Vn + rH3WJPjh4251Oj8hnoj / + Oo2no6cful3NjdftnIdwER8TjWl5np4il2qtHh7b + FF + PFbV0nEdfLS5UJfzsCKR1XqlkBYPL0VTQR01sYoKTMyolue54JC4f53Kio5dOUY6KUWsK8dStnVcJVQDb2XhomCPl8 + wU3UVDBj2yGGP9I82GDPDEhFeOvzmNCLO85Nckh6iDcBpNuQVaZ5NuUXhXOz4 + GK7cQuM6nMQjDSlIRjamokKrwdqrZhK + qgn6 + qSDPvKaT + hjaojSQZoP9XYFvEgMQnjJirHenZXiNr9mitM7ph0J1yJr5X9UIoZGxsavNrYw0zTrkZBnrbbvXQUi5rYEJ9muyFntosVlSFeVxlCCbmeFfwnwaAgbwG3UDAVqzPqR / xVT7Vd7ZeyLQD9BrNsPgkb1q6uq078di + zaZNsRYa2F8a0WuttL5fvLi57ZBnjcRREvciZDcRQfyQK4P4IxvcvpgFET492NK3hyKpUeZ + Wx9XmvTJoSo3Lg / N8vKaPgnXii9Qsc6N0laZJ0CQ520QX0Zv6eEmeH3unq1HO8RvAoQgzIyuiTM8AHrXY / US1px5RHoXMhWgnohRkygYwRgOHsgovpdfKJcu7Tqw + BmB1rZqspMGExWozUboKDoHC1zNOu54jIb0ZLbkp2 / Q44djLkZMzS73ckirhqq7dZGxb45R6mnifjmKAEk6rMxBq + 4b6l + W5DoKhZ8qdxF3n9dt3zUuCGDa8SAifIRlCu66aOpG3 / nSmIyMyzAPTm2IbFXYQ6H / mzrOkWVCEBj0mvh4mwxFspSXtFUcTC / UFxyaaFbMiMXZ8eFjYuKAkuQnxVi + P9UcRHtU8yMQvS 7pEWKjsl3z2k1adI5Z3TyPLZXVhIitpkXrD6xfRV2dvAPFNFgRNl1beoclTiubX1fnL2GKEKsfAXZqtamOixhpJrtAbRrqSCI8iMLIQK3CIEk9y7ADqSFHrSx4AOvYoYsb / fJ1Y86Sci + YPnwpaVyJfpebqrFxHxPxg6T9TZiY / UKimRMEb2hNOff2wK1ifcTD7M7TbUEGerCAAGeA + PXIMhh + INlJls6DiRyx781ls4ZPoDZW0BSghVOdiQJXVQzLYJZ8 / 54gQZLE1Y5bLK8G2KREQdVJDPkrTSWadQ1HkJ4bppZorHODVROtNEnjgULENSexrRUhYp7LUF10lB / ahenWD + Ot99sZiBUMmQCh + cndSe34880LoqbfZmoeRcJujH0UyjdZ7YIkfY303tOeQ89D / bnAenZVkO9WKsal8ANS5Obt / F / Whg11pouieUoTkb8qrcbrwEjY5fakhyX + TkDpb /维也纳组织+ V /

1 个答案:

答案 0 :(得分:0)

您可能忘记了.inc的要求。代码可能像

function open_docx()
{
    require_once('phpdocx/classes/CreateDocx.inc');
    $docx = new TransformDoc();
    $docx->setStrFile('submitted/2794849631Aresha.docx');
    $docx->generateXHTML();
    $html = $docx->getStrXHTML();
}

您还可以尝试其他库: https://packagist.org/search/?q=docx&orderBys%5B0%5D%5Bsort%5D=downloads&orderBys%5B0%5D%5Border%5D=desc