5 votes
Accepted

Attempting to pass Flow variable to Apex to use in HTTP request & create PDF

First of all, don't copy from Office products. It screws up your code with "Smart Quotes", which don't compile in Apex. Secondly, your InvocableMethod annotation has an error because you ...
sfdcfox's user avatar
  • 487k
4 votes

Generate and download PDF file from Base64 Encode String

I've solved the problem. Here is the change in client-side controller: let element = document.createElement('a'); element.setAttribute('href', 'data:application/pdf;base64,' + response); element....
Tran Tai's user avatar
4 votes

Render PDF Blob data in visualforce page

Although this post is old, I came across the same problem and found a solution. As @jkraybill mentioned above, Visualforce will not emit binary data. This means we can't retrieve a Blob from ...
Wes Lyons's user avatar
  • 301
3 votes

Alternative to renderas PDF for converting an HTML to PDF in apex

There are a number of AppExchange packages that can generate a PDF using a template- Conga, Drawloop, and Thunderhead are three well known ones. Generally these templates are built in Word or another ...
Alex McDonald's user avatar
2 votes
Accepted

Alternative to renderas PDF for converting an HTML to PDF in apex

Although certainly not the only culprits to mucking up a straight-forward conversion from a VF markup to PDF using the "renderAs" tag... I would carefully review all your CSS or other style markups, ...
Vladimir Dmitriovich Perovsky's user avatar
2 votes

I need to format the content of the PDF attachment on my trigger

As a sample I used an existing page rendered as PDF and wrote a little method to show how this could be done for you. It is very simple. Just to illustrate i also took some screenshots for you. Page ...
Ronnie's user avatar
  • 2,098
2 votes
Accepted

How to save Renderas='pdf' in files folder

By using getContentAsPDF, you can get a visualforce's page content as a pdf, regardless of the pages renderAs attribute. You won't be able to perform DML on the file object directly, since its a ...
battery.cord's user avatar
  • 8,815
2 votes
Accepted

Why am I not getting coverage for my attacmentclass

This is because you din't create class instance and called the class method. As this is a extension class and not a trigger handler class so you need to manually call them from your test class ...
Tushar Sharma's user avatar
2 votes
Accepted

Download as PDF

You can transfer the results back to the client, then initiate a download. // client code let action = component.get("c.orderRecord"); action.setParams({ OrderRecId: recordId }); action.setCallback(...
sfdcfox's user avatar
  • 487k
1 vote

Unable view the attachment saved as pdf Blob

Just adding as answer so that can help others: Base64 input string was not complete and was causing faulty input blob. After fixing it, EncodingUtil.base64Decode worked as expected.
Ayub's user avatar
  • 3,483
1 vote

Generate and download PDF file from Base64 Encode String

I have done something similar but for zip files. Here was the code I used. var element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;base64,' + zipfile_blob); element....
Rory's user avatar
  • 419
1 vote

How to open a save as dialog from javascript?

Generally speaking, modern web technologies do not allow you to manipulate the end-user's browser experience. Whether or not a "Save As" dialog pops up is a decision set by each user at the ...
Morgan Marchese's user avatar
1 vote

System.InvalidParameterValueException: An error occurred while parsing the input string - Blob.toPdf

Using the developer console this generates a System.InvalidParameterValueException: Blob b = Blob.toPdf(''); and the InboundEmail Class documentation says the HTML form may not always be present: ...
Keith C's user avatar
  • 136k
1 vote
Accepted

Contentversion getBodyAsBlob issue

You have skipped the extension part in Contentversion. You need to give file title name with extension. cv.title = Sample+'.pdf'; ContentVersion
Tushar Sharma's user avatar
1 vote

Read any kind of attachment and display it as PDF

Yes you can, but you have to create a custom VF page that show the attachment, once you have that VF ready with its controller, you only need to render that page as a PDF. You can achieve that with ...
MANUELAN00's user avatar
1 vote

HTML Page renderas PDF misplaces alignments

I believe the pdf rendering engine struggles a bit with some CSS styles, which can make normal "modern" positioning using divs and floats inconsistent. I find for this use case its better to strip ...
Alex McDonald's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible