Hello
I’m trying to display a PDF document in an embedded form, similarly to Camunda Platform 7 documentation | docs.camunda.org
I first upload both an image and a PDF document into process variables of type=file. I then display both on the subsequent User task.
However it’s not rendering the PDF. The same PDF document displays correctly when I reference it directly from the server’s file system as can be seen in point 3.
I’ve read camunda-7-code-examples/snippets/ecm-integrations/invoice-cmis/src/main/webapp/forms/approve-invoice.html at main · camunda-consulting/camunda-7-code-examples · GitHub and the forum topic https://forum.camunda.io/t/upload-multiple-files-in-embedded-form
Here is the form:
<form role="form"> <ol> <li>PNG file as a process variable of type=file : Success</li> <input type="hidden" cam-variable-name="vFilePng"/> <img src="{{camForm.variableManager.variable('vFilePng').contentUrl}}"></img> <br> <li>PDF file as a process variable of type=file : Error</li> <input type="hidden" cam-variable-name="vFilePdf"/> <object data="{{camForm.variableManager.variable('vFilePdf').contentUrl}}" type="application/pdf"></object> <br> <li>The same PDF file on the server's file system : Success</li> <object data="Test-FileIO-02-File-01.pdf" type="application/pdf"></object> </ol> </form>
Why can I not get this to work? Is it the encoding?
Many thanks for any guidance.
PS:
I’m currently using a workaround of first writing the process variable of type=file out to a temporary directory on the server’s FS and then referring to this temp file in the form
vFilePdfFN = camForm.variableManager.variable(‘vFilePdf’).valueInfo.filename;
$scope.vFilePdfPath = “temp/” + vProcessId + “/” + vFilePdfFN;
<embed src=“{{vFilePdfPath}}” type=“application/pdf”>
Has anyone else come across this limitation? How did you solve it?
Many thanks in advance.