Re: re-generate the PDF with standard non-embedded fonts
William Bader <[email protected]> Wed, 12 Oct 2016 17:57:53 +0000
| Newsgroups | gmane.comp.printing.ghostscript.devel |
|---|---|
| Message-ID | <BN3PR08MB19224D456DF4B0077EEA0120C4DD0@BN3PR08MB1922.namprd08.prod.outlook.com> |
I think that subset fonts have only the characters that are used, renumbered so there are no holes. I have English PDFs with the same issue that they are readable on the screen, but both ghostscript ps2ascii and poppler pdftotext pass a sequence of control characters. Acrobat can sometimes extract readable text. I am not sure if Adobe applications have a way of saving the original glyph positions when they make the PDF or if the original text is in comments for OCR. If CPU time is not an issue, you could try rasterizing the PDF and running it through an OCR like tesseract or cuneiform. ________________________________ From: 王海生-软件研发部 <[email protected]> Sent: Wednesday, October 12, 2016 12:31 PM To: William Bader Cc: gs-devel Subject: Re: [gs-devel] re-generate the PDF with standard non-embedded fonts let me explain exactly what i want here .i am using xpdf to convert pdf files into html or txt i have a original pdf attached. root@6334724bdee5:/tmp# pdffonts 1.pdf name type encoding emb sub uni object ID ------------------------------------ ----------------- ---------------- --- --- --- --------- SRPUEP+SimSun TrueType WinAnsi yes yes yes 13 0 root@6334724bdee5:/tmp# pdfinfo 1.pdf Creator: Online2PDF.com Producer: Online2PDF.com CreationDate: Sat Aug 13 07:42:20 2016 UTC Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 1 Encrypted: no Page size: 594.75 x 419.25 pts Page rot: 0 File size: 31707 bytes Optimized: no PDF version: 1.4 root@6334724bdee5:/tmp# pdftohtml 1.pdf 1-output.html as https://github.com/mozilla/pdf.js/issues/7712 suggest "Looks like PDF removed character encoding ", is there any way to recreate this pdf through original one ?then I can copy the text from it instead of mess http://stackoverflow.com/questions/12703387/pdf-font-encoding-why-cant-i-copy-text-from-a-pdf [http://cdn.sstatic.net/Sites/stackoverflow/img/[email protected]?v=73d79a89bded&a]<http://stackoverflow.com/questions/12703387/pdf-font-encoding-why-cant-i-copy-text-from-a-pdf> PDF Font encoding -- why can't I copy text from a PDF ...<http://stackoverflow.com/questions/12703387/pdf-font-encoding-why-cant-i-copy-text-from-a-pdf> stackoverflow.com After converting a PDF file, I cannot copy the text from it any more. All I get are unreadable characters which make no sense whatsoever. The font is French Script MT ... ------------------ Original ------------------ From: "William Bader"<[email protected]>; Date: Tue, Oct 11, 2016 11:42 PM To: "王海生-软件研发部"<[email protected]>; Cc: "gs-devel"<[email protected]>; Subject: Re: [gs-devel] re-generate the PDF with standard non-embedded fonts There are tools for parsing PDFs like the python tools listed at https://www.binpress.com/tutorial/manipulating-pdfs-with-python/167 You might be able to load the PDF, remove the objects with the embedded fonts, and write a new file, but if the embedded fonts are subsets or have non-standard encodings, the text might become unintelligible. ________________________________ From: gs-devel <[email protected]> on behalf of 王海生-软件研发部 <[email protected]> Sent: Tuesday, October 11, 2016 11:16 AM To: Ken Sharp Cc: gs-devel Subject: Re: [gs-devel] re-generate the PDF with standard non-embedded fonts thx for clarifying that have you ever heard of other tools may deal with this? ------------------ Original ------------------ From: "Ken Sharp"<[email protected]>; Date: Tue, Oct 11, 2016 11:03 PM To: "王海生-软件研发部"<[email protected]>; Cc: "gs-devel"<[email protected]>; Subject: Re: [gs-devel] re-generate the PDF with standard non-embedded fonts At 22:54 11/10/2016 +0800, =?utf-8?B?546L5rW355SfLei9r+S7tueglOWPkemDqA==?= wrote: >no these original pdf files are coming from other places, which out of >my control. if some character use a embedding font ,i want to these >characters using standard fonts instead of embedding font Then you cannot use Ghostscript.