0
我在生成pdf並將它們作爲response:stream-binary
文件下載時沒有問題。但是,如果我嘗試壓縮製作的pdf並使用zip執行相同的操作,則會出現問題。它提供了下載的壓縮結果。包含pdf,但沒有大小(空文件)。如何在eXist-db和xQuery中運行函數時壓縮二進制文件
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()
重要的是我不想在數據庫中的任何地方存儲pdf結果。