當前位置:首頁 » 編程語言 » phpword在線預覽

phpword在線預覽

發布時間: 2022-08-16 14:57:45

A. php實現word以及其他常見格式文檔在線預覽

不用插件你就開玩笑了,這個不是簡單的程序問題,還要破解文件格式,插件就只需要一個東西,
openoffice
,非常好用

B. 如何用瀏覽器直接打開word文檔 - PHP進階討論

header頭有個選項 attachements=inline什麼的,具體忘了,這個就是在線打開的,但是需要瀏覽器裝office插件

C. php在線預覽word,txt,xls文件,怎麼做

思路
這種類似網路文庫的flash預覽文檔的東東,其主要思路如下:
將word/excel/ppt格式的文檔,即office支持的主要文檔格式通過OpenOffice轉成pdf的插件,將文檔先轉成pdf格式。
通過swftools(http://www.swftools.org/)這個軟體將pdf轉成flash格式。
最後flash的顯示,可以使用flexpaper,亦可以自己寫一個顯示flash格式的東東,然後成功顯示多種格式的文檔,即類似網路文庫的實現。

pdf的預覽是將pdf的每一頁轉為圖片,對應的放大、縮小均是對圖片直接進行操作,此時放大、縮小會有失真的情況出現。
其他例如work/excel/ppt等文檔,均是轉為了html頁面,是的在線預覽時可以選中文字,圖片等。

具體 很麻煩 需要 詳細 請 私信!

D. php如何實現word在線預覽

php 在線預覽 word 文檔,有多種方法,本質上來說,大多是調用客戶端電腦系統安裝的 Word 軟體。

可以用 php 語言的 com 支持功能函數來完成,比如:

$word = new COM("word.application") or die("Unable to instanciate Word");$word->Documents->Open($url.$wordname);

或者使用 word 文檔的插件來完成,比如:swftools 等。

E. PHP怎樣讀取word文檔實現在線預覽,並且不受操作系統的限制,利用COM組件的話太受限了

你可以嘗試一下PHPWord,用它可以把任意word文件轉換為html網頁,這樣任何人都可以在瀏覽器里查看你的word文件了。

PHPWord

盡管目前只是測試版但是功能還是很強勁!完美兼容MF Word並且支持打開.doc or.docx。可以插入文本,文本符,分頁,頁眉/頁腳,表格,列表中的元素,超鏈接等等。

地址:http://phpword.codeplex.com

F. php實現word文檔在線瀏覽功能

推薦用PageOffice,支持跨瀏覽器,從PageOffice官方網站的下載中心裡下載PageOffice 專業版2 for PHP,有豐富的示例源代碼,實現在線編輯保存word。

G. centos下PHP實現WORD在線瀏覽

不一定要另外一個伺服器處理。上傳後作一個類似審核的機制,未立即展示。然後後台統一調度轉換好了。

H. 朋友你好,請問你用PHP如何實現在線預覽PDF/WORD文檔的,能傳代碼給我嗎非常感謝

php自帶pdf函數,你可以直接使用,具體看php手冊,我大概給你列一些

PDF_activate_item — Activate structure element or other content item
PDF_add_annotation — Add annotation [deprecated]
PDF_add_bookmark — Add bookmark for current page [deprecated]
PDF_add_launchlink — Add launch annotation for current page [deprecated]
PDF_add_locallink — Add link annotation for current page [deprecated]
PDF_add_nameddest — Create named destination
PDF_add_note — Set annotation for current page [deprecated]
PDF_add_outline — Add bookmark for current page [deprecated]
PDF_add_pdflink — Add file link annotation for current page [deprecated]
PDF_add_table_cell — Add a cell to a new or existing table
PDF_add_textflow — Create Textflow or add text to existing Textflow
PDF_add_thumbnail — Add thumbnail for current page
PDF_add_weblink — Add weblink for current page [deprecated]
PDF_arc — Draw a counterclockwise circular arc segment
PDF_arcn — Draw a clockwise circular arc segment
PDF_attach_file — Add file attachment for current page [deprecated]
PDF_begin_document — Create new PDF file
PDF_begin_font — Start a Type 3 font definition
PDF_begin_glyph — Start glyph definition for Type 3 font
PDF_begin_item — Open structure element or other content item
PDF_begin_layer — Start layer
PDF_begin_page_ext — Start new page
PDF_begin_page — Start new page [deprecated]
PDF_begin_pattern — Start pattern definition
PDF_begin_template_ext — Start template definition
PDF_begin_template — Start template definition [deprecated]
PDF_circle — Draw a circle
PDF_clip — Clip to current path
PDF_close_image — Close image
PDF_close_pdi_page — Close the page handle
PDF_close_pdi — Close the input PDF document [deprecated]
PDF_close — Close pdf resource [deprecated]
PDF_closepath_fill_stroke — Close, fill and stroke current path
PDF_closepath_stroke — Close and stroke path
PDF_closepath — Close current path
PDF_concat — Concatenate a matrix to the CTM
PDF_continue_text — Output text in next line
PDF_create_3dview — Create 3D view
PDF_create_action — Create action for objects or events
PDF_create_annotation — Create rectangular annotation
PDF_create_bookmark — Create bookmark
PDF_create_field — Create form field
PDF_create_fieldgroup — Create form field group
PDF_create_gstate — Create graphics state object
PDF_create_pvf — Create PDFlib virtual file
PDF_create_textflow — Create textflow object
PDF_curveto — Draw Bezier curve
PDF_define_layer — Create layer definition
PDF_delete_pvf — Delete PDFlib virtual file
PDF_delete_table — Delete table object
PDF_delete_textflow — Delete textflow object
PDF_delete — Delete PDFlib object
PDF_encoding_set_char — Add glyph name and/or Unicode value
PDF_end_document — Close PDF file
PDF_end_font — Terminate Type 3 font definition
PDF_end_glyph — Terminate glyph definition for Type 3 font
PDF_end_item — Close structure element or other content item
PDF_end_layer — Deactivate all active layers
PDF_end_page_ext — Finish page
PDF_end_page — Finish page
PDF_end_pattern — Finish pattern
PDF_end_template — Finish template
PDF_endpath — End current path
PDF_fill_imageblock — Fill image block with variable data
PDF_fill_pdfblock — Fill PDF block with variable data
PDF_fill_stroke — Fill and stroke path
PDF_fill_textblock — Fill text block with variable data
PDF_fill — Fill current path
PDF_findfont — Prepare font for later use [deprecated]
PDF_fit_image — Place image or template
PDF_fit_pdi_page — Place imported PDF page
PDF_fit_table — Place table on page
PDF_fit_textflow — Format textflow in rectangular area
PDF_fit_textline — Place single line of text
PDF_get_apiname — Get name of unsuccessfull API function
PDF_get_buffer — Get PDF output buffer
PDF_get_errmsg — Get error text
PDF_get_errnum — Get error number
PDF_get_font — Get font [deprecated]
PDF_get_fontname — Get font name [deprecated]
PDF_get_fontsize — Font handling [deprecated]
PDF_get_image_height — Get image height [deprecated]
PDF_get_image_width — Get image width [deprecated]
PDF_get_majorversion — Get major version number [deprecated]
PDF_get_minorversion — Get minor version number [deprecated]
PDF_get_parameter — Get string parameter
PDF_get_pdi_parameter — Get PDI string parameter [deprecated]
PDF_get_pdi_value — Get PDI numerical parameter [deprecated]
PDF_get_value — Get numerical parameter
PDF_info_font — Query detailed information about a loaded font
PDF_info_matchbox — Query matchbox information
PDF_info_table — Retrieve table information
PDF_info_textflow — Query textflow state
PDF_info_textline — Perform textline formatting and query metrics
PDF_initgraphics — Reset graphic state
PDF_lineto — Draw a line
PDF_load_3ddata — Load 3D model
PDF_load_font — Search and prepare font
PDF_load_iccprofile — Search and prepare ICC profile
PDF_load_image — Open image file
PDF_makespotcolor — Make spot color
PDF_moveto — Set current point
PDF_new — Create PDFlib object
PDF_open_ccitt — Open raw CCITT image [deprecated]
PDF_open_file — Create PDF file [deprecated]
PDF_open_gif — Open GIF image [deprecated]
PDF_open_image_file — Read image from file [deprecated]
PDF_open_image — Use image data [deprecated]
PDF_open_jpeg — Open JPEG image [deprecated]
PDF_open_memory_image — Open image created with PHP's image functions [not supported]
PDF_open_pdi_page — Prepare a page
PDF_open_pdi — Open PDF file [deprecated]
PDF_open_tiff — Open TIFF image [deprecated]
PDF_pcos_get_number — Get value of pCOS path with type number or boolean
PDF_pcos_get_stream — Get contents of pCOS path with type stream, fstream, or string
PDF_pcos_get_string — Get value of pCOS path with type name, string, or boolean
PDF_place_image — Place image on the page [deprecated]
PDF_place_pdi_page — Place PDF page [deprecated]
PDF_process_pdi — Process imported PDF document
PDF_rect — Draw rectangle
PDF_restore — Restore graphics state
PDF_resume_page — Resume page
PDF_rotate — Rotate coordinate system
PDF_save — Save graphics state
PDF_scale — Scale coordinate system
PDF_set_border_color — Set border color of annotations [deprecated]
PDF_set_border_dash — Set border dash style of annotations [deprecated]
PDF_set_border_style — Set border style of annotations [deprecated]
PDF_set_char_spacing — Set character spacing [deprecated]
PDF_set_ration — Set ration between pages [deprecated]
PDF_set_gstate — Activate graphics state object
PDF_set_horiz_scaling — Set horizontal text scaling [deprecated]
PDF_set_info_author — Fill the author document info field [deprecated]
PDF_set_info_creator — Fill the creator document info field [deprecated]
PDF_set_info_keywords — Fill the keywords document info field [deprecated]
PDF_set_info_subject — Fill the subject document info field [deprecated]
PDF_set_info_title — Fill the title document info field [deprecated]
PDF_set_info — Fill document info field
PDF_set_layer_dependency — Define relationships among layers
PDF_set_leading — Set distance between text lines [deprecated]
PDF_set_parameter — Set string parameter
PDF_set_text_matrix — Set text matrix [deprecated]
PDF_set_text_pos — Set text position
PDF_set_text_rendering — Determine text rendering [deprecated]
PDF_set_text_rise — Set text rise [deprecated]
PDF_set_value — Set numerical parameter
PDF_set_word_spacing — Set spacing between words [deprecated]
PDF_setcolor — Set fill and stroke color
PDF_setdash — Set simple dash pattern
PDF_setdashpattern — Set dash pattern
PDF_setflat — Set flatness
PDF_setfont — Set font
PDF_setgray_fill — Set fill color to gray [deprecated]
PDF_setgray_stroke — Set stroke color to gray [deprecated]
PDF_setgray — Set color to gray [deprecated]
PDF_setlinecap — Set linecap parameter
PDF_setlinejoin — Set linejoin parameter
PDF_setlinewidth — Set line width
PDF_setmatrix — Set current transformation matrix
PDF_setmiterlimit — Set miter limit
PDF_setpolydash — Set complicated dash pattern [deprecated]
PDF_setrgbcolor_fill — Set fill rgb color values [deprecated]
PDF_setrgbcolor_stroke — Set stroke rgb color values [deprecated]
PDF_setrgbcolor — Set fill and stroke rgb color values [deprecated]
PDF_shading_pattern — Define shading pattern
PDF_shading — Define blend
PDF_shfill — Fill area with shading
PDF_show_boxed — Output text in a box [deprecated]
PDF_show_xy — Output text at given position
PDF_show — Output text at current position
PDF_skew — Skew the coordinate system
PDF_stringwidth — Return width of text
PDF_stroke — Stroke path
PDF_suspend_page — Suspend page
PDF_translate — Set origin of coordinate system
PDF_utf16_to_utf8 — Convert string from UTF-16 to UTF-8
PDF_utf32_to_utf16 — Convert string from UTF-32 to UTF-16
PDF_utf8_to_utf16 — Convert string from UTF-8 to UTF-16

I. php 怎麼實現在線預覽 word 文檔

目前程序編譯語言有很多種,其中php是最為常見的一種編程語言。php讀取word文檔是很多朋友都想了解的,下面就由達內的老師為大家介紹一下。
?php
/*
*
必須將
php.ini
中的
com.allow_dcom
設為
true
*/
function
php_word($wordname,$htmlname,$content)
{
//獲取鏈接地址
$url
=
$_server['http_host'];
$url
=
";
$url
=
$url.$_server['php_self'];
$url
=
dirname($url)."/";
//建立一個指向新com組件的索引
$word
=
new
com("word.application")
or
die("unable
to
instanciate
word");
//顯示目前正在使用的word的版本號
echo
"loading
word,
v.
{$word-
version}";
//把它的可見性設置為0(假),如果要使它在最前端打開,使用1(真)
$word->visible
=
1;
//---------------------------------讀取word內容操作
start-----------------------------------------
//打開一個word文檔
$word->documents->open($url.$wordname);
//將filename.doc轉換為html格式,並保存為html文件
$word->documents[1]->saveas(dirname(__file__)."/".$htmlname,8);
//獲取htm文件內容並輸出到頁面
(文本的樣式不會丟失)
$content
=
file_get_contents($url.$htmlname);
echo
$content;
//獲取word文檔內容並輸出到頁面(文本的原樣式已丟失)
$content=
$word->activedocument->content->text;
echo
$content;
//關閉與com組件之間的連接
$word->documents->close(true);
$word->quit();
$word
=
null;
unset($word);
//---------------------------------新建立word文檔操作
start--------------------------------------
//建立一個空的word文檔
$word->documents->add();
//寫入內容到新建word
$word->selection->typetext("$content");
//保存新建的word文檔
$word->documents[1]->saveas(dirname(__file__)."/".$wordname);
//關閉與com組件之間的連接
$word->quit();
}
php_word("tesw.doc","filename.html","寫入word的內容");
?>

熱點內容
壓縮段的作 發布:2025-01-20 07:04:13 瀏覽:378
安卓studio字體如何居中 發布:2025-01-20 07:04:13 瀏覽:151
edge瀏覽器無法訪問 發布:2025-01-20 06:52:57 瀏覽:330
c語言inline函數 發布:2025-01-20 06:45:43 瀏覽:747
安卓手機如何把鎖屏時間去掉 發布:2025-01-20 06:34:16 瀏覽:435
linux卸載jdk17 發布:2025-01-20 06:33:29 瀏覽:231
猿編程使用 發布:2025-01-20 06:17:58 瀏覽:453
編譯lichee 發布:2025-01-20 06:16:33 瀏覽:157
f5演算法 發布:2025-01-20 06:11:39 瀏覽:256
吃雞游戲伺服器被鎖怎麼辦 發布:2025-01-20 06:04:21 瀏覽:176