BOT: Generating PDF fails due to System.Drawing.Common

Hi all,

Yesterday evening I saw this error for the first time and today it has occured 5 times.

Error encountered in step with name [Generate PDF]: Error: Task: 'Task for Generate PDF' Template Type: 'Body' could not be read due to System.Drawing.Common is not supported on this platform.

01.png

I haven't of System.Drawing.Common before so I've spent some time on google, and if I understand, correct, it is a .NET library commonly used for graphics and image processing. 

What can I do about that? I dont get it? 

In my template file, there are 2 small pictures

02.png

Are those the problem and causing System.Drawing.Common error?

The app is creating an average of 30-40 parking permits pr. day. 
Is it too much and causing the error?

There is no pattern when the error occurs. 
The app is very simple - It's possible to choose language, add numberplate and if you have pause.
When this info is saved, the bot starts creating the PDF with the template you see above.

It is not possible to add e.g. pictures in the form. It's basic text and same template used to generate pdfs each time.

If this System.Drawing.Common is something that it requires, why can the app/bot run for days but today on/off? 

Solved Solved
0 6 179
1 ACCEPTED SOLUTION


@Surdusvacca wrote:

Hmm it still happens now and then with the same error.


I don't have an explanation.   I can only suggest at this popint to open a Support ticket to AppSheet.

I'm sure this is probably unrelated...there was an email that came out today and there is an AppSheet post (link below) that file URL's will not be allowed any longer.  If you are using a Google DRive URL to your image, I wonder if that might be what's causing the problem?

https://www.googlecloudcommunity.com/gc/Announcements/Action-required-Drive-download-URLs-for-embedd...

 

 

View solution in original post

6 REPLIES 6


@Surdusvacca wrote:

Error encountered in step with name [Generate PDF]: Error: Task: 'Task for Generate PDF' Template Type: 'Body' could not be read due to System.Drawing.Common is not supported on this platform.


Did you use the drawing tools in the Google Doc to create ANY of the "header" details?  For example, you have lines above/below the "Temporary Parking Permit" text.

The issue is that the 3rd party software AppSheet uses to generate PDF's does not support converting those Doc drawing tool results into the PDF.  You can get around this by creating the entire "header" details as a single image in some external drawing/image tool, saving it as an image and then import that image into the template.

I would NOT recommend just saving a screen capture.  Your resulting image will look blurry and unprofessional.


@Surdusvacca wrote:

The app is creating an average of 30-40 parking permits pr. day. 
Is it too much and causing the error?

There is no pattern when the error occurs. 


Are you saying that the error does not always happen?  Sometimes the "parking permit" is generated exactly as shown without an error?  

That would be highly unusual.  if that is the case, could you possibly have more than one template where one results in the error while others do not?

 

 

Hi WillowMobileSys,

Thanks for a really great answer.

The document is created in Word.
I forgot that I have put everything into tables because when I did it without, the pdf created, looked very weird. But inside the tables it stays nice.

05.png

The lines you are referering to above and below the 'Temporary Parking Permit' is actually just the top and bottom lines of the table.

But your suggestion about doing the header as an image is a very good idea, I will do that right away.

Yep, I am saying that the error does not always happen and the 'Parking Permits' are generated excactly 200% as shown with the exact same template.
Yesterday was the first time it ever happend. And today the error has now occured 8 times, but the app/bot has created 25 PDFs with succes.

The last 4 days it has created 205 PDFs with succes.
For some reason the problem started last night, but not all the time. There can be an error, and then 7 succes, an error, 4 succes and so on.

But I will definitely try your image header solution and remove the tables. I added the tables in first place due to the 2 small images in the header. These images messed up the PDFs without tables. But now with your suggestion I dont see any problems removing the tables surrounding the text below.
I give it shot, thanks a lot!

 

So, I have updated the template to include one single image for the header and removed all tables. The template file is now one big image and pure text. I will keep an eye on the logs the next couple of days.

By the way, I have only seen this now, that two days ago one of the idiot drivers created this parking permit ๐Ÿ˜„ 

050ca185-aac6-4ebc-807a-a50954fd1177.jpg
Dont know if these smileys could relate to the System.Drawing.Common error? 
Yes, I cannot explain why the first error occured several PDF generations later, or why it's only sometimes it occurs. But anyhow, maybe I should think of a way to prevent them from doing these smileys just be safe.

Thanks again for your suggestion, I believe in this now ๐Ÿ™‚ 

Hmm it still happens now and then with the same error.

Screenshot 2024-02-05 095155.png

And I can for sure say the template now only contains the image header and text below. No lines, no tables.

This is the template file being used:
https://1drv.ms/w/s!AqhcgM2CzbLcqb9blSkaePOJfBiiaQ?e=5dOcfc 


@Surdusvacca wrote:

Hmm it still happens now and then with the same error.


I don't have an explanation.   I can only suggest at this popint to open a Support ticket to AppSheet.

I'm sure this is probably unrelated...there was an email that came out today and there is an AppSheet post (link below) that file URL's will not be allowed any longer.  If you are using a Google DRive URL to your image, I wonder if that might be what's causing the problem?

https://www.googlecloudcommunity.com/gc/Announcements/Action-required-Drive-download-URLs-for-embedd...

 

 

Thanks, I will try to open my first ticket ๐Ÿ˜€

Great link but no, I am not affected by that. ๐Ÿ‘

Top Labels in this Space