Anan Phonphoem
Computer Engineering Dept., Faculty of Engineering, Kasetsart University-
การจัดการ PDF ด้วย PDF Labs
Posted on May 29th, 2014 No commentsDownload and Install from PDF Labs [http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/]
PDFtk Server Examples
[http://www.pdflabs.com/docs/pdftk-cli-examples/]
These examples show you how to perform common PDF tasks from the command-line using pdftk.
Collate scanned pages
pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf
or if odd.pdf is in reverse order:
pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf
Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf
Encrypt a PDF using 128-bit strength (the default), withhold all permissions (the default)
pdftk 1.pdf output 1.128.pdf owner_pw foopass
Same as above, except password baz must also be used to open output PDF
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz
Same as above, except printing is allowed (once the PDF is open)
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing
Join in1.pdf and in2.pdf into a new PDF, out1.pdf
pdftk in1.pdf in2.pdf cat output out1.pdf
or (using handles):
pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf
or (using wildcards):
pdftk *.pdf cat output combined.pdf
Remove page 13 from in1.pdf to create out1.pdf
pdftk in.pdf cat 1-12 14-end output out1.pdf
or:
pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
When using the Windows command-prompt, it helps to use drag-and-drop from the file manager: drag the input PDF file from the file manager onto the command-prompt, and its full pathname will appear at the prompt.
Apply 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to foopass.
pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass
Join two files, one of which requires the password foopass. The output is not encrypted.
pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf
Uncompress PDF page streams for editing the PDF in a text editor (e.g., vim, emacs)
pdftk doc.pdf output doc.unc.pdf uncompress
Repair a PDF’s corrupted XREF table and stream lengths, if possible
pdftk broken.pdf output fixed.pdf
Burst a single PDF document into pages and dump its data to doc_data.txt
pdftk in.pdf burst
Burst a single PDF document into encrypted pages. Allow low-quality printing
pdftk in.pdf burst owner_pw foopass allow DegradedPrinting
Write a report on PDF document metadata and bookmarks to report.txt
pdftk in.pdf dump_data output report.txt
Rotate the first PDF page to 90 degrees clockwise
pdftk in.pdf cat 1east 2-end output out.pdf
Rotate an entire PDF document to 180 degrees
pdftk in.pdf cat 1-endsouth output out.pdf
Article Author: Sid Steward
-
Share USB ใน Visual Box
Posted on January 3rd, 2014 No commentsต้องทำการ add user ที่ใช้งานเข้าใน group ของ vboxusers ก่อน USB จึงจะมองเห็น
anan# adduser anan vboxusers
-
Open visual trace route
Posted on November 28th, 2013 No commentsเป็นเครื่องมือในการศึกษา Trace route ที่น่าสนใจ
ถ้าต้องการติดตั้งบน Ubuntu ให้ทำตาม link ด้านล่างนี้ได้เลยครับhttp://www.thefanclub.co.za/how-to/how-install-open-visual-traceroute-ubuntu
-
การไม่อนุญาติให้ดู file listing ใน folder
Posted on August 23rd, 2013 No comments1. ทำการสร้า่ง index.html แบบว่างเปล่าไว้ในแต่ละ directory ที่ไม่ต้องการให้ listing ได้
2. ถ้าจะทำหลาย folder อาจใช้วิธีเขียน script ง่าย ๆ ดังนี้
anan:~$ ls
anan:~$ 01 02 03 04 <— สมมติว่ามี 4 folderanan:~$ Temp=`ls` <— สร้างตัวแปล Temp เพื่อเก็บค่าที่ได้จากการใช้คำสั่ง ls (ระวังใช้ตัว back quote `)
anan:~$ echo Temp
anan:~$ 01 02 03 04 <—- จะเห็นค่าตัวแปร Temp เป็นชื่อ folder ทั้งหมดanan:~$ for x in $Temp <—- สร้าง for loop ใช้ตัวแปรชั่วคราวชื่อ x
> do
> touch $x/index.html <—– ทำการสร้าง file ชื่อ index.html แบบว่างเปล่าขึ้นมาโดยใช้คำสั่ง touch
> done
anan:~$ถ้าเข้าไปดูแต่ละ folder ก็จะพบ file ชื่อ index.html
anan:~$ cd 01
anan:~/01$ abc def a111 index.html(ขอขอบคุณ อ.ดร.อภิรักษ์ จันทร์สร้าง ที่แนะนำเทคนิคนี้)