2010-12-28 7 views
0

지난 주 WYSIWYG - cKeditor에서 작업하는 동안. 질문이 떠 올랐습니다. 어떤 방법으로 추출하거나 docx 또는 docx 파일의 내용을 블로거 또는 WordPress 텍스트 영역으로 가져올 수 있습니까? 예를 들어, doc (x) 파일에서 텍스트 나 이미지를 선택하고 복사 할 필요가 없습니다. 우리가해야 할 일은 파일을 WYSIWYG에 넘겨주고 doc (x) 파일의 내용을 게시물에 붙여 넣는 것뿐입니다.WYSIWYG에서 doc 파일 추출

의견을 보내 주시면 감사하겠습니다. 감사합니다 파와 즈

답변

1

편집 : 또는 this plugin을 참조하십시오.

이 플러그인은 게시물 모든 내용 를 추출, 업로드 .DOCX 파일을 처리합니다.


나는 당신이 .DOCX 파일의 내용을 추출 할 PHPWord를 사용할 수 있다고 생각 .

(I 아마 .DOCX 파일이 특정 구조를 가진 단지의 .zip 파일입니다 언급해야한다 Open Office XML)

그러나, 대신 독서의 .docx 파일을 쓰기에 더 헌신적 인 것 같다. 이 같은 XML 문서를 반환

$this->_objZip = new ZipArchive(); 
$this->_objZip->open($this->_tempFileName); 

$this->_documentXML = $this->_objZip->getFromName('word/document.xml'); 

:

__construct에서 수업이 포함 PHPWord_Template이 거기에 문서의 텍스트가 않습니다

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"> 
    <w:body> 
    <w:p w:rsidR="005B1098" w:rsidRDefault="005B1098"/> 
    <w:p w:rsidR="005B1098" w:rsidRDefault="005B1098"> 
     ... 
     <w:r w:rsidRPr="00F15611"> 
     <w:rPr> 
      <w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Calibri"/> 
      <w:lang w:val="en-GB"/> 
     </w:rPr> 
     <w:t xml:space="preserve">The following table contains a few values that can be edited by the PHPWord_Template class.</w:t> 
     </w:r> 
     ... 
    </w:body> 
</w:document> 

.

모든 서식을 옮기고 싶다면이 방법을 사용하는 것이 많은 것처럼 보입니다. 텍스트 필드에 복사하여 붙여 넣는 것보다 훨씬 효과적입니다.

+0

답장을 보내 주셔서 감사합니다. 너 스스로 해봤 니? –

+0

아니요, PHPWord 소스를보고 7zip에서 .docx를 열어'word/document.xml'의 일부를 복사하는 것 외에는 없습니다. – thirtydot