speedata / publisher

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

AtPageShipout text with transparent color is transparent only on the 1st page #360

Closed grigorem closed 2 years ago

grigorem commented 2 years ago

Versions tested: 4.6.0, 4.7.8

First off, I want to congratulate you on creating a so nice abstraction over LaTeX. It works better than I expected and I want to encourage you to continue the great work. With this issue, I want to give my contribution to this nice solution.

Problem: I want to add a "DRAFT" watermark to all pages on top of everything else (that's why I'm using AtPageShipout), but only on the first page the watermark is transparent. From page 2 onward the watermark is completely opaque.

Here is a minimal layout.xml example to recreate this:

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

    <DefineColor name="watermark" model="RGB" r="0" g="0" b="0" alpha="20"/>
    <DefineFontalias existing="CrimsonPro-Regular" alias="regular"/>
    <DefineFontfamily name="watermark" fontsize="150" leading="200">
        <Regular fontface="regular"/>
    </DefineFontfamily>

    <Pagetype name="default" test="true()">
        <AtPageShipout>
            <PlaceObject allocate="no" row="{sd:number-of-rows() * 0.7}" column="{sd:number-of-columns() * 0.15}" rotate="305">
                <Textblock fontfamily="watermark" color="watermark">
                  <Paragraph>
                    <Value>DRAFT</Value>
                  </Paragraph>
                </Textblock>
              </PlaceObject>
        </AtPageShipout>
    </Pagetype>

    <Record element="data">
        <PlaceObject>
            <Table stretch="max" padding="5pt">
              <Columns>
                <Column width="1*" align="center" valign="middle"/>
              </Columns>
              <Tablehead>
                <Tr>
                  <Td valign="bottom">
                    <Paragraph>
                      <Value>Table column</Value>
                    </Paragraph>
                  </Td>
                </Tr>
              </Tablehead>
              <Loop select="50">
                <Tr>
                  <Td>
                    <Paragraph>
                      <Value>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</Value>
                    </Paragraph>
                  </Td>
                </Tr>
              </Loop>
            </Table>
          </PlaceObject>
    </Record>
</Layout>

image

pgundlach commented 2 years ago

Thank you very much for the bug report. I can reproduce the problem and try to fix this as soon as possible

grigorem commented 2 years ago

Thank you for your fast response! No rush on my side. As a workaround, I put the watermark as Grey text in AtPageCreation and put everything else on top of it.

pgundlach commented 2 years ago

Version 4.7.9 is available for download now, which fixes this problem. Thanks again for the bug report!

grigorem commented 2 years ago

Downloaded, tested and everything works fine now. Thank you!