speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
293 stars 36 forks source link

`displaymode` conflicts with other `<PDFOptions>` #470

Closed pr-apes closed 1 year ago

pr-apes commented 1 year ago

@pgundlach,

the following source (invoked with sp --dummy) gives right output when displaymode is the last of the specified <PDFOptions>:

<Layout xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <PDFOptions displaymode="attachments"/>
  <PDFOptions duplex="duplexfliplongedge"/>
  <PDFOptions picktraybypdfsize="yes"/>
  <PDFOptions printscaling="appdefault"/>
  <PDFOptions showhyperlinks="yes"/>
  <PDFOptions hyperlinksbordercolor="green"/>

  <Record element="data">
     <Output>
       <Text>
         <Paragraph>
           <Value>text</Value>
         </Paragraph>
       </Text>
     </Output>
  </Record>

</Layout>

I wonder what may be causing the issue here.

Could you take a look at this?

Many thanks for your help.

pgundlach commented 1 year ago

Thank you very much for the bug report. Will be fixed in the next version. Until then, if you need it, use this:

diff --git a/src/lua/publisher/commands.lua b/src/lua/publisher/commands.lua
index a68e54a4..b0782f15 100644
--- a/src/lua/publisher/commands.lua
+++ b/src/lua/publisher/commands.lua
@@ -2568,8 +2568,6 @@ function commands.pdfoptions( layoutxml, dataxml )
         publisher.options.displaymode = "FullScreen"
     elseif displaymode == "thumbnails" then
         publisher.options.displaymode = "UseThumbs"
-    else
-        publisher.options.displaymode = "UseNone"
     end

     if showbookmarks then
-- 

(remove lines 2571 and 2572 in commands.lua)

pr-apes commented 1 year ago

Many thanks for your fast reply and for the patch, @pgundlach.

It works perfectly fine now.

pr-apes commented 1 year ago

Many thanks for the new release.