Browse Source

Applied Thomas DeWeese's latest patch for the PDF transcoder.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197244 13f79535-47bb-0310-9956-ffa450edef68
pull/30/head
Glen Mazza 20 years ago
parent
commit
6dfbb9e9a3

+ 4
- 1
build.xml View File

<!--include name="org/apache/fop/layout/Font*.class"/--> <!--include name="org/apache/fop/layout/Font*.class"/-->
<include name="org/apache/fop/image/FopImag*.class"/> <include name="org/apache/fop/image/FopImag*.class"/>
<include name="org/apache/fop/image/Jpeg*"/> <include name="org/apache/fop/image/Jpeg*"/>
<include name="org/apache/fop/image/EPS*"/>
<include name="org/apache/fop/image/Abstract*"/> <include name="org/apache/fop/image/Abstract*"/>
<include name="org/apache/fop/image/analyser/*.class"/>
<include name="org/apache/fop/util/CMYKColorSpace*.class"/>
<include name="org/apache/fop/util/StreamUtilities.class"/> <include name="org/apache/fop/util/StreamUtilities.class"/>
<include name="org/apache/fop/util/*OutputStream.class"/> <include name="org/apache/fop/util/*OutputStream.class"/>
<include name="org/apache/fop/util/Finalizable.class"/> <include name="org/apache/fop/util/Finalizable.class"/>
<fileset dir="${build.dest}"> <fileset dir="${build.dest}">
<patternset refid="transcoder-classes"/> <patternset refid="transcoder-classes"/>
</fileset> </fileset>
<fileset dir="${build.dir}/transcoder-dependencies"/>
<fileset dir="${transcoder-deps}"/>
<manifest> <manifest>
<attribute name="Implementation-Title" value="${fop-transcoder.name}"/> <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
<attribute name="Implementation-Version" value="${fop-transcoder.version}"/> <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>

+ 13
- 3
src/java/org/apache/fop/svg/PDFGraphics2D.java View File

*/ */
protected int baseLevel = 0; protected int baseLevel = 0;


/**
* The count of JPEG images added to document so they recieve
* unique keys.
*/
protected int jpegCount = 0;

/** /**
* The current font information. * The current font information.
*/ */
* @param width the width to draw the image * @param width the width to draw the image
* @param height the height to draw the image * @param height the height to draw the image
*/ */
public void addJpegImage(JpegImage jpeg, float x, float y, float width, float height) {
FopPDFImage fopimage = new FopPDFImage(jpeg, "");
int xObjectNum = this.pdfDoc.addImage(resourceContext, fopimage).getXNumber();
public void addJpegImage(JpegImage jpeg, float x, float y,
float width, float height) {
String key = "__AddJPEG_"+jpegCount;
jpegCount++;
FopPDFImage fopimage = new FopPDFImage(jpeg, key);
int xObjectNum = this.pdfDoc.addImage(resourceContext,
fopimage).getXNumber();


AffineTransform at = getTransform(); AffineTransform at = getTransform();
double[] matrix = new double[6]; double[] matrix = new double[6];

+ 1
- 1
src/java/org/apache/fop/svg/PDFImageElementBridge.java View File

(purl.toString(), purl.openStream(), null); (purl.toString(), purl.openStream(), null);
if (ii.mimeType.toLowerCase() == "image/jpeg") { if (ii.mimeType.toLowerCase() == "image/jpeg") {
JpegImage jpeg = new JpegImage(ii); JpegImage jpeg = new JpegImage(ii);
jpeg.load(FopImage.ORIGINAL_DATA, null);
PDFJpegNode node = new PDFJpegNode(jpeg, origGN); PDFJpegNode node = new PDFJpegNode(jpeg, origGN);


Rectangle2D imgBounds = getImageBounds(ctx, e); Rectangle2D imgBounds = getImageBounds(ctx, e);
public void primitivePaint(Graphics2D g2d) { public void primitivePaint(Graphics2D g2d) {
if (g2d instanceof PDFGraphics2D) { if (g2d instanceof PDFGraphics2D) {
PDFGraphics2D pdfg = (PDFGraphics2D) g2d; PDFGraphics2D pdfg = (PDFGraphics2D) g2d;
pdfg.setTransform(getTransform());
float x = 0; float x = 0;
float y = 0; float y = 0;
try { try {

Loading…
Cancel
Save