function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VICKY_SFDCVICKY_SFDC 

how to conver pdf to base6 in apex ???

how to conver pdf to base6 in apex ???
ANUTEJANUTEJ (Salesforce Developers) 
Hi Vikas,

As you have stated only a single statement I tried searching  and I was able to find below links that might be of help, can you try checking them once:

>>https://salesforce.stackexchange.com/questions/102823/converting-attached-pdf-into-base64

> https://developer.salesforce.com/forums/?id=906F00000009DKQIA2

Let me know if this helps.

Regards,
Anutej
VICKY_SFDCVICKY_SFDC
@ANUTEJ  Actully I searched From Many Different,,,unlike java or javascript or c#,,,apex don't have inbuild library function to convert a string to base6.....


Afetr My all Research i come to this conclusion,,,,,kindly check the code once it 


public class PdfConvertingToBase6b {
    
    public static void getTemplate() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        PageReference pageRef = new PageReference('Quotes.pdf');
        Blob    pdf = pageRef.getContentAsPDF();
        
        String quoteId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        
        Quote result =[SELECT Id, Name, Phone,email,(SELECT Id, Name FROM Attachments) FROM Quote WHERE ID = :quoteId];
        
        //a.parentID = <quoteId>;
        Account a = new account(name = 'test');
        insert a;
        Attachment attachmentPDF = new Attachment();
        attachmentPdf.parentId = a.id;
        attachmentPdf.name = a.name + '.pdf';
        //attachmentPdf.body = Encodingutil.base64Encode(pdf);;
        insert attachmentPDF;
    }
}