I'm trying to convert JSON to a pdf file but when I am trying to open the file getting the "Failed to load PDF document" error in mule 4 (runtime 4.2.1). How can I fix this issue?
code:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="79ef9cde-39c4-449a-8cac-9aeb3be30c27" >
<http:listener-connection host="0.0.0.0" port="8084" />
</http:listener-config>
<file:config name="File_Config" doc:name="File Config" doc:id="d67cbdb7-3bc8-4f04-8d7f-862c539f5f3f" >
<file:connection workingDir="D:\Devendra\workspace_dev\mule4\pdf\src\main\resources\pdf" />
</file:config>
<flow name="pdfFlow" doc:id="eaef4b93-c6f1-4e01-9df3-93e2ba2dcba4" >
<http:listener doc:name="Listener" doc:id="1407afe8-dbea-4f67-8514-29b8039c5638" config-ref="HTTP_Listener_config" path="/pdf"/>
<set-payload value="#[payload]" doc:name="Set Payload" doc:id="a250f9a4-c633-4ce1-a75d-8668d2dede10" mimeType="application/json"/>
<file:write doc:name="Write" doc:id="ca2c47a2-924d-445a-8ca1-7de6197cd583" path="test.pdf" config-ref="File_Config"/>
<logger level="INFO" doc:name="Logger" doc:id="0c629051-500e-4bc0-82b4-74b6c79ec567" message="#[payload]"/>
</flow>
</mule>