สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
Moderators: mindphp, ผู้ดูแลกระดาน
-
- PHP Super Member
- Posts: 480
- Joined: 25/01/2010 11:57 pm
- Contact:
สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ใครรู้มั่งครับว่าจะแปลง PDF ไปเป็น text หรือ HTML ยังไง หรือมี Library ตัวให้ให้ใช้งานบ้างครับ ของตัวอย่างการใช้งานด้วยนะครับ ผมจะลองหาดูก่อน รบกวนด้วยครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27120
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ผมเคยทำแต่นานมาแล้ว จำรายละเอียดไม่ค่อยได้ แต่หลักการคือ
ใช้ โปรแกรมพวกที่ แปลง pdf เป็น text หรือ html ได้ติดตั้งบน Server
แล้ว ใช้ php รันคำสั่งระบบเพิ่อไปเรียกโปรแกรมพวกนั้น ทำงาน
แต่ถ้าต้องการแปลง pdf เป็นรูปก็ imagemagick ครับ
ใช้ โปรแกรมพวกที่ แปลง pdf เป็น text หรือ html ได้ติดตั้งบน Server
แล้ว ใช้ php รันคำสั่งระบบเพิ่อไปเรียกโปรแกรมพวกนั้น ทำงาน
แต่ถ้าต้องการแปลง pdf เป็นรูปก็ imagemagick ครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Super Member
- Posts: 480
- Joined: 25/01/2010 11:57 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ผมลองใช้ xpdf แต่งงมากตั้งแต่ขึ้นตอนติดตั้ง ไม่ทราบว่าพอจะทำเป็นหรือป่าวครับ window server ครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27120
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ติดตั้งโปรแกรม เป็นโปรแกรมทั่วๆ ครับ
หรือ อาจแค่ copy ไฟล์ไปวางที่ server แล้วใช้ command เรียกให้มันทำงาน
แล้วก็สั่ง command นั้นด้วย php
หรือ อาจแค่ copy ไฟล์ไปวางที่ server แล้วใช้ command เรียกให้มันทำงาน
แล้วก็สั่ง command นั้นด้วย php
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Super Member
- Posts: 480
- Joined: 25/01/2010 11:57 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ตอนนี้ใช้งานได้แล้วครับ ใช้ UTF-8 แต่มันอ่านพวกวรรณยุกต์ไม่ออก เลยลองเปลี่ยนเป็น TIS-620
แต่มันขึ้นแจ้งว่า
ลองแก้แล้วแต่มันก็ยังมองไม่เห็น ไม่รู้ต้องเซ็ตอะไรหรือป่าว
Code: Select all
textEncoding TIS-620
#----- begin Thai support package (2011-aug-15)
nameToUnicode C:\\Program Files\\xpdf\\thai\Thai.nameToUnicode
unicodeMap TIS-620 C:\\Program Files\\xpdf\\thai\TIS-620.unicodeMap
#----- end Thai support package
Code: Select all
C:\Program Files\xpdf>pdftotext -htmlmeta 0405601501.pdf
Config Error: Bad 'nameToUnicode' config file command (C:\Program Files\xpdf\xpdfrc:76)
Config Error: Bad 'unicodeMap' config file command (C:\Program Files\xpdf\xpdfrc:77)
Syntax Error: Couldn't find unicodeMap file for the 'TIS-620' encoding
Config Error: Couldn't get text encoding
Code: Select all
#========================================================================
#
# Sample xpdfrc file
#
# The Xpdf tools look for a config file in two places:
# 1. ~/.xpdfrc
# 2. in a system-wide directory, typically /usr/local/etc/xpdfrc
#
# This sample config file demonstrates some of the more common
# configuration options. Everything here is commented out. You
# should edit things (especially the file/directory paths, since
# they'll likely be different on your system), and uncomment whichever
# options you want to use. For complete details on config file syntax
# and available options, please see the xpdfrc(5) man page.
#
# Also, the Xpdf language support packages each include a set of
# options to be added to the xpdfrc file.
#
# http://www.foolabs.com/xpdf/
#
#========================================================================
#----- display fonts
# These map the Base-14 fonts to the Type 1 fonts that ship with
# ghostscript. You'll almost certainly want to use something like
# this, but you'll need to adjust this to point to wherever
# ghostscript is installed on your system. (But if the fonts are
# installed in a "standard" location, xpdf will find them
# automatically.)
#fontFile Times-Roman /usr/local/share/ghostscript/fonts/n021003l.pfb
#fontFile Times-Italic /usr/local/share/ghostscript/fonts/n021023l.pfb
#fontFile Times-Bold /usr/local/share/ghostscript/fonts/n021004l.pfb
#fontFile Times-BoldItalic /usr/local/share/ghostscript/fonts/n021024l.pfb
#fontFile Helvetica /usr/local/share/ghostscript/fonts/n019003l.pfb
#fontFile Helvetica-Oblique /usr/local/share/ghostscript/fonts/n019023l.pfb
#fontFile Helvetica-Bold /usr/local/share/ghostscript/fonts/n019004l.pfb
#fontFile Helvetica-BoldOblique /usr/local/share/ghostscript/fonts/n019024l.pfb
#fontFile Courier /usr/local/share/ghostscript/fonts/n022003l.pfb
#fontFile Courier-Oblique /usr/local/share/ghostscript/fonts/n022023l.pfb
#fontFile Courier-Bold /usr/local/share/ghostscript/fonts/n022004l.pfb
#fontFile Courier-BoldOblique /usr/local/share/ghostscript/fonts/n022024l.pfb
#fontFile Symbol /usr/local/share/ghostscript/fonts/s050000l.pfb
#fontFile ZapfDingbats /usr/local/share/ghostscript/fonts/d050000l.pfb
# If you need to display PDF files that refer to non-embedded fonts,
# you should add one or more fontDir options to point to the
# directories containing the font files. Xpdf will only look at .pfa,
# .pfb, .ttf, and .ttc files in those directories (other files will
# simply be ignored).
#fontDir /usr/local/fonts/bakoma
#----- PostScript output control
# Set the default PostScript file or command.
#psFile "|lpr -Pmyprinter"
# Set the default PostScript paper size -- this can be letter, legal,
# A4, or A3. You can also specify a paper size as width and height
# (in points).
#psPaperSize letter
#----- text output control
# Choose a text encoding for copy-and-paste and for pdftotext output.
# The Latin1, ASCII7, and UTF-8 encodings are built into Xpdf. Other
# encodings are available in the language support packages.
textEncoding TIS-620
#----- begin Thai support package (2011-aug-15)
nameToUnicode C:\\Program Files\\xpdf\\thai\Thai.nameToUnicode
unicodeMap TIS-620 C:\\Program Files\\xpdf\\thai\TIS-620.unicodeMap
#----- end Thai support package
# Choose the end-of-line convention for multi-line copy-and-past and
# for pdftotext output. The available options are unix, mac, and dos.
#textEOL unix
#----- misc settings
# Enable t1lib, FreeType, and anti-aliased text.
#enableT1lib yes
#enableFreeType yes
#antialias yes
# Set the command used to run a web browser when a URL hyperlink is
# clicked.
#launchCommand viewer-script
#urlCommand "netscape -remote 'openURL(%s)'"
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27120
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
แปลงมาไม่ได้เลยหรอครับ
หรือ อ่านแปลงมาได้บ้างไม่ได้บ้าง
ลองเปลี่ยนที่เก็บ โปรแกรมเป็น C:\\xxxx
หรือ อ่านแปลงมาได้บ้างไม่ได้บ้าง
ลองเปลี่ยนที่เก็บ โปรแกรมเป็น C:\\xxxx
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Super Member
- Posts: 480
- Joined: 25/01/2010 11:57 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ได้แล้วครับ ผมเปลี่ยน
ปกติใส่
Code: Select all
nameToUnicode ./thai/Thai.nameToUnicode
unicodeMap TIS-620 ./thai/TIS-620.unicodeMap
Code: Select all
nameToUnicode C:\\Program Files\xpdf\thai\Thai.nameToUnicode
unicodeMap TIS-620 C:\\Program Files\xpdf\thai\TIS-620.unicodeMap
-
- PHP Super Member
- Posts: 480
- Joined: 25/01/2010 11:57 pm
- Contact:
Re: สอบถามผู้รู้ แปลง PDF เป็น text หรือ HTML
ทีนี้ถ้าผมจะใช้ PHP เรียกใช้งานผมต้องทำยังไงครับ ต้องเอา xpdf ไปไว้ที่ไหน
สมุมติว่าผมใช้ Appserv ผมจะเขียน php ไปเรียกใช้มันยังไง
สมุมติว่าผมใช้ Appserv ผมจะเขียน php ไปเรียกใช้มันยังไง
-
- Similar Topics
- Replies
- Views
- Last post
-
-
แปลง code html เป็น image แต่ไม่แสดงผลลัพธ์
by bankjittapol » 12/11/2019 4:44 pm » in JavaScript & Jquery Ajax - 4 Replies
- 1253 Views
-
Last post by mindphp
13/11/2019 5:29 am
-
-
-
อยากทราบวิธีการ แปลง ไฟล์ html มาเป็น pdf
by Ittichai_chupol » 18/05/2020 12:26 pm » in Programming - PHP - 2 Replies
- 305 Views
-
Last post by Ittichai_chupol
20/05/2020 1:39 pm
-
-
-
การใช้ Domvas library แปลง code html แปลงหน้าเว็บ เป็นรูปภาพ
by bankjittapol » 12/11/2019 6:43 pm » in Jquery & Ajax Knowledge - 0 Replies
- 329 Views
-
Last post by bankjittapol
12/11/2019 6:43 pm
-
-
- 3 Replies
- 1800 Views
-
Last post by buay
15/07/2014 3:42 pm
-
- 0 Replies
- 718 Views
-
Last post by bolue
22/08/2020 6:40 pm
-
-
javascript แปลง string เป็น number จุดทศนิยม 2 ตำแหน่ง
by jataz2 » 23/01/2019 5:56 pm » in AJAX Javascript Library - jQuery - 0 Replies
- 7714 Views
-
Last post by jataz2
23/01/2019 5:56 pm
-
Who is online
Users browsing this forum: No registered users and 13 guests