You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pdf-dictionary-extension_2.xml 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks the PDF dictionary extensions related to optional content groups (layers).
  21. </p>
  22. </info>
  23. <fo>
  24. <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"
  25. xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
  26. <fo:layout-master-set>
  27. <fo:simple-page-master master-name="simple">
  28. <fo:region-body/>
  29. <fo:region-before/>
  30. <fo:region-after/>
  31. </fo:simple-page-master>
  32. </fo:layout-master-set>
  33. <fo:declarations>
  34. <!-- Optional Content Group Layers -->
  35. <pdf:layer id="layer1">
  36. <pdf:string key="Name">Bullet 1</pdf:string>
  37. </pdf:layer>
  38. <pdf:layer id="layer2">
  39. <pdf:string key="Name">Bullet 2</pdf:string>
  40. </pdf:layer>
  41. <!-- Document Catalog's Optional Content (Layers) Directory and Default State -->
  42. <pdf:catalog>
  43. <pdf:dictionary key="OCProperties">
  44. <!-- Directory of OCGs (layers) in Document -->
  45. <pdf:array key="OCGs">
  46. <pdf:reference refid="layer1"/>
  47. <pdf:reference refid="layer2"/>
  48. </pdf:array>
  49. <!-- Default State for OCGs -->
  50. <pdf:dictionary key="D">
  51. <pdf:string key="Name">Default</pdf:string>
  52. <pdf:name key="BaseState">OFF</pdf:name>
  53. </pdf:dictionary>
  54. </pdf:dictionary>
  55. </pdf:catalog>
  56. </fo:declarations>
  57. <fo:page-sequence master-reference="simple">
  58. <fo:flow flow-name="xsl-region-body">
  59. <fo:block fox:layer="layer1">
  60. <fo:block>BULLET 1A</fo:block>
  61. <fo:block>BULLET 1B</fo:block>
  62. </fo:block>
  63. <fo:block fox:layer="layer2">BULLET 2</fo:block>
  64. </fo:flow>
  65. </fo:page-sequence>
  66. </fo:root>
  67. </fo>
  68. <checks xmlns:pdf="apache:fop:extensions:pdf">
  69. <eval expected="layer1" xpath="//flow/block[1]/@layer"/>
  70. <eval expected="layer2" xpath="//flow/block[2]/@layer"/>
  71. </checks>
  72. </testcase>