5 votes
Accepted

Combine multiple PDF's together and attach them in a mail?

There's no way to combine PDFs as such. What you would need to do is generate your PDF in a different way, i.e. from a List as opposed to the single record. You can utilise the visualforce that you ...
user avatar
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 ...
user avatar
3 votes

Issues with displaying Blob image in Visualforce page rendered as PDF

This isn't a limitation of APEX so much as it is of the PDF render engine. Think of the PDF document render engine as a printer and you'll understand that it can only accept certain kinds of images. ...
user avatar
  • 40.5k
3 votes

Render PDF Blob data in visualforce page

Visualforce does not emit binary data. As such, there is no direct way I'm aware of to render a PDF blob to the user using Visualforce. The one semi-exception I know of is that you can cause a ...
user avatar
  • 11.1k
2 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 ...
user avatar
2 votes
Accepted

How to use Blob.toPDF() method to create attachment body containing image and texts

Blob.toPDF() should work with a simple HTML input string. So you might do something like the following (untested): <html><body><img src="data:image/jpeg;base64,dGVzdA==" /><p>...
user avatar
2 votes

Add the attachment with image from static resource and value from text area field as pdf file

You can't directly compose a PDF from a text area and a blog image. Instead, they need to be "rendered" or "Printed" as a PDF in some kind of composition program or what some refer to as a "RIP" (the ...
user avatar
  • 40.5k
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 ...
user avatar
  • 2,048
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 ...
user avatar
  • 8,565
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 ...
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(...
user avatar
  • 440k
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, ...
user avatar
1 vote

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....
user avatar
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 ...
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: ...
user avatar
  • 131k
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.
user avatar
  • 3,273
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
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 ...
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 ...
user avatar
1 vote
Accepted

unable to assign Blob variable that is returned by EncodingUtil.base64Decode(String) method

You will need to do the below Blob k = EncodingUtil.base64Decode(call.Signature__c); Attachment record = new Attachment(ParentId = call.Id, Name=call.name+'.pdf', Body = k,ContentType='application/...
user avatar
1 vote

Issues with displaying Blob image in Visualforce page rendered as PDF

This does appear to be a limitation, see and vote up the idea on ideaExchange here. I have seen a couple of similar questions with suggested workarounds here and here.
user avatar
  • 10.4k
1 vote

Dynamically generated VFP attach to the Case : Too many Content Calls

You can't use getContentAsPDF nor do any DML statements inside your constructor. You should move that code out in a separate method that you will call explicitly. Either call the method from the ...
user avatar

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