Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF - workaround found
On Dec 11, 2005, at 00:50, Jay Bryant wrote: Have you tried adding width="..." to the fo:external-graphic? Works fine for me. Yup. Tried that. It didn't work with images wider than the content area (at least not with inches as the unit of measure). It DID make images smaller than the content area fill more of the content area (again with units of measure = inches). Hmm.. I wonder if this depends on the image format. It just occurred to me that your tests use GIF, while I was using JPG. Another detail to consider. My solution entails reading the width of the graphic (in pixels) through a Java extension to the XSL processor (Saxon). Then, if the image is less than 396 pixels wide, I just put it in (with src="someimage.gif"/>. Else, if the image is more than 396 pixels wide, I force its width to be 396 pixels (with src="someimage.gif" content-width="396px"/>). So, I'm trying to force the width only in the case where the graphic exceeds the available space. It was faster to write an extension function (took 15 minutes or so) than to try to scale all my screen captures. Aaah, OK, now I get you. Thanks for looking into things. You're welcome, of course. And thanks to you for the feedback! Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF - workaround found
Hi, Andreas, I'll respond below: - Original Message - From: "Andreas L Delmelle" <[EMAIL PROTECTED]> To: Sent: Saturday, December 10, 2005 1:37 PM Subject: Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF - workaround found > On Dec 10, 2005, at 00:34, [EMAIL PROTECTED] wrote: > > Hi Jay, > > > After reading the spec, I thought of trying to make the image a fixed > > width, so I tried > > > > > > > > That makes images less than 5.5 inches wide be 5.5 inches wide, > > Errm... Now you're losing me. I thought you were trying to avoid > smaller images being scaled up (?) A fixed value for content-width > per se implies scaling if the image is smaller/larger... At that point, I was just testing in general rather than continuing to chase what I needed. So I was trying to force both images that are smaller than the content area and images that are larger than the content area to fit the content area. Then I was trying to get both smaller and larger images to be a particular size (5.5in). What I found is that I can specify the width in pixels but not inches and that scale-to-fit does not work for images larger than the content area. Sorry about the confusion. > > > but the PDF file created by FOP still blows up when it encounters > > images larger > > than 5.5 inches wide. > > Have you tried adding width="..." to the fo:external-graphic? Works > fine for me. Yup. Tried that. It didn't work with images wider than the content area (at least not with inches as the unit of measure). It DID make images smaller than the content area fill more of the content area (again with units of measure = inches). > > I must say that it is weird that specifying the width seems to be > mandatory ATM. If width is absent (= implicit value of 'auto'), then > for an fo:external-graphic it should become the content-width of the > graphic, but currently it makes FOP crash in case the image is larger > than the specified content-width... > > Writing > > width="5.5in" /> > > should come down to the same as what you have above. > > Even stranger is that I also checked > > > > and that worked nicely. > > So currently there is a difference between an explicit or an implicit > auto-width... > > > Then I tried it with content-width="396px", and that worked. Yay! > > ... except when the content-width is specified in pixels. > > > I still think there's a bug in there somewhere, but at least there's a > > workaround. > > Yup, definitely a bug somewhere. As for a workaround, again, I was > under the impression that you needed images smaller than 5.5in to > remain as wide as they intrinsically are, but only need scaling down > for larger graphics... Have I misinterpreted something? My solution entails reading the width of the graphic (in pixels) through a Java extension to the XSL processor (Saxon). Then, if the image is less than 396 pixels wide, I just put it in (with . Else, if the image is more than 396 pixels wide, I force its width to be 396 pixels (with ). So, I'm trying to force the width only in the case where the graphic exceeds the available space. It was faster to write an extension function (took 15 minutes or so) than to try to scale all my screen captures. Thanks for looking into things. > > Cheers, > > Andreas Jay Bryant Bryant Communication Services - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF
I wasn't being very methodical with my earlier testing. Rather, I was pursuing whatever ideas my intuition brought to me. I think a test plan that works all combinations of the width, content-width, height, content-height, and scaling properties (in each unit of measure, too) is in order. I'll see what I can do along that line. Jay Bryant Bryant Communication Services - Original Message - From: "Andreas L Delmelle" <[EMAIL PROTECTED]> To: Sent: Saturday, December 10, 2005 3:09 PM Subject: Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF > On Dec 10, 2005, at 22:03, Andreas L Delmelle wrote: > > > > width="auto" content-width="auto" > > height="auto" content-height="scale-to-fit" > > scaling="non-uniform" /> > > Correction: this is OK > > - width/height = "auto" means use content-size > - content-height="scale-to-fit", so content-width is our last hope, > and that is "auto" > > so that means we should be using the intrinsic image-width, determine > width from there, so the e-g height becomes intrinsic image-height > (and the block height). > > > and > > > > > width="auto" content-width="auto" > > height="2.9cm" content-height="scale-to-fit" > > scaling="non-uniform" /> > > but here I'd expect the block height to be at most 2.9cm. That is > currently not the case. > > > > This seems to be giving strange results... Those interested, try it > > out. On my side, it seems like the intrinsic image height is used > > to determine the block height (?) Not the behavior I would expect... > > > > > > Greetz, > > > > Andreas > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Image in table not fitting full height?
On Dec 10, 2005, at 13:52, Dirk Bromberg wrote: Here is my fo sample. And a screenshot form the pdf. I want the image in the "xsl-region-before" to scale the full height of the cell (table) but there is 1mm border above and 2 mm border below the image remaining. Are there default marigns paddings or borders at cells block or tables? Please tell me how to make the "logo" fits image to the full table height. The most likely cause seems to be "scaling-method". If that property set to "auto" (= initial value) then the formatter may choose the method. I'm guessing all three tested formatters default to "integer- pixels", which could cause rounding in determining the number of device pixels... As a workaround, maybe you could try making the table-cell's background-color black, which would at least create the desired appearance. Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF
On Dec 10, 2005, at 22:03, Andreas L Delmelle wrote: Correction: this is OK - width/height = "auto" means use content-size - content-height="scale-to-fit", so content-width is our last hope, and that is "auto" so that means we should be using the intrinsic image-width, determine width from there, so the e-g height becomes intrinsic image-height (and the block height). and but here I'd expect the block height to be at most 2.9cm. That is currently not the case. This seems to be giving strange results... Those interested, try it out. On my side, it seems like the intrinsic image height is used to determine the block height (?) Not the behavior I would expect... Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF
On Dec 10, 2005, at 20:56, Andreas L Delmelle wrote: On the contrary, it is working almost perfectly, I take that back... While running a few tests trying to help Dirk Bromberg (see his thread of today), I tried and This seems to be giving strange results... Those interested, try it out. On my side, it seems like the intrinsic image height is used to determine the block height (?) Not the behavior I would expect... Greetz, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF
On Dec 10, 2005, at 00:14, [EMAIL PROTECTED] wrote: Hi Jay, See above: If you're not overriding the default resolution, this is caused by the fact that 528px is 7.33in in the default resolution. I don't think that's the issue. The algorithm in that template is "if the image is more than 396 pixels wide, scale the image". It doesn't try to scale the image to 396 pixels. So, the line in the FO file is What I meant was that you would only scale images that are larger than the assumed 5.5in, which is actually 7.33in in default resolution. So, the images between 5.5in and 7.33in won't be scaled down, but they won't fit either... This is tricky. See the remark about auto-width in my previous mail. How is the formatter supposed to determine the width here if the content-size isn't a fixed value? I suppose it then takes the intrinsic image-height as a basis, so again, the image may end up too large to fit in the area... It's my understanding that content-width="scale-to-fit" should shrink larger images and expand smaller images to fill the width of the content area. The content-area is that of the external-graphic itself, so... Yes, but only if the width specified on the external-graphic is fixed/ absolute or a percentage of the width of the containing block. If the width is 'auto', the formatter must use the content-size... At this point, I suspect that content-width="scale-to-fit" is not working correctly. On the contrary, it is working almost perfectly, apart from the minor bugger I mentioned in the previous mail... and now that I come to think of it, even that could turn out to not be erroneous. Think of it this way: is the same as width="scale-to-fit" height="auto" content-height="auto" /> which would mean... Right! Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 0.90alpha1: content-width="scale-to-fit" creates damaged PDF - workaround found
On Dec 10, 2005, at 00:34, [EMAIL PROTECTED] wrote: Hi Jay, After reading the spec, I thought of trying to make the image a fixed width, so I tried That makes images less than 5.5 inches wide be 5.5 inches wide, Errm... Now you're losing me. I thought you were trying to avoid smaller images being scaled up (?) A fixed value for content-width per se implies scaling if the image is smaller/larger... but the PDF file created by FOP still blows up when it encounters images larger than 5.5 inches wide. Have you tried adding width="..." to the fo:external-graphic? Works fine for me. I must say that it is weird that specifying the width seems to be mandatory ATM. If width is absent (= implicit value of 'auto'), then for an fo:external-graphic it should become the content-width of the graphic, but currently it makes FOP crash in case the image is larger than the specified content-width... Writing width="5.5in" /> should come down to the same as what you have above. Even stranger is that I also checked and that worked nicely. So currently there is a difference between an explicit or an implicit auto-width... Then I tried it with content-width="396px", and that worked. Yay! ... except when the content-width is specified in pixels. I still think there's a bug in there somewhere, but at least there's a workaround. Yup, definitely a bug somewhere. As for a workaround, again, I was under the impression that you needed images smaller than 5.5in to remain as wide as they intrinsically are, but only need scaling down for larger graphics... Have I misinterpreted something? Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Image in table not fitting full height?
Here is the result PDF. Thanks Dirk Dirk Bromberg wrote: Hi, i've a problem with an image into a table. Here is my fo sample. And a screenshot form the pdf. I want the image in the "xsl-region-before" to scale the full height of the cell (table) but there is 1mm border above and 2 mm border below the image remaining. Are there default marigns paddings or borders at cells block or tables? Please tell me how to make the "logo" fits image to the full table height. I tryed with fop 20.5 / 0.90 a1 and renderx alle the same result... Thanks Dirk http://www.w3.org/1999/XSL/Format";> Header 1 Header 2 Footer Content Page Content - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] out.pdf Description: Adobe PDF document - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Image in table not fitting full height?
Hi, i've a problem with an image into a table. Here is my fo sample. And a screenshot form the pdf. I want the image in the "xsl-region-before" to scale the full height of the cell (table) but there is 1mm border above and 2 mm border below the image remaining. Are there default marigns paddings or borders at cells block or tables? Please tell me how to make the "logo" fits image to the full table height. I tryed with fop 20.5 / 0.90 a1 and renderx alle the same result... Thanks Dirk http://www.w3.org/1999/XSL/Format";> Header 1 Header 2 Footer Content Page Content - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]