เพิ่มและแก้ไขลิงก์
ทำให้ URL ในเอกสารคลิกได้ หรือถอดลิงก์ที่ชี้ออกนอกออกไป
เครื่องมือนี้ทำงานในเบราว์เซอร์ของคุณทั้งหมด ไฟล์ของคุณไม่ถูกอัปโหลดเลย และคุณตรวจสอบได้เองในแท็บเครือข่ายของเบราว์เซอร์ ตรวจสอบด้วยตัวเอง เปิดแท็บเครือข่ายของเบราว์เซอร์แล้วดู คุณจะเห็นคำขอเล็ก ๆ หนึ่งรายการที่ถามว่าคุณยังมีโควตางานเหลืออยู่หรือไม่ ซึ่งมีแค่ชื่อเครื่องมือกับค่าแฮช ไม่ใช่ตัวไฟล์
เครื่องมือนี้ทำอะไร
A URL printed in a PDF is usually not a link. It is text that looks like one, because whatever produced the document wrote the characters and never created the annotation that makes them clickable. This tool finds those and makes them real, lets you draw links by hand over anything else, and can strip existing links out. Links are annotations laid over a rectangle, so nothing about the page's appearance changes either way.
The common case is a document exported from a design tool or scanned from print where every web address is dead text. The other direction matters too: stripping outbound links from a document before it goes somewhere untrusted, or before it is published, so nobody follows a tracking address that was fine internally.
วิธีทำงาน
- Drop the PDF onto this page.
- Leave automatic detection on for a first pass. Every URL and e-mail address found in the text is listed with the page it sits on.
- Draw a rectangle over anything else that should be clickable and give it a web address, or a page number to jump to inside the document.
- Turn on replacing existing links if the document already carries some and you would rather start clean.
- Press Save links and download the result.
Detection is harder than a regular expression over the page text, which is why most tools that offer it miss half the links. A PDF regularly splits one URL across several text runs, so a naive scan finds "https://exa" and "mple.com/report" and links neither. The runs on each line are joined before matching, which finds the whole address. Trailing punctuation is then trimmed - the full stop that ended the sentence rather than the one inside the domain - and a closing bracket is only dropped when it is unbalanced, because plenty of real addresses end in one and truncating those produces a link that leads nowhere. What is not linked is as deliberate as what is. A bare host with no dot in it is rejected, because in running prose "e.g" and "vs" match far more often than "http://localhost" appears, and a wrong link is worse than a missing one. An address beginning www. gets https:// in front of it, since a bare host is not a URI and readers show the annotation as broken. E-mail addresses become mailto: links, and an address inside a URL is not linked twice.
Links are written without a border and with the print flag set. The first is what stops readers drawing the black box round every link that made documents from the 1990s so recognisable; the second is what keeps the link alive when someone prints the document back to PDF. Internal jumps are written as explicit destinations that preserve the reader's current zoom and land at the top of the target page, rather than as named destinations, which break as soon as anyone splits or merges the file.
Running detection twice on the same document adds a second annotation over the same words unless you turn on replacing existing links first. Two stacked links behave unpredictably - readers pick whichever they find first - so turn that option on for a second pass, and leave it off when the document already carries hand-made links you want to keep.
Stripping outbound links is a separate pass and it ignores everything else on the page: every link with a web address is removed and the internal page-to-page jumps are kept, so a document keeps its own navigation and loses its ability to send a reader anywhere. Sanitise PDF is the wider version of this, removing JavaScript, launch actions and embedded files as well.
Detection needs the text of the document, which is read in your browser by PDF.js, and the annotations are written by pdf-lib in a Web Worker. No address in your document is looked up, resolved or checked against anything - which also means a link to a page that no longer exists is written exactly as printed.
สิ่งที่เครื่องมือนี้ทำไม่ได้
- Detection can only find what is in the text layer. A scan has no text until it has been through OCR, and an address broken across two lines is read as two fragments, so neither is linked.
คำถามที่คนมักถาม
- ทำไม URL ใน PDF ของฉันถึงคลิกไม่ได้ตั้งแต่แรก
- เพราะลิงก์ใน PDF คือคำอธิบายประกอบ เป็นสี่เหลี่ยมที่มีการกระทำผูกไว้ ไม่ใช่คุณสมบัติของตัวข้อความ Word และเครื่องมือออกแบบส่วนใหญ่สร้างมันให้เมื่อคุณวาง URL ลงไป แต่เส้นทางการส่งออกบางแบบทำมันหาย ส่วนไฟล์สแกนไม่เคยมีเลย มันมีแค่ภาพของที่อยู่เว็บ การตรวจจับอัตโนมัติจะอ่านข้อความ หาที่อยู่ แล้วเขียนคำอธิบายประกอบที่ขาดไปทับลงไป
- ลิงก์จากหน้าหนึ่งของเอกสารไปยังอีกหน้าได้ไหม
- ได้ วาดสี่เหลี่ยมแล้วใส่เลขหน้าแทนที่อยู่เว็บ การกระโดดถูกเขียนเป็นปลายทางที่ระบุชัดเจน ซึ่งคงระดับการซูมปัจจุบันของผู้อ่านไว้และไปหยุดที่ด้านบนของหน้าปลายทาง ถ้าต้องการสารบัญทั้งชุด แก้ไขบุ๊กมาร์กมักเป็นเครื่องมือที่ดีกว่า เพราะให้แผงด้านข้างแก่ผู้อ่านแทนที่จะเป็นข้อความที่คลิกได้
- จะลบลิงก์ออกจาก PDF ได้อย่างไร
- มีสองวิธี และทำคนละอย่างกัน การเปิดแทนที่ลิงก์เดิมจะลบทุกลิงก์ก่อนเขียนสิ่งที่คุณเพิ่มลงไป ถ้าคุณไม่เพิ่มอะไรเลยมันจึงล้างลิงก์ทั้งหมด ส่วนการลบลิงก์ที่ชี้ออกนอกจะเอาเฉพาะลิงก์ที่ชี้ไปยังเว็บออก และคงการกระโดดระหว่างหน้าไว้ ซึ่งเป็นสิ่งที่คุณต้องการสำหรับเอกสารที่จะส่งออกนอกองค์กร
- URL บางอันของฉันถูกตรวจจับได้แค่บางส่วน เกิดอะไรขึ้น
- เกือบทุกครั้งคือการขึ้นบรรทัดใหม่ ตัวตรวจจับจะเชื่อมช่วงข้อความภายในบรรทัดเดียวกันก่อนจับคู่ ที่อยู่ที่ถูกแบ่งเป็นหลายช่วงในบรรทัดเดียวจึงถูกพบทั้งอัน แต่ที่อยู่ที่ตัดลงบรรทัดถัดไปจะมาถึงเป็นสองชิ้น และไม่มีชิ้นไหนดูเหมือน URL ด้วยตัวเอง ให้วาดพวกนั้นด้วยมือ สี่เหลี่ยมหนึ่งอันต่อหนึ่งบรรทัด โดยทั้งคู่ใส่ที่อยู่เดียวกัน
- ลิงก์ถูกตรวจสอบหรือถูกส่งไปที่ไหนไหม
- ไม่ทั้งสองอย่าง ไม่มีที่อยู่ใดถูกเปิดดู ดึงข้อมูล หรือตรวจสอบความถูกต้อง และเอกสารไม่เคยถูกอัปโหลด ทั้งการดึงข้อความและการเขียนคำอธิบายประกอบเกิดขึ้นในเบราว์เซอร์ของคุณ นั่นแปลว่าที่อยู่ที่พิมพ์ผิดจะกลายเป็นลิงก์ที่ผิดเหมือนกัน จึงควรไล่ดูอันที่เห็นชัดว่าเสียในรายการก่อนบันทึก