Skip to main content

Questions tagged [blob.topdf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
126 views

Converting Rendered Email Templates to PDFs - issue(s)

I'm hoping someone here will be able to help me as I have been trying different "solutions" for days now...to no avail. I am new to Apex and do have some Java in my backgorund...not much ...
greeng13's user avatar
1 vote
1 answer
527 views

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

I think I'm quite over my head in this class. I'm trying to do about three different things that are brand new to me. In short, I'm trying to do this : Pass a variable to an Apex class from a Flow (...
Zoom_v's user avatar
  • 3,894
0 votes
0 answers
532 views

Issue with PDF file using getContentAsPDF

I am creating attachment with paypal invoice using getContent method in apex and attaching file under record but there issue with pdf file. it's not creating properly Here is my code : String ...
uday chavan's user avatar
1 vote
0 answers
957 views

Generate PDF With LWC

Need to save a pdf of the particular div which include Lightning-Datatable. Below are options I don't want to use as workaround: window.print(); Vf redirect(Solutions without Visualforce Page) Tried ...
Shreyash Vyas's user avatar
1 vote
2 answers
6k views

Generate and download PDF file from Base64 Encode String

I want to create a LWC to download a simple PDF file with a random string. Here is my code: Apex Class: public with sharing class PdfLwcController { @AuraEnabled public static String ...
Tran Tai's user avatar
0 votes
1 answer
969 views

blob topdf as attachment PDF apex no renders background color

I'm creating an HTML string that I put in a in blob.toPDF to send PDFs as attachments public static Messaging.EmailFileAttachment attachmentBuilder(String fileName, string attachEmailInHTML){ ...
arnaud's user avatar
  • 106
0 votes
1 answer
3k views

Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. In LWC

Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. See https://www.chromestatus.com/feature/5706745674465280 for more ...
rammohan reddy kasu's user avatar
0 votes
1 answer
5k views

How to open a save as dialog from javascript?

I have a pdf file as a blob in javascript. I want to save the it on my local machine. I am creating an anchor tag, and simulating the click event to download the file. I want to open the "Save as&...
sam's user avatar
  • 1
0 votes
1 answer
3k views

Iframe Id null in iframe onload method

I am loading iframe dynamically on button click of the window, the iframe uses pdfJs library. However, in onload method of the iframe, I am geting iframe object as null, and getting error. This is my ...
mvk1991's user avatar
  • 555
0 votes
1 answer
1k views

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

Trying to convert inbound email to Blob PDF and adding to Document File, Below is the code. When i ran the below code getting this error **FATAL_ERROR System.InvalidParameterValueException: An error ...
SFDC_Beginner's user avatar
1 vote
2 answers
2k views

Save image as PDF using Apex and send email with attachment

We have an API which return us a base64 format of am image file. We have to attach this image file as PDF in an email and send it on. The issue is if we use Base64.toPdf('base64 version of image file'...
Nagendra Singh's user avatar
1 vote
0 answers
1k views

Dynamic pdf filename to my visualforce page using iframe

Here is my visualforce page code where i am displaying pdf in iframe but i am not able to set "file name" of this pdf, <apex:page standardController="xyz__c" title="XYZ Form" action="{!Mergepdf}" ...
Viral Shah's user avatar
0 votes
1 answer
816 views

Download as PDF

In below code i have got the content in PDF i have to download it into PDF to my system instead of downloading it into salesforce. public class OrderPDF { public Order orderRecord{get; set;} ...
Raja Sabarish's user avatar
0 votes
0 answers
2k views

Visualforce page rendered as PDF saving to salesforce files (Content document) but failed to reload error on opening pdf

Rendering VF page as PDF. Attachment pdf is working fine in classic. On opening pdf in classic view PDF is correctly opening but when i switch to lightning then on click of button pdf is saved in ...
Maik Floyd's user avatar
0 votes
1 answer
808 views

Display blob value in VF page and render as PDF

I am trying to display a PDF stored in static resource and passing the blob as a string to VF page and late rendering as PDF <apex:page controller="DataDisplayController" renderAs="pdf"> {!...
SFDC's user avatar
  • 461
1 vote
0 answers
61 views

Issue rendering pdf on VF

I am not able to render pdf files of size greater than 1.5 Mb on VF using the below article. Only blank screen appears on load/preview opposite to successful pdf generation in case of <1.5 Mb pdf ...
user59004's user avatar
0 votes
1 answer
976 views

Unable view the attachment saved as pdf Blob

I'm getting a base64 String pdfContent from a callout response which I'm trying to save as a attachment of a record. I tried to save it after decoding it with EncodingUtil.base64Decode('base64String'...
A.Bretto's user avatar
  • 492
1 vote
1 answer
5k views

How to save Renderas='pdf' in files folder

Is it possible to save a visualforce page with renderas='pdf' to the files folder so I can attacht the files to an email in lightning? Something like files f = new files( FolderId = UserInfo....
Thomas's user avatar
  • 2,310
0 votes
1 answer
152 views

Why am I not getting coverage for my attacmentclass

I have a extension class to attach a PDF to a record. I made Unittest which status gives succes but my code still has no coverage, why is this? Class: public with sharing class attachPDF { private ...
Thomas's user avatar
  • 2,310
0 votes
1 answer
902 views

Contentversion getBodyAsBlob issue

I'm tried to insert contentversion record from API response. In response getting PDF only. I've tried below code but i'm having issue in previewing the file. ContentVersion cv = new ContentVersion(); ...
user10286's user avatar
  • 422
1 vote
1 answer
434 views

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

I have trigger that creates and attaches a PDF and then send it out as an email. I would need to change the font and margin style on my div (e.g A.Application Letter Form) seems to be not working. May ...
Ramon sanchez's user avatar
0 votes
0 answers
1k views

Resource image in to Blob for attachment

I have a trigger method after update on Opportunity. I am trying to insert attachment after closing the opp. private void createOppAttachments(list<Opportunity> opps) { Set<Id> ...
Ajay 's user avatar
  • 1,609
-2 votes
1 answer
2k views

Apex Uploading PDF Failed to Load

There isn't any error after my Codes upload the File to the Document Folder. But When I try to view the file that was uploaded I keep getting a Fail To Load PDF Document message. Can Someone tell me ...
Luke Au's user avatar
  • 179
2 votes
0 answers
203 views

pdf not downloading properly

I have these lines of code: public String getCoverPdf() { if(!String.isBlank(pdfLink)) { Http h = new Http(); HttpRequest req = new HttpRequest(); ...
JoulinRouge's user avatar
0 votes
2 answers
829 views

Read any kind of attachment and display it as PDF

Is there anyway you could read an attachment on your record(PDF, Image, Word etc) and display it as PDF on your visual force page? Thanks.
user321522's user avatar
0 votes
1 answer
246 views

Null Pointer exception to add blob to list of blob

I have below piece of code where I am getting a Null pointer exception adding blob to a list of blobs. Can someone let me know my mistake please? Apex code counter=1; form = integer.valueof(...
Testing_SFDC's user avatar
  • 2,950
2 votes
2 answers
3k views

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

Is there any alternative or work around to HTML to PDF convert in apex? Please help and provide your suggestions.
Testing_SFDC's user avatar
  • 2,950
0 votes
1 answer
2k views

HTML Page renderas PDF misplaces alignments

I have an apex page where I am using HTML tags mandatorily. Here , I need to convert it to PDF. Using renderAs PDF is misplacing the alignments and messed up in Apex page. Please find my Apex Page ...
Testing_SFDC's user avatar
  • 2,950
5 votes
0 answers
580 views

Merging multiple pdf files

I was just wondering if anyone has created a method to merge 2 or more pdf files into one single pdf using Apex. I basically want to give the option to users by uploading or selecting few different ...
Metawaa's user avatar
  • 709
7 votes
4 answers
8k views

Render PDF Blob data in visualforce page

I have pdf blob data returning in my webservice.. I want to display this blob data as pdf in visualforce page. Is there any way to render the page as pdf with this blob data looking like pdf page. ...
NoNicknameSFDC's user avatar
2 votes
1 answer
1k views

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

I generating the attachment from trigger action, Need to generate the attachment as pdf file, contains image from static resource and value from text area field. I have trying to use blob.toPdf() to ...
Hareesh's user avatar
  • 21
2 votes
0 answers
112 views

Email a PDF page to User who clicks

I have a custom button on Custom object Incident. When it is clicked from a particular Incident record a VF page is displayed in PDF format. I need not to show this PDF to the User instead the PDF ...
Testing_SFDC's user avatar
  • 2,950
4 votes
1 answer
5k views

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

As of now , all i have is a VF page which renders as a PDF and it needs Account ID to be passed to generate a PDF . Is there a way wherein i can group all the PDF's into a single PDF ? Should i change ...
TroubleShooter's user avatar
0 votes
1 answer
5k views

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

Unable to assign Blob variable that is returned by EncodingUtil.base64Decode(String) method Blob k = EncodingUtil.base64Decode(call.Signature__c); Attachment record = new Attachment(ParentId = call....
Testing_SFDC's user avatar
  • 2,950
2 votes
2 answers
5k views

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

I want to use Blob.toPDF() method to create attachment body, currently using: attachmentPDF.Name = account.Name + '.pdf'; attachmentPDF.body = Blob.toPDF(pdfContent);` Inside pdfContent I want to ...
Testing_SFDC's user avatar
  • 2,950
6 votes
2 answers
3k views

Issues with displaying Blob image in Visualforce page rendered as PDF

Blob images appears in Visualforce Page but unable to display in renderas="pdf" form. Is this a limitation with apex? Is there any alternative solutions? Please help me out here is the code for my ...
Testing_SFDC's user avatar
  • 2,950
1 vote
0 answers
406 views

Decode Signature

I've one signature field containing encoded values like 'iVBORw0KGgoAAAANSUhEUgAAApAAAACNCAYAAAAAYko8AAAAHGlET1QAAAACAAAAAA...' and i want to restore it back and put them into a list and display the ...
Testing_SFDC's user avatar
  • 2,950
1 vote
1 answer
743 views

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

I have to save the Dynalmically generated PDF from VFP on the Order Object I am trying to attach PDF in contructor call only For the given code I am getting error : Too many Content Calls public ...
user2703132's user avatar
1 vote
1 answer
2k views

Blob.topdf() throws error when parameter consist of <img>

Seeking some help. When Blob.topdf() has to process email.htmlbody with tag, it throws an error as explained here. http://help.salesforce.com/apex/HTViewSolution?id=000123577&language=en_US can ...
Raish's user avatar
  • 707