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

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