Feature: Custom PDF size attachments (workflows)

Do you use PDFs in your workflows? We’ve made a recent adjustment that allow you to customize what you send to help your business run more efficiently.

What is a workflow and why does it affect sending my PDF?
Workflows are a slightly more advanced feature that allow you to define automated behaviors that are performed on the AppSheet cloud backend. As an app creator, you can use multiple workflows in your application.

Each Workflow or Report has three components:

  1. When it should run (the “event” that triggers the action)
  2. Whether it should be performed (the “condition” that determines what happens)
  3. What it should do (the “action” that takes place because the trigger took place and it met the conditions you’ve set)

The PDF’s you send are part of the “action” that takes place in your app’s behavior settings. For the purpose of this post, we’ll be focusing on the action of sending a custom PDF from your workflow. You can learn more about workflows by reviewing some of the below documentation.

Where does the PDF sizing of live?

  1. To find the PDF size option, open your app editor by selecting the app you’d like to work on.
  2. The navigation bar on the left side displays a tab titled “Behavior”. Click this tab.
  3. Once you’re in the Behavior tab you’ll find a navigation bar along the top of your editor. The second tab is your “Workflow” section.
  4. Once you’ve found the “Workflow” section, open up the action that sends PDFs.
  5. Scroll down to the “Do This” section of the workflow and expand the view.
  6. In the “Email Content” section, scroll until you find “Attachment Page Size”
  7. From here you can modify the PDF size. Please see image below.

attachment

Important notes

  • If you’d like to take advantage of this feature and incorporate workflows into now of your current applications, you can learn more about workflows here.
  • This new addition allows you to automate everything from barcode labels to posters. To learn more about sending an email from a workflow rule, please review this help article. customize your automation. To get started with custom PDF attachments
  • Workflows can be a bit tricky to troubleshoot so we’ve created this helpful guide should you encounter any issue when working with PDFs in workflows.

Try adding this feature to your app now and let us know how video embedding works for you.

Happy app building!

2 Likes

@MultiTech_Visions @Steve
I have been playing with this to generate my 2D barcodes with captions, but the sizing feature isn’t effecting my pdf and my font size is too big. Any insight?

Document Template

image

2DBarcode20210803_120244_669.pdf (21.3 KB)

Hi @rmsmeltz If you open your PDF with Adobe Acrobat Reader, you will see that the Width is 28 mm and the Height is 88 mm. But you want it the other way.
So please switch this in the AppSheet Editor.
If this will be the solution than you should inform AppSheet about this bug.


Also I think that your Google Doc should have the same dimensions. But as this is not possible directly in Google Docs, you can do this workaround:

  • Create a Word Doc with 28 x 88 mm
  • In Google Drive settings enable “Convert uploads”
  • Upload the Word file to Google Drive

Now you have a Google Doc with the desired dimensions.


You have 2 curly brackets in your template. I think it should be square brackets?
<<[Item] {FNSKU] {Box Quantity] [Shipment ID]>>

3 Likes

So far so good, but the margins aren’t lining up.

Example

Template

Do you see the new feature “Custom Margins”? If not it may not rolled out already to your account.
Please see this post and the following:

3 Likes

So the feature only applies to emails, not the PDF creation for “Create New File”. Is there a way to also save the attachment through the bot?

That’s unfortunate, I imagine they’ll expand this to cover all aspects eventually.

2 Likes

adding @Greg_Denton for more insights :slight_smile:

2 Likes

Yes, as @Marc_Dillon pointed out they can save it as a file with the email task too, but, quickly thinking about it, I don’t see any immediate reason why we can’t expose the custom margins for the create file task.
I’ll look into that, and hopefully you’ll see something in the release notes for it soon!

5 Likes

Greg FTW

1 Like

Happy to help!

2 Likes

When we have long strings without “return” at the end (carriage return), AppSheet used to push the width of final output (PDF for instance) to match with the width of those strings.

I m not yet testing new feature, but this problem would be solved with this new features?

Sorry, I m not doiong any hands-on testing on my own, but just wonder if this new feature would remove our headache.

Yes, if there are long strings with no places for a natural word break, then that can cause text (particularly in a table cell) to grow wider than expected.
Custom margins set in the editor can help force things not to grow past a certain point and force it to be the set distance from the edge of the page.

2 Likes

Thanks for your explanation, @Greg_Denton

yes, when we have long text, typically URL strings, the appsheet starts to push the width of the table, which collapse the whole files containing a table just because of pushing the width of the table template. Good to know this will not be a case.
But the reverse story was the same and true as well. As far as I experienced, when the text strings are short enough, template / table was automatically shrinked, leaving far too many blank width on the right handside of the ouput. Is this reverser probem will be adjusted as well?

1 Like

I don’t think I’ve personally seen that issue of it shrinking past the designed width. Is it possible that some other part of the template, maybe even on another page is growing past it’s designed width, causing other things to appear as though they’re shrinking like you’ve said?
In general I wouldn’t expect something to shrink unless another part of the table “needed” that width.

Also I’d suggest verifying that the page size set in your template matches the page size set in the editor. I’ve noticed too much space to the right when my template page size was smaller than the page size set in the editor.

1 Like

Our setting for template (google docs) was set to a certain amont of inches for left/right margins, but not being respected, based on the lenght of the texts inside the table cells.
When the strings are long enough without the carriage return, then final table out of output is to push the width as much as the same length of the strings, but this issue should be addressed by this new feature (i m not yet tested).

But when we have short strings for table cell contexts, the appsheet has left the right margins too much wide (not following the page settings for google docs).

We did have bunch of the case to adjust the width of table for the template because of this un-controllable issues, where our clients have been claiming why this does happen.

To tempolarilly solve this issue, we put the dummy strings to the template and apply the format rule to white them out. (strings are there, but not visible) to fix the width of the table. Even we have short strings, the table for the final output (PDF) maintain the width as we expected, because of those hidden strings (strings are there, but format rule for coloring is applied to be perfectly white).

1 Like

Hi @tsuji_koichi this sounds interesting. Can you post a screenshot what you are doing?

1 Like

New PDF gererating engine or new option for custom margin (not sure which one is working and helping) but either of them are correcting issue, so we dont need such a trick for now.

3 Likes