I tried to use documentCapture.documentToStructure...
# ask-stanley-ai
a
I tried to use documentCapture.documentToStructure on a PDF that is 17 pages long. But instead of a DOCUMENT_TOO_LONG error, it gave me an Unexpected Error wrapped in a DOCTOSTRUCTURE_ERROR. Does this mean something else went wrong besides the document length?
c
AI generated answer (using internal Slack threads):
Based on the conversations, the
documentCapture.documentToStructure
function throwing an Unexpected Error wrapped in a DOCTOSTRUCTURE_ERROR instead of a DOCUMENT_TOO_LONG error could be due to a variety of reasons. One possibility is that there might be an issue with the PDF template itself. If there are any special characters or malformed XML in the template, it could potentially cause an unexpected error. It's also possible that the error could be due to the PDF template being saved despite an error warning. Another possibility is that the error could be related to the
renderAsPdf
function. If there are more than a certain number of lines in the document, it might cause an unexpected error. In any case, it's recommended to double-check the PDF template and the code that's calling the
documentCapture.documentToStructure
function to ensure there are no issues that could be causing the unexpected error. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.793457031
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.791565
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.79083252
Please provide your feedback on this answer.
Thank you for your feedback
a
I'm not rendering the PDF, I'm just extracting text from it.