• AJ Mayerhofer
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi all, I'm trying to create a button where the user can upload a pdf, and that pdf is then sent to the Docparser API.

What I currently have is the code from the Docparser API to send an Attachment object: https://github.com/Docparser/Docparser-Apex/blob/master/upload_document.apx

This would work, but I'm not sure how to get a pdf into an Attachment object, and I'm not sure if Attachment is even used in Apex anymore. There are "Salesforce Files" on Lightning which I have been able to manually upload pdfs to, but I'm not sure how to upload to/access them in code.

How do I get a pdf file into an Attachment or File (using an <apex:inputFile>)? What I need for sending information to Docparser is the name of the file and base64 encoded file data.

Thank you for any help.
Hi all! Any help is appreciated.

I'm attempting to create a VisualForce page where the user can upload a pdf of an Invoice, and that pdf will be parsed to get item information and store it in Salesforce.

I have currently set up a VisualForce page where a user can upload a pdf. However, I have run into 2 pertinent questions:

1. Is there a way to get this pdf into the Salesforce backend? I haven't found anything in Object Manager for storing pdfs. Right now the user can select a file but I don't do anything with it.

2 (Main question). Does there exist a Salesforce tool for converting pdfs to XML or JSON? I've found 3rd party applications but would prefer to use a Salesforce-backed application so users are assured their data is secure.

Is this a potential lead for what I'm trying to do?
https://salesforce.stackexchange.com/questions/108054/parsing-pdf-file-attachments
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_javascript_intro.htm
Hi all! Any help is appreciated.

I'm attempting to create a VisualForce page where the user can upload a pdf of an Invoice, and that pdf will be parsed to get item information and store it in Salesforce.

I have currently set up a VisualForce page where a user can upload a pdf. However, I have run into 2 pertinent questions:

1. Is there a way to get this pdf into the Salesforce backend? I haven't found anything in Object Manager for storing pdfs. Right now the user can select a file but I don't do anything with it.

2 (Main question). Does there exist a Salesforce tool for converting pdfs to XML or JSON? I've found 3rd party applications but would prefer to use a Salesforce-backed application so users are assured their data is secure.

Is this a potential lead for what I'm trying to do?
https://salesforce.stackexchange.com/questions/108054/parsing-pdf-file-attachments
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_javascript_intro.htm