• Ray Guy
  • NEWBIE
  • 75 Points
  • Member since 2014
  • Architect
  • ForceClarity Ltd.

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 4
    Replies
I have a regular old PDF file on my desktop, and that same PDF file is attached to a record in Salesforce.  Now, when I change the PDF's extension on my computer to ".txt", I can then open it and read the texttual data that makes up the file.  I need to extract some data at the beginning of the ".txt" version of the file that details how many pages the PDF consists of, but I need to do this for many PDF files that are already in Salesforce.

I discovered the "String pdf = System.EncodingUtil.base64Encode(a.Body)" method, which apparently converts the base64 blob representation of the file into an unencoded string... but when I looked at the actual output, I realized that it was totally different compared to the ".txt" version of the PDF on my desktop.  It seems that I'm not encoding/decoding the attachment Body blob to the correct format, but I'm totally clueless as to what to convert it to, or what method I would need to use to convert it.

Does anyone have any ideas as to how I would convert the PDF data to whatever format it gets converted to when I just change the extension on my computer and view it in notepad?

Thanks!


As a final step in our approval process for a quote I'd like to be able to update the account and set the Type to "Customer", I know I can't do it with a field update because both relationships between Quote/Opportunity & Opportunity/Account are lookups and not master/data.

Is there a best practice for this kind of thing, I would imagine it's a pretty common thing to want to do?
I have a regular old PDF file on my desktop, and that same PDF file is attached to a record in Salesforce.  Now, when I change the PDF's extension on my computer to ".txt", I can then open it and read the texttual data that makes up the file.  I need to extract some data at the beginning of the ".txt" version of the file that details how many pages the PDF consists of, but I need to do this for many PDF files that are already in Salesforce.

I discovered the "String pdf = System.EncodingUtil.base64Encode(a.Body)" method, which apparently converts the base64 blob representation of the file into an unencoded string... but when I looked at the actual output, I realized that it was totally different compared to the ".txt" version of the PDF on my desktop.  It seems that I'm not encoding/decoding the attachment Body blob to the correct format, but I'm totally clueless as to what to convert it to, or what method I would need to use to convert it.

Does anyone have any ideas as to how I would convert the PDF data to whatever format it gets converted to when I just change the extension on my computer and view it in notepad?

Thanks!


What is End Date is Schedule Apex?
Go to setup -> Classes -> Schedule Apex
As a final step in our approval process for a quote I'd like to be able to update the account and set the Type to "Customer", I know I can't do it with a field update because both relationships between Quote/Opportunity & Opportunity/Account are lookups and not master/data.

Is there a best practice for this kind of thing, I would imagine it's a pretty common thing to want to do?

Can i use action and onclick attribute on command line apex component together?

Can anyone give me some examples?

 

 

I would like to be able to pass in a parameter in the url http......../Customer/s/topic/0TOU0000000Lij1OAC/Bridgit and concatinate ?article or # article.  I would use javascript to have either the discussion or article tab selected.   I've tried #articles but it only works if the Bridgit topic is already selected.  If its a new load then the new URL changes to http......../Customer/s/topic/0TOU0000000Lij1OAC/articles.

Thanks
Rod