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.

AFPCustomizable.java 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.afp;
  19. import org.apache.fop.afp.AFPResourceLevelDefaults;
  20. /**
  21. * Interface used to customize the AFP renderer or document handler.
  22. */
  23. public interface AFPCustomizable {
  24. /**
  25. * Sets the number of bits used per pixel
  26. *
  27. * @param bitsPerPixel
  28. * number of bits per pixel
  29. */
  30. void setBitsPerPixel(int bitsPerPixel);
  31. /**
  32. * Sets whether images are color or not
  33. *
  34. * @param colorImages
  35. * color image output
  36. */
  37. void setColorImages(boolean colorImages);
  38. /**
  39. * Sets whether images are supported natively or not
  40. *
  41. * @param nativeImages
  42. * native image support
  43. */
  44. void setNativeImagesSupported(boolean nativeImages);
  45. /**
  46. * Controls whether CMYK images (IOCA FS45) are enabled. By default, support is disabled
  47. * for wider compatibility. When disabled, any CMYK image is converted to the selected
  48. * color format.
  49. * @param value true to enabled CMYK images
  50. */
  51. void setCMYKImagesSupported(boolean value);
  52. /**
  53. * Sets the shading mode for painting filled rectangles.
  54. * @param shadingMode the shading mode
  55. */
  56. void setShadingMode(AFPShadingMode shadingMode);
  57. /**
  58. * Sets the dithering quality setting to use when converting images to monochrome images.
  59. * @param quality Defines the desired quality level for the conversion.
  60. * Valid values: a value between 0.0f (fastest) and 1.0f (best)
  61. */
  62. void setDitheringQuality(float quality);
  63. /**
  64. * Sets the image encoding quality setting to use when encoding bitmap images.
  65. * The default setting is 1.0 which means loss-less encoding. Settings of less than 1.0
  66. * allow loss-less encoding schemes like JPEG. The value serves as quality setting for
  67. * the encoders in that case.
  68. * @param quality Defines the desired quality level.
  69. * Valid values: a value between 0.0f (lowest) and 1.0f (best, loss-less)
  70. */
  71. void setBitmapEncodingQuality(float quality);
  72. /**
  73. * Sets the output/device resolution
  74. *
  75. * @param resolution
  76. * the output resolution (dpi)
  77. */
  78. void setResolution(int resolution);
  79. /**
  80. * Sets the line width correction
  81. *
  82. * @param correction the line width multiplying factor correction
  83. */
  84. void setLineWidthCorrection(float correction);
  85. /**
  86. * Sets whether FS11 and FS45 non-inline images should be wrapped in a page segment
  87. * @param pSeg true iff images should be wrapped
  88. */
  89. void setWrapPSeg(boolean pSeg);
  90. /**
  91. * set true if images should be FS45
  92. * @param fs45 true iff images should be FS45
  93. */
  94. void setFS45(boolean fs45);
  95. /**
  96. * gets whether FS11 and FS45 non-inline images should be wrapped in a page segment
  97. * @return true iff images should be wrapped
  98. */
  99. boolean getWrapPSeg();
  100. /**
  101. * gets whether images should be FS45
  102. * @return true iff images should be FS45
  103. */
  104. boolean getFS45();
  105. /**
  106. * Returns the output/device resolution.
  107. *
  108. * @return the resolution in dpi
  109. */
  110. int getResolution();
  111. /**
  112. * Controls whether GOCA is enabled or disabled.
  113. * @param enabled true if GOCA is enabled, false if it is disabled
  114. */
  115. void setGOCAEnabled(boolean enabled);
  116. /**
  117. * Indicates whether GOCA is enabled or disabled.
  118. * @return true if GOCA is enabled, false if GOCA is disabled
  119. */
  120. boolean isGOCAEnabled();
  121. /**
  122. * Controls whether to stroke text in GOCA mode or to use text operators where possible.
  123. * @param stroke true to stroke, false to paint with text operators where possible
  124. */
  125. void setStrokeGOCAText(boolean stroke);
  126. /**
  127. * Indicates whether to stroke text in GOCA mode or to use text operators where possible.
  128. * @return true to stroke, false to paint with text operators where possible
  129. */
  130. boolean isStrokeGOCAText();
  131. /**
  132. * Sets the default resource group file path
  133. * @param filePath the default resource group file path
  134. */
  135. void setDefaultResourceGroupFilePath(String filePath);
  136. /**
  137. * Sets the resource level defaults. The object passed in provides information which resource
  138. * level shall be used by default for various kinds of resources.
  139. * @param defaults the resource level defaults
  140. */
  141. void setResourceLevelDefaults(AFPResourceLevelDefaults defaults);
  142. /**
  143. * Sets whether or not to JPEG images can be embedded in the AFP document.
  144. *
  145. * @param canEmbed whether or not to embed JPEG image
  146. */
  147. void canEmbedJpeg(boolean canEmbed);
  148. }