Cusomize PDF Download from the API

Is there a way to change the font size on the downloaded pdf from the API

Which API are you pertaining to?

I am using Export Form Submission PDF

Hi @sposton,

At the moment, the styling for the submission PDF is only applied when exporting via the Results tab. However, this is already on our roadmap, and starting next week, the styled PDF will also be applied to submission exports done through API call.

Thanks, I decided to go a different route. I’m now using the List Document Envelopes API and the List Form Submissions API to match the UserId and retrieve the PDF URLs.

The issue I ran into is that when I try to download the files directly from the URLs, I get a permission error indicating that access to the AWS URL isn’t allowed. As a workaround, I’ve had to write code that opens each URL in a browser and automates the download process dynamically.

Hi @sposton ,

Great work on finding a workaround! We would also want to inform you that you can now download pdf submission via api with the same style as you set on the form settings.

Let me know if you encounter any future issues.

Thank you. Just to clarify—are you saying I can now download the filled-out PDF template directly with the extra browser step, or do I still need to continue using my current process?

Wen the export form submission pdf api is used, it will now generate the pdf url with styling. Are you having issues using this?

no gives me the following error:

Correlation Id: 93173774-4946-4874-aee0-eaacb3f46821

Failed to download from web: The filename, directory name, or volume label syntax is incorrect.
. —> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
ow.RPA.Desktop.Modules.Web.Actions.WebActions.CopyEntireResponseTextToL

Hi @sposton

Have you checked this part?

Failed to download from web: The filename, directory name, or volume label syntax is incorrect.
. —> System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

Yes, it appears when I open up a browser using Edge or Chrome, I can download and save the pdf with no problem.

Yet, when I try to download the pdf and save the file directly without using a browser, I am getting the error message. I look up the whole error and it reference I don’t have permission to download the file directly. I guess AWS is forcing me to use the browser with https://?

Hi @sposton ,

Based on the error log, It looks like the directory you are trying to use is not valid that causes it to not be saved. It doesn’t explicitly say anything about security/permission.

Can you try these troubleshooting steps

  • Print out the exact string you’re passing in for the local filename.
  • Verify it has the form X:\folder\subfolder\file.ext (no extra slashes, no “http(s):” in it, no illegal chars).
  • Validate against Path.GetInvalidPathChars() and Path.GetInvalidFileNameChars().
  • Ensure all directories in the path exist (or create them ahead of time).

I will try today and save it to my local drive.

Good morning, Kenny,

I tried saving the document locally to my computer but encountered the same error. It seems there may be some restrictions preventing direct downloads from AWS.

Is there someone I can contact directly to confirm whether this is possible?

In the meantime, I’ve created an automated process using the API that opens the browser and navigates to each PDF URL for download. The concern, however, is that if there are 100 records, the browser will open 100 separate windows, which isn’t ideal.

Let me know if there’s a better approach or someone I can coordinate with on this.

Hi @sposton ,

Can you share the error log that says anything about permissions or restrictions?

I don’t have access to the log files the error message mention in the error message, says I don’t have direct access to download the files.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode**, FileAccess access,** Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
ow.RPA.Desktop.Modules.Web.Actions.WebActions.CopyEntireResponseTextToL

Hi @sposton ,

Will it be possible for you to send to me over the email the full error message?

Good morning,

This is not related to an email error. I am utilizing your API within a Power Automate Desktop .NET application to programmatically download PDF files based on submission records. The requirement is to retrieve the exact PDF document generated internally by your platform, identical to the version we currently receive via mail, fax, or in-person submissions.

The intent is to enable a direct download process without manually accessing and opening each submission through the web interface.

Kenny, Thank you for all your help, I have it resolved.

Hi @sposton , Great work on having it resolved by yourself. Will it be possible for you to share some insights on how it was done? This can be a big help for those who experience the same trouble you had.