Saving component to mounted folder

My program has the user enter in text which generates a barcode with the Barcode component. It's then supposed to print the barcode to a label printer on a button press but as far as I know, it's not possible to print a Perspective component view to a printer. As an alternative, I was wondering if I could save the barcode to a mounted folder instead, but I'm not sure if it's possible and/or how to do it. Any help would be appreciated! :slight_smile:

If you've got the reporting module, you could generate a basic report on-demand that contains just a generated barcode with the data you pass in.

Note that "printing" from Perspective scripting is always going to take place from the gateway. We don't currently have a way to initiate a user-interactive printing flow on the user agent (browser, mobile device, etc).

1 Like

Generating a report works for me. If I wanted to save a backup of the barcode to a mounted folder, how would I write to the folder (if it's possible)? I've had cases where I needed to read from a folder and encountered no issues, but I haven't tried to write to one yet and I'm unsure how I would go about doing that.

In theory, if the gateway service has access, you could write to the file either through system.report.executeAndDistribute, or retrieve the bytes with system.report.executeReport and then system.file.writeFile.

1 Like