I have no problems with producing pdfs and offering them as response:stream-binary
files for download. However, I have problems if I try to zip produced pdfs and do the same with zip. It offers the zip result for download. The pdf is included but has no size (empty file).
let $pdf-binary :=
(
if ($pdfQuality eq 'proof' and $template eq 'draft')
then xslfo:render(transform:transform($doc, $stylesProof, ()), 'application/pdf', (), $proofConf)
else if ($pdfQuality eq 'print' and $template eq 'draft')
then xslfo:render(transform:transform($doc, $stylesPrint, ()), 'application/pdf', (), $printConf)
else if ($pdfQuality eq 'print' and $template eq 'auc-geographica')
then xslfo:render(transform:transform($doc, $stylesAUCGeographica, ()), 'application/pdf', (), $printConf)
else ()
)
return
if (not($zipAll))
then response:stream-binary($pdf-binary, 'application/pdf', $name || '.pdf')
else if ($zipAll)
then (
let $entry := <entry name="{$name}.pdf" type="binary" method="store">{util:binary-doc($pdf-binary)}</entry>
let $zip-file := compression:zip($entry, false())
return
response:stream-binary($zip-file, 'application/zip', 'test.zip')
)
else ()
Important is I don’t want to store pdf results anywhere in the DB.