4 ms·
The best technique for having a PDF with extractable data is to include the data within the PDF itself. That is what LibreOffice can do, it can slip in the enti
by dwheeler 7y ago
The best technique for having a PDF with extractable data is to include the data within the PDF itself. That is what LibreOffice can do, it can slip in the entire original document within a PDF. Since a compressed file is quite small, the resulting files are not that much larger, and then you don't need to fuss with OCR or anything else.
- radarsat1 7y agoAs long as you can trust that the contents of the embedded document is the same as what is displayed.
- dwheeler 7y agoIf you're worried about malicious differences, "regular" PDFs are worse. As noted in the article, it is extremely difficult to figure out the original text given only a "normal" PDF, so you end up using a lot of heuristics that sometimes guess correctly. There's no guarantee that you'll be able to extract the "original text" when you start with an arbitrary PDF without embedded data. So if you're extracting text, neither way guarantees that you'll get "original text" that exactly matches the displayed PDF if an attacker created the PDF. That said, there's more you can do if you have an embedded OpenDocument file. For example, you could OCR the displayed PDF, and then show the differences with the embedded file. In some cases you could even regenerate the displayed PDF & do a comparison. There are lots of advantages when you have the embedded data.
- wenc 7y agoYes to embedding. In Canada, folks have always been able to e-file tax returns, but the CRA (Canada Revenue Agency) also has fillable PDF form for folks who insist on mailing in their returns (with their receipts and stuff so they don't have to store them and risk losing them). When you're done filling the form, the PDF runs form validity checks and generates a 2D barcode [1] -- which stores your all field entry data -- on the first page. This 2D barcode can then be digitally extracted on the receiving end with either a 2D barcode scanner or a computer algorithm. No loss of fidelity. Looks like Acrobat supports generation of QR, PDF417 and Data Matrix 2D barcodes.[2] [1] https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/corporations/corporation-income-tax-return/completing-your-corporation-income-tax-t2-return/2d-code.html https://www.canada.ca/en/revenue-agency/services/tax/busines... [2] https://helpx.adobe.com/acrobat/using/pdf-barcode-form-fields.html https://helpx.adobe.com/acrobat/using/pdf-barcode-form-field...
- gruez 7y ago>for folks who insist on mailing in their returns (with their receipts and stuff so they don't have to store them and risk losing them). The Canadian tax agency offers free storage for whatever receipts you mail them? Sounds nifty. Does the IRS (or any other tax agency) do this?
- wenc 7y agoJust the receipts relevant to the tax return. If you e-file you're responsible for storing receipts up to 6 years in case of audit. (or something like that)
- cbnotfromthere 7y agoIn Canada, folks have always been able to e-file tax returns For various values of "always"
- 72deluxe 7y agoHow does LibreOffice include the entire document with the PDF? Is there a special "data" section of the PDF that includes this? Can you point me to any documentation regarding this? It sounds quite good TBH.