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.

PDFEncryptionOption.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.render.pdf;
  19. import org.apache.fop.pdf.PDFAMode;
  20. import org.apache.fop.pdf.PDFXMode;
  21. import org.apache.fop.render.RendererConfigOption;
  22. public enum PDFEncryptionOption implements RendererConfigOption {
  23. /**
  24. * PDF encryption length parameter: must be a multiple of 8 between 40 and 128,
  25. * default value 40, datatype: int, default: 40
  26. */
  27. ENCRYPTION_LENGTH("encryption-length", 40),
  28. /**
  29. * PDF encryption parameter: Forbids printing to high quality, datatype: Boolean or
  30. * "true"/"false", default: false
  31. */
  32. NO_PRINTHQ("noprinthq", 40),
  33. /**
  34. * PDF encryption parameter: Forbids assembling document, datatype: Boolean or
  35. * "true"/"false", default: false
  36. */
  37. NO_ASSEMBLEDOC("noassembledoc", false),
  38. /**
  39. * PDF encryption parameter: Forbids extracting text and graphics, datatype: Boolean
  40. * or "true"/"false", default: false
  41. */
  42. NO_ACCESSCONTENT("noaccesscontent", false),
  43. /**
  44. * PDF encryption parameter: Forbids filling in existing interactive forms, datatype:
  45. * Boolean or "true"/"false", default: false
  46. */
  47. NO_FILLINFORMS("nofillinforms", false),
  48. /**
  49. * PDF encryption parameter: Forbids annotations, datatype: Boolean or "true"/"false",
  50. * default: false
  51. */
  52. NO_ANNOTATIONS("noannotations", false),
  53. /**
  54. * PDF encryption parameter: Forbids printing, datatype: Boolean or "true"/"false",
  55. * default: false
  56. */
  57. NO_PRINT("noprint", false),
  58. /**
  59. * PDF encryption parameter: Forbids copying content, datatype: Boolean or "true"/"false",
  60. * default: false
  61. */
  62. NO_COPY_CONTENT("nocopy", false),
  63. /**
  64. * PDF encryption parameter: Forbids editing content, datatype: Boolean or "true"/"false",
  65. * default: false
  66. */
  67. NO_EDIT_CONTENT("noedit", false),
  68. /** PDF encryption parameter: user password, datatype: String, default: "" */
  69. USER_PASSWORD("user-password", ""),
  70. /** PDF encryption parameter: owner password, datatype: String, default: "" */
  71. OWNER_PASSWORD("owner-password", "");
  72. public static final String ENCRYPTION_PARAMS = "encryption-params";
  73. private final String name;
  74. private final Object defaultValue;
  75. private PDFEncryptionOption(String name, Object defaultValue) {
  76. this.name = name;
  77. this.defaultValue = defaultValue;
  78. }
  79. private PDFEncryptionOption(String name) {
  80. this(name, null);
  81. }
  82. public String getName() {
  83. return name;
  84. }
  85. public Object getDefaultValue() {
  86. return defaultValue;
  87. }
  88. }