Re: Problems with FOP and image
Hi Rob Oscar, I'm not sure that the initial topic of this thread is still on discussion (see Subject). Please, if it is the case, don't hack an existing one, but open a new thread with the right Subject, to avoid confusion for other users. Le 22/06/2011 18:49, Rob Sargent a écrit : It's a little tough for me to follow your xsl, but I'm suspicious of your loop template: It looks to me as though you are writing empty lines. I don't think you can rely on the empty lines to be the right size. Maybe some non-breaking white space would help? Have you found the log file? If there's a problem, there's a report. Turn up your logging if necessary. You might want to use the .bat file to generate the fo file. This shows exactly what your xsl transformation generated and is the best bet at understanding any problem the fop engine is having. The smart people on this list are more likely to look at your fo than your xsl. On 06/21/2011 01:23 PM, Oscar.Flores wrote: Hi there yeah its the pdf that give me the fop.bat i dont know why it works this way and not from my java program anyway i am using fixed position i show you my xlst to see if you can help me to correct the size http://old.nabble.com/file/p31897144/FacturasOMF.xsl FacturasOMF.xsl Rob Sargent-4 wrote: Is the pdf you posted made via the .bat file then? And it has all the images you need? Which image is giving you all the trouble? I see that you are incorrectly sizing the area into which you are putting the address of the client. Alternatively you have placed the table of items too high. Are you using fixed positions? Those to pieces (client-address and invoice-items) should be in consecutive blocks. On 06/17/2011 09:52 AM, Oscar.Flores wrote: No i still can print the images in pdf in console what i do for now is call a bat to make the transformation with fo until i figure out what the problem is in log appear that can find a proper converter for the images also another problem its that the table its to big it dont fit to the data here its the pdf that result http://old.nabble.com/file/p31870136/Prueba3.pdf Prueba3.pdf Warning(1979/26): fo:table, table-layout=auto is currently not supported by FOP but in my xslt it ike thisfo:table table-layout=fixed width=100% the version of fop i use its 1.0 Rob Sargent-4 wrote: I don't think you want to read and write to the same place. If the file is where you want it to be and it's otherwise in perfect shape you should be fine. But if you do want to read it in and write it to some deployed area the that's what you want to do. Almost: ImageIO.write(*newImage*, JPEG, jpegImageFile); So without adding the ImageIO.write() call, are you getting the pdf you want yet? If not, what actual errors are you seeing in the logs. The warning about fo:table is not causing you any trouble. What version of fop are you running (sorry I've forgotten) On 06/15/2011 02:51 PM, Oscar.Flores wrote: Hi thanks for the help yeah i haven see that its was .java and not .class, ok then if i follow correctly what you are saying then it has to be something like this BufferedImage newImage = new BufferedImage (C:\Logo.jpg) ImageIO.write(BufferedImage, JPEG, jpegImageFile) jpegImageFile will be the XML call rigth something like C:\Logo.jpg) and another thing Warning(1979/26): fo:table, table-layout=auto is currently not supported by FOP but in my xslt it ike thisfo:table table-layout=fixed width=100% so i dont now what its causing the ploblem Rob Sargent-4 wrote: On 06/14/2011 11:06 AM, Oscar.Flores wrote: Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment is just Having the file in the ...sources.jar won't do the runtime world much good. You need the jar of .class files for jai-imageio, not .java files windows xp, and the bufferedImage will be the path of the image?? No, the bufferedImage is an in-memory instance of BufferedImage holding the bits of the image. In the case that you have to read it from one place and write it to another. Rob Sargent-4 wrote: Did you go through all your jars looking for 'CLibJPEGImageReaderSpi'. My greatest suspicion is that you don't have all your jars lined up. Which jar(s) do you think supplies these? What is your environment: just windows or do you have any tools like cygwin? The jpegImageFile would be the filename in your xsl the external-resource. If you're just using a file that is already in place you don't have to re-write it. On 06/14/2011 08:29 AM, Oscar.Flores wrote: No i dont, and that weird jejeje netbeans seems to do that for me, so the calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i have to do it in every image that i put in the pdf?? and the image is gererate directly in the pdf??how can i do it?? Rob Sargent-4 wrote: Some jar to which netbeans has access has those classes. Look in the output of jar tvfeach of
Central European characters in PDF with Base14 fonts
Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Central European characters in PDF with Base14 fonts
Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Central European characters in PDF with Base14 fonts
Hi Mehdi, Have you looked at pdf_pl.pdf attached to my first post? This is proof that it's possible to do what I want. The size of this file is 12kb, definitely no embedded fonts but all Polish characters are properly printed. I guess you can't read Polish but compare PDF with JPG and if they look the same you can't say that there's no way to do that. I just don't know how to use the same method using FOP. Regards, Tomasz mehdi houshmand wrote: Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Central European characters in PDF with Base14 fonts
Hi Tomasz, Sorry, maybe I didn't communicate what I meant properly. I wasn't saying there's no way to do that in PDF, or that the PDF spec doesn't allow that. I only meant that in FOP the base 14 fonts are encoded using WinAnsi. This means that FOP doesn't do what you're asking for. It is possible to get FOP to support more encodings, but the feature would have to be implemented. Mehdi On 23 June 2011 18:36, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi Mehdi, Have you looked at pdf_pl.pdf attached to my first post? This is proof that it's possible to do what I want. The size of this file is 12kb, definitely no embedded fonts but all Polish characters are properly printed. I guess you can't read Polish but compare PDF with JPG and if they look the same you can't say that there's no way to do that. I just don't know how to use the same method using FOP. Regards, Tomasz mehdi houshmand wrote: Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Central European characters in PDF with Base14 fonts
Mehdi, May be I don't understand details in PDF technology - I'm not an expert in this area. It seems to me that my example of PDF file use WinAnsi encoding for base 14 fonts. Look inside, at font definitions: /Type /Font /Subtype /Type1 /Name /BF5 /Encoding 4 0 R /BaseFont /Helvetica Encoding is defined in 4 0 R, I've quoted it already: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute Isn't in Base14 font in WinAnsi encoding? And still some extra characters - defined by glyph names - are displayed properly. I don't want FOP to support other encodings in Base14 fonts - I'm not sure if it's possible according to PDF format. I just want to add that /Differences - this mechanism is supported in PDFEncoding.java but that's for embedded fonts only, I believe. If you know perfectly FOP source code and assure that there is absolutely no way to produce a PDF like the one I've attached then I'll try to implement that mechanism in FOP. It could be difficult to me because of my limited knowledge of FOP and PDF but it's worth trying. Tomasz mehdi houshmand wrote: Hi Tomasz, Sorry, maybe I didn't communicate what I meant properly. I wasn't saying there's no way to do that in PDF, or that the PDF spec doesn't allow that. I only meant that in FOP the base 14 fonts are encoded using WinAnsi. This means that FOP doesn't do what you're asking for. It is possible to get FOP to support more encodings, but the feature would have to be implemented. Mehdi On 23 June 2011 18:36, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi Mehdi, Have you looked at pdf_pl.pdf attached to my first post? This is proof that it's possible to do what I want. The size of this file is 12kb, definitely no embedded fonts but all Polish characters are properly printed. I guess you can't read Polish but compare PDF with JPG and if they look the same you can't say that there's no way to do that. I just don't know how to use the same method using FOP. Regards, Tomasz mehdi houshmand wrote: Hi Tomasz, I could be wrong here, since I haven't tested this myself, but I'm pretty sure that currently there's no way to do what you're wanting without embedding the font. The Base14Fonts only look like they support WinAnsi encoding (with the obvious exception of ZapfDingbats and Symbol). Hope that helps, Mehdi On 23 June 2011 13:45, Tomasz Judycki tjudy...@tv.com.pl wrote: Hi! People say that it's not possible to generate a PDF file with Central European characters using only Base14 fonts and that embedding true type fonts is necessary to achieve that. However I managed to do so, using another technology, several years ago. Look at the example http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf (it should looks like http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ). This PDF file contains: 4 0 obj /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 143 /Zacute 159 /zacute 140 /Sacute 156 /sacute 202 /Eogonek 234 /eogonek 198 /Cacute 230 /cacute 209 /Nacute 241 /nacute 211 /Oacute 243 /oacute 163 /Lslash 179 /lslash 165 /Aogonek 185 /aogonek 175 /Zdotaccent 191 /zdotaccent ] endobj The problem was described several times, e.g.: http://old.nabble.com/Using-Central-European-characters-td3739791.html https://issues.apache.org/bugzilla/show_bug.cgi?id=17828 It seems that FOP 1.0 implements Central European encoding, for example in src/codegen/fonts/encodings.xml there is definition of CE_ENCODING. The question is: how could I generate PDF from http://old.nabble.com/file/p31910912/pltext.fo pltext.fo (effect should looks like http://old.nabble.com/file/p31910912/pltext.jpg pltext.jpg ) using just Base14 fonts? I would like to avoid embedding true type fonts to simplify the solution and to keep PDF small. Embedded font means +300kb. Regards, Tomasz Judycki -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org -- View this message in context: http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: