Download PDF results in unopenable file?

Hi,

I have a PDF component and am trying to download the PDF using the following setup.

But the downloaded file can't be opened by Adobe reader. Any clues?

Thanks, Jeremy

I hope you don't mind me learning along here. :slight_smile: I haven't done much w/ the pdf viewer.

In the pdf viewer component, I'm not seeing a base64PDF property as referenced here.

{base64Binary: pdfViewer1.base64PDF}

Is it possible you meant to use a different object (query?) that holds the base64 encoded data instead of pdfviewer1?

For example,

I built a REST query to grab a pdf from a URL

The response contains a base64Binary field that I'm using to populate the pdf viewer.

The download button triggers the download js query which contains

I hope this helps and I'm not totally off base.

Hi, matth

...would that be "off base 64"? chuckles

Anyway.... you were right. I'm still learning so I was cobbling together stuff I'd seen elsewhere in the community and I think I must have got some stuff wrong.

Perhaps we might be able to learn together some more?

I am now trying to e-mail my PDF using the SMTP query resource. Any idea how I can attach the PDF as an attachment?

Thanks

Jeremy

Good to hear!

It looks like you are using the SMTP resource. I haven't used the SMTP resource before either. :grimacing:

I tried dropping base64 encoded documents in the "Attachments" field but that failed with

Use File Picker to upload a file and ensure file is uploaded before query is fired.

That led me to try to use the File Button or File Input components manually (browsing my local filesystem and choosing the file) just to see if I could send a successful email, but I couldn't get that to work either; btw it doesn't look like you can set the value on these components programmatically anyway.

I ended up creating a REST resource with my postmarkapp account and was sending successful emails w/ attachments in no time.

Thanks for your efforts.

I am successfully sending emails using the SMTP resource in another par tof my app.

I am finding the same about not being able to set progrmatically, getting the same error as you did.

I thought I'd been able to do this perviously but I may have been mistaken. Maybe someone from Retool will be able to shed some light on it.

I'm using TemplateAPI which I don't think has an email facility.

Thanks for spending time on this.

Hope your project goes well.

Jeremy

I reached out to retool support about the error when using attachments in the SMTP resource and was told it was a known bug and engineering is working on it.

We could prob achieve setting the attachments using temp state or something similar, but we need a working component to test.