Xiaolei Hu
11/05/2024, 2:09 PMCeligo AI
11/05/2024, 2:10 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that parsing a PDF to JSON within a SuiteScript routine is quite challenging due to the complexity of PDFs. There are some external libraries like
pdf2json
and pdf-parse
mentioned in the threads, but these are designed to work with Node.js and may not work directly with SuiteScript.
One of the users mentioned that pdf-parse
internally uses pdf.js
, which is designed to work in the browser or on Node.js, and there's a chance it might work with SuiteScript. However, it's important to note that binary operations are barely workable in SuiteScript and you might need to know how to use require Configuration
and how to shim in missing globals.
Another user suggested using an OCR (Optical Character Recognition) solution, especially if the PDFs come in many varieties or are scanned documents. There are many third-party OCR solutions that can convert the PDF to text, which can then be fed into the ERP system.
If you're trying to merge multiple PDFs into one, you can use the <pdfset>
tag which can contain multiple <pdf>
tags. This was suggested in the context of using the BFO Report Generator, which is an external tool and not part of SuiteScript.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/05/2024, 2:11 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830544174
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810364902
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804378331
Celigo AI
11/05/2024, 2:11 PMCeligo AI
11/05/2024, 2:12 PM