Re: [iText-questions] ListItems and Table splitting
On 01/07/2010 02:57 PM, natros wrote: > Hello, > > I'm having some problems with table splitting and ListItems. Most of > the time the last item is repeated and the end of the page as you can > see in the attached PDF file. In my case, the text "hello number 9" in > first page is repeated in second page. The same happens in the last > page with "hello number 11" and the one that seems correct to me is > the transition from the page 3 to page 4. > > Is this a bug or am I doing something wrong? > > Thank you. anyone? -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Barcode128 PDF start and stop charact ers don´t appear
You may have success using WINANSI encoding and BaseFont.setDirectTextToByte(true). It looks like your font has a flag that makes it symbolic but then uses chars outside 00-ff as a symbolic font should do. As I don't have the font, this is my best guess. Paulo - Original Message - From: "Claudia Murialdo" To: Sent: Friday, January 08, 2010 9:17 PM Subject: Re: [iText-questions] Barcode128 PDF start and stop characters don´t appear > Paulo, with reference to your response: "Maybe those characters don't > exist in the font or are invisible" > I checked it and those characters do exist, I checked it using Character > Map of Windows, for instance the character Š in font BarCode 128 has a > valid symbol (which are 4 vertical bars and it is the character Latin > Capital Letter S With Caron U+0160 ). > > While debugging itext source code I see the text is encoded using this > line: > PdfEncodings.ConvertToBytes(text, "symboltt"); which goes to > SymbolTTConversion.CharToByte and in that function characters like Š are > removed: > >for (int k = 0; k < len; ++k) { >char c = ch[k]; >if ((c & 0xff00) == 0 || (c & 0xff00) == 0xf000) //it > doesn't happen for Š so it is ignored >b[ptr++] = (byte)c; >} > > Why this character is ignored in that code?. It is a valid character for > Code128 font. > > Any help would be appreciated. > Regards, > Claudia. > > > > On Fri, Jan 8, 2010 at 4:33 PM, Claudia Murialdo > mailto:cmuria...@gmail.com>> wrote: > Hello, > I have another example of a valid text for Barcode 128: > "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ" > It corresponds to the string 3309072963568700011355003017381600349594 > converted to Barcode 128. > It has checksum and start and stop characters. It is ok in word when I use > Barcode 128 font. But it is incomplete (the start and stop characters > don't appear) in the generated PDF. > This is my source code: > > >Rectangle pageSize = new Rectangle(780, 525); >Document document = new Document(pageSize); > >PdfWriter writer = PdfWriter.GetInstance(document, > File.OpenWrite("Test.pdf")); >document.Open(); > >PdfContentByte cb = writer.DirectContent; >BaseFont bf = > BaseFont.CreateFont(@"C:\WINDOWS\Fonts\bcode128.ttf", BaseFont.IDENTITY_H, > BaseFont.EMBEDDED); > >cb.SetFontAndSize(bf, 50); >cb.BeginText(); >cb.ShowTextAligned(Element.ALIGN_CENTER, > "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ", 200, 400, 0f); >cb.EndText(); >document.Close(); > > What do you think that could be the problem?. > Regards, > Claudia. > > > > On Thu, Jan 7, 2010 at 1:40 PM, Claudia Murialdo > mailto:cmuria...@gmail.com>> wrote: > Paulo, I did another test with a string of characters which has a > checksum, and it seems to be ok. If I write those characters in Word with > the "PF Barcode 128" font I see the barcode is ok (see > CompleteBarcode.rtf) . > But the same string (which is in text.txt) appears incomplete in the PDF > generated using itext (IncompleteBarcode.pdf). The start and stop > characters are not visible. I'm not sure what else to try. > What else do you think could be the problem?. > > > > On Sat, Dec 26, 2009 at 12:53 PM, Claudia Murialdo > mailto:cmuria...@gmail.com>> wrote: > Ok. Thank you. I'm going to check that. > Regards, > Claudia. > > On Wed, Dec 23, 2009 at 5:17 PM, Paulo Soares > mailto:psoa...@glintt.com>> wrote: > Maybe those characters don't exist in the font or are invisible. If that's > a > code128 font you'll also need to calculate the checksum and put another > character or characters, it's quite complex. I don't see how this is an > iText related problem. > > Paulo > > - Original Message - > From: "Claudia Murialdo" mailto:cmuria...@gmail.com>> > To: > mailto:itext-questions@lists.sourceforge.net>> > Sent: Wednesday, December 23, 2009 1:54 PM > Subject: [iText-questions] Barcode128 PDF start and stop characters don´t > appear > > >> Hello, >> I'm using itext to generate a PDF document with a BarCode128. The problem >> is that the start and stop characters (characters 135 and 138) are not >> printed. It works fine if I do it using iTextSharp.text.pdf.Barcode128 >> instead of PdfContentByte using the true type font. >> This is the code: >> >>public static void Main(String[] args) >>{ >>Rectangle pageSize = new Rectangle(780, 525); >>Document document = new Document(pageSize); >> >>PdfWriter writer = PdfWriter.GetInstance(document, >> File.OpenWrite("Test.pdf")); >>document.Open(); >> >>PdfContentByte cb = writer.DirectContent; >>BaseFont bf = >> BaseFont.CreateFont(@"C:\WINDOWS\Fonts\Bcode128.ttf", >> BaseFont.IDENTITY_H, BaseFont.EMBEDDED); >>cb.SetFontAndSize(bf, 50); >>cb.BeginText(); >>cb.ShowTextAligned(Element.ALIGN_CENTER, "‡BARCODE7Š", 200,
Re: [iText-questions] Barcode128 PDF start and stop ch aracters don´t appear
Paulo, with reference to your response: "Maybe those characters don't exist in the font or are invisible" I checked it and those characters do exist, I checked it using Character Map of Windows, for instance the character Š in font BarCode 128 has a valid symbol (which are 4 vertical bars and it is the character Latin Capital Letter S With Caron U+0160 ). While debugging itext source code I see the text is encoded using this line: PdfEncodings.ConvertToBytes(text, "symboltt"); which goes to SymbolTTConversion.CharToByte and in that function characters like Š are removed: for (int k = 0; k < len; ++k) { char c = ch[k]; if ((c & 0xff00) == 0 || (c & 0xff00) == 0xf000) //it doesn't happen for Š so it is ignored b[ptr++] = (byte)c; } Why this character is ignored in that code?. It is a valid character for Code128 font. Any help would be appreciated. Regards, Claudia. On Fri, Jan 8, 2010 at 4:33 PM, Claudia Murialdo wrote: > Hello, > I have another example of a valid text for Barcode 128: > "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ" > It corresponds to the string 3309072963568700011355003017381600349594 > converted to Barcode 128. > It has checksum and start and stop characters. It is ok in word when I use > Barcode 128 font. But it is incomplete (the start and stop characters don't > appear) in the generated PDF. > This is my source code: > > > Rectangle pageSize = new Rectangle(780, 525); > Document document = new Document(pageSize); > > PdfWriter writer = PdfWriter.GetInstance(document, > File.OpenWrite("Test.pdf")); > document.Open(); > > PdfContentByte cb = writer.DirectContent; > BaseFont bf = > BaseFont.CreateFont(@"C:\WINDOWS\Fonts\bcode128.ttf", BaseFont.IDENTITY_H, > BaseFont.EMBEDDED); > > cb.SetFontAndSize(bf, 50); > cb.BeginText(); > cb.ShowTextAligned(Element.ALIGN_CENTER, > "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ", 200, 400, 0f); > cb.EndText(); > document.Close(); > > What do you think that could be the problem?. > Regards, > Claudia. > > > > On Thu, Jan 7, 2010 at 1:40 PM, Claudia Murialdo wrote: > >> Paulo, I did another test with a string of characters which has a >> checksum, and it seems to be ok. If I write those characters in Word with >> the "PF Barcode 128" font I see the barcode is ok (see CompleteBarcode.rtf) >> . >> But the same string (which is in text.txt) appears incomplete in the PDF >> generated using itext (IncompleteBarcode.pdf). The start and stop characters >> are not visible. I'm not sure what else to try. >> What else do you think could be the problem?. >> >> >> >> On Sat, Dec 26, 2009 at 12:53 PM, Claudia Murialdo >> wrote: >> >>> Ok. Thank you. I'm going to check that. >>> Regards, >>> Claudia. >>> >>> On Wed, Dec 23, 2009 at 5:17 PM, Paulo Soares wrote: >>> Maybe those characters don't exist in the font or are invisible. If that's a code128 font you'll also need to calculate the checksum and put another character or characters, it's quite complex. I don't see how this is an iText related problem. Paulo - Original Message - From: "Claudia Murialdo" To: Sent: Wednesday, December 23, 2009 1:54 PM Subject: [iText-questions] Barcode128 PDF start and stop characters don´t appear > Hello, > I'm using itext to generate a PDF document with a BarCode128. The problem > is that the start and stop characters (characters 135 and 138) are not > printed. It works fine if I do it using iTextSharp.text.pdf.Barcode128 > instead of PdfContentByte using the true type font. > This is the code: > >public static void Main(String[] args) >{ >Rectangle pageSize = new Rectangle(780, 525); >Document document = new Document(pageSize); > >PdfWriter writer = PdfWriter.GetInstance(document, > File.OpenWrite("Test.pdf")); >document.Open(); > >PdfContentByte cb = writer.DirectContent; >BaseFont bf = BaseFont.CreateFont(@"C:\WINDOWS\Fonts\Bcode128.ttf", > BaseFont.IDENTITY_H, BaseFont.EMBEDDED); >cb.SetFontAndSize(bf, 50); >cb.BeginText(); >cb.ShowTextAligned(Element.ALIGN_CENTER, "‡BARCODE7Š", 200, 350, > 0f); //Character ‡ and Š don't appear in the generated PDF document > >cb.EndText(); > >document.Close(); >} > > I tried with the unicode numbers (I tried with this string: > "\u01c2BARCODE7\u0160") but it is the same. > Also, bf.CharExists('‡') returns false, and the same for > bf.CharExists('Š'). I guess it is related with the problem. > > How can I get those start and stop characters printed using > PdfContentByte?. > Tha
[iText-questions] unexpected result after merging, output pages are uneven
I've followed a tutorial to merge two pdf files, however the pages of the second input file seem to only occupy a small (bottom-left) portion of the page in the output. Here's the output, it might be easiest to see it first: http://epswing.com/shared/itext/output.pdf These are the input files: http://epswing.com/shared/itext/input1.pdf http://epswing.com/shared/itext/input2.pdf This is the code I'm using to merge: http://epswing.com/shared/itext/code.txt The first input file was generated with itext and written to the filesystem. I've looked through the faq and recent mailing list entries, but I'm not even sure what I should be searching for. Any suggestions or links to pages I might read to better understand this problem? Thanks, Eric -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Barcode128 PDF start and stop ch aracters don´t appear
Hello, I have another example of a valid text for Barcode 128: "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ" It corresponds to the string 3309072963568700011355003017381600349594 converted to Barcode 128. It has checksum and start and stop characters. It is ok in word when I use Barcode 128 font. But it is incomplete (the start and stop characters don't appear) in the generated PDF. This is my source code: Rectangle pageSize = new Rectangle(780, 525); Document document = new Document(pageSize); PdfWriter writer = PdfWriter.GetInstance(document, File.OpenWrite("Test.pdf")); document.Open(); PdfContentByte cb = writer.DirectContent; BaseFont bf = BaseFont.CreateFont(@"C:\WINDOWS\Fonts\bcode128.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); cb.SetFontAndSize(bf, 50); cb.BeginText(); cb.ShowTextAligned(Element.ALIGN_CENTER, "‰A)'=_Xwè!-Wè>èè1F0èBÀ~UŠ", 200, 400, 0f); cb.EndText(); document.Close(); What do you think that could be the problem?. Regards, Claudia. On Thu, Jan 7, 2010 at 1:40 PM, Claudia Murialdo wrote: > Paulo, I did another test with a string of characters which has a checksum, > and it seems to be ok. If I write those characters in Word with the "PF > Barcode 128" font I see the barcode is ok (see CompleteBarcode.rtf) . > But the same string (which is in text.txt) appears incomplete in the PDF > generated using itext (IncompleteBarcode.pdf). The start and stop characters > are not visible. I'm not sure what else to try. > What else do you think could be the problem?. > > > > On Sat, Dec 26, 2009 at 12:53 PM, Claudia Murialdo wrote: > >> Ok. Thank you. I'm going to check that. >> Regards, >> Claudia. >> >> On Wed, Dec 23, 2009 at 5:17 PM, Paulo Soares wrote: >> >>> Maybe those characters don't exist in the font or are invisible. If >>> that's a >>> code128 font you'll also need to calculate the checksum and put another >>> character or characters, it's quite complex. I don't see how this is an >>> iText related problem. >>> >>> Paulo >>> >>> - Original Message - >>> From: "Claudia Murialdo" >>> To: >>> Sent: Wednesday, December 23, 2009 1:54 PM >>> Subject: [iText-questions] Barcode128 PDF start and stop characters don´t >>> appear >>> >>> >>> > Hello, >>> > I'm using itext to generate a PDF document with a BarCode128. The >>> problem >>> > is that the start and stop characters (characters 135 and 138) are not >>> > printed. It works fine if I do it using iTextSharp.text.pdf.Barcode128 >>> > instead of PdfContentByte using the true type font. >>> > This is the code: >>> > >>> >public static void Main(String[] args) >>> >{ >>> >Rectangle pageSize = new Rectangle(780, 525); >>> >Document document = new Document(pageSize); >>> > >>> >PdfWriter writer = PdfWriter.GetInstance(document, >>> > File.OpenWrite("Test.pdf")); >>> >document.Open(); >>> > >>> >PdfContentByte cb = writer.DirectContent; >>> >BaseFont bf = >>> BaseFont.CreateFont(@"C:\WINDOWS\Fonts\Bcode128.ttf", >>> > BaseFont.IDENTITY_H, BaseFont.EMBEDDED); >>> >cb.SetFontAndSize(bf, 50); >>> >cb.BeginText(); >>> >cb.ShowTextAligned(Element.ALIGN_CENTER, "‡BARCODE7Š", 200, 350, >>> > 0f); //Character ‡ and Š don't appear in the generated PDF document >>> > >>> >cb.EndText(); >>> > >>> >document.Close(); >>> >} >>> > >>> > I tried with the unicode numbers (I tried with this string: >>> > "\u01c2BARCODE7\u0160") but it is the same. >>> > Also, bf.CharExists('‡') returns false, and the same for >>> > bf.CharExists('Š'). I guess it is related with the problem. >>> > >>> > How can I get those start and stop characters printed using >>> > PdfContentByte?. >>> > Thanks in advance. >>> > Claudia. >>> > >>> >>> >>> >>> -- >>> This SF.Net email is sponsored by the Verizon Developer Community >>> Take advantage of Verizon's best-in-class app development support >>> A streamlined, 14 day to market process makes app distribution fast and >>> easy >>> Join now and get one step closer to millions of Verizon customers >>> http://p.sf.net/sfu/verizon-dev2dev >>> ___ >>> iText-questions mailing list >>> iText-questions@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/itext-questions >>> >>> Buy the iText book: http://www.1t3xt.com/docs/book.php >>> Check the site with examples before you ask questions: >>> http://www.1t3xt.info/examples/ >>> You can also search the keywords list: >>> http://1t3xt.info/tutorials/keywords/ >> >> >> > -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app d
Re: [iText-questions] Create cut marks for pdf
Such marks are just standard PDF drawing operations (drawrect, drawline, etc.) - you can do all of these things with iText. You need to be sure to set the colorspace to Separation, value Black. -Original Message- From: Mathias Nilsson [mailto:wicket.program...@gmail.com] Sent: Friday, January 08, 2010 10:35 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Create cut marks for pdf Hi, In indesign when creating a pdf you can add crop marks or cut marks for printing the pdf. What is the best way of achieving this. I generate pdf in a kinds of sizes so I need a generic solution to this. Any pointers? / Mathias -- View this message in context: http://old.nabble.com/Create-cut-marks-for-pdf-tp27077823p27077823.html Sent from the iText - General mailing list archive at Nabble.com. -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Create cut marks for pdf
Hi, In indesign when creating a pdf you can add crop marks or cut marks for printing the pdf. What is the best way of achieving this. I generate pdf in a kinds of sizes so I need a generic solution to this. Any pointers? / Mathias -- View this message in context: http://old.nabble.com/Create-cut-marks-for-pdf-tp27077823p27077823.html Sent from the iText - General mailing list archive at Nabble.com. -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Embedding subset of fonts
> From: ke...@renderx.com > To: itext-questions@lists.sourceforge.net > Date: Thu, 7 Jan 2010 13:35:19 -0800 > Subject: Re: [iText-questions] Embedding subset of fonts > >> The same electrons in in sme state in violation of heisenberg? LOL. You > would then be saying that compression is not allowed. > Since itext is deterministic, if you feed it the same input twice you should > get the same output. This is > no different than unzipping. > > Actually, one has many more considerations that this simplistic view. While > it stands to reason the above makes sense, one would need to consider ALL > the factors involved ... including: > > 1) Hardware > 2) Operating System and other environments like network communication if > involved > 3) Version of Java > 4) Versions of other external resources like fonts and such > 5) Exact version of code involved that is recreating the information > 6) Is the data/code accessing external information at all (like code that > requests a date from the OS)? See my other comments, sure you need to make sure your code works, but you need to do that in any case- I think I mentioned getting all your info from the db, including dates presumably. Producing a signature from the pixels would seem to be one approach ( store 128 byte signature in your DB from the originally generated pixels and make sure you get the same thing from your recreated document. ). If you generated 5 pages with the same font, it may make sense to just store that once somewhere. > > In legal circles, one would need to consider all of these factors. Well, everyone wants to have confidence in the end result. > > Kevin Brown > > -- > > Message: 3 > Date: Thu, 7 Jan 2010 13:30:04 -0500 > From: Mike Marchywka > Subject: Re: [iText-questions] Embedding subset of fonts > To: > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > >> From: lrose...@adobe.com >> To: itext-questions@lists.sourceforge.net >> Date: Thu, 7 Jan 2010 10:20:50 -0800 >> Subject: Re: [iText-questions] Embedding subset of fonts >> >> My only comment would be that in most cases, there are laws/regulations > that require that the "exact document" that was presented/distributed is > what goes into the archive. In such a case, it wouldn't be possible to > archive "parts"... > > The same electrons in in sme state in violation of heisenberg? LOL. You > would then be saying that compression is not allowed. > Since itext is deterministic, if you feed it the same input twice you should > get the same output. This is > no different than unzipping. > > > > > -- > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > Check the site with examples before you ask questions: > http://www.1t3xt.info/examples/ > You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ _ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/196390710/direct/01/ -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Embedding subset of fonts
> Date: Fri, 8 Jan 2010 11:06:43 +0100 > From: > To: itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] Embedding subset of fonts > > Thanks for the lively discussion. > I totally agree to Leonard's comment, I have to, better must, archive the > final (absolutly the same file as the print provider got used) version of > the single PDF, so there is no way to produce or dispart on modules like > text and font. > > On the other side, the generating, mean validate the jasperreport fields > and rendering the PDF happens for a data collection of more then 10-15.000 > records, should work as fast as possible. So the process loads the data > from the DB, validate, render the PDF, creates the file (huge PDF) and > sends to the print provider. This should work as fast as possible. > > Later, after finishing all letter production, the splitting process > starting and have enough time to finish the job (archive the single > documents into the DB, referencing each record loaded before). The > end-user can load the single document(invoice, letter, etc.) in a fast way > and be sure seeing the final version. This is fine and is running stable > since few years. > > Times have changed - we are using exotic fonts, given as ttf, so we need > to embed them -- requirement from the print provider. Further we won't > explode the DB. > > Don't misunderstood me pls, won't teach you or repeat myself, but the > system and the process is given, running stable. So we are searching for > the "best complement solution", without extremly burden the budget. > Your original concern suggested it wouldn't be stable as you had to store more stuff along with your data- and I guess this is a recurring problem.It may or may not be the case that buying more terbytes is your cheapest stable solution. I certainly understand that problems in trying to write code to fix poorly posed problems. People think they are using a flexible robust standard but it isn't flexible when used as an artificial constraint that just requires more resources to support. That's fine for a private company you can do whatever you want but often the US agencies solicit input on various topics and PDF's have shown up everywhere creating various limitations depending on how they are used. Many times I will contribute input based on awareness of issues like this. If you are worried about size and impact on performance, this sounds like a case where someone's understanding of a law is reducing performance while providing no additional value to anyone. What you are saying is that they won't allow compression or zip files inside the DB etc- if you preserve the algorithm ( in DB for that matter LOL) which is itext and your code, all the input data ( which even pdf people may put into db from time to time ) then you are simply compressing your pdf with a transform that allows things like indexing etc ( the text is easier to index than pixels and you rarely want to search for fonts which have no relationship to information that can't be better represented by something indicating "this is a header" ). Depending on how the DB or repository works, you may not even be able to point to a "PDF FILE" anywhere on the disk- with embedded compression or encryption for example and you rely on the OS file system to reconstruct your "original" file from sectors in any case. Whatever law you are talking about is not enforceable except by creating dumber criteria unless it just wants some assurance you can pull out an exact copy of whatever you sent out originally. Certainly buggy code, say your code around itext that inadvertently uses random numbers or has threading issues, will make it less reliable than a commercial product like winzip decompress but I wouldn't use that for production anyway ( you should have signatures for the page images you generate for your own sanity checks for example). I would just mention that decomposition into "things" that represent a signal is a great way to compress data. This not only makes it smaller, but usually makes it more versatile as often a Fourier spectrum of sound creates coefficients of more interest than a time series ( you could at least ask " is this a single tone?" or something reasonably easily from that ). PDF of course is usually generated by decompressing your input coefficients - which generally happen to be things like ASCII text and some images and formatting rules- creating a "decompressed" file that happens to be human readable but is not always invertible back to the input information. I'll admit it took me a while to trust winzip too but I never would have made a law stopping people from using it. LOL. And, agaiin, if you really want ( and should intenally anyway to validate your own work ) you can hash images to generate signatures and make sure they match the "original" etc. In short, if you have enough internal controls to make sure anythin
[iText-questions] LineSeparator in a paragraph with IDENTITY_H font encoding
Hi, I encountered a problem when using a DottedLineSeparator in a paragraph with a unicode font encoded as IDENTITY_H. The generated dotted line don't fill all the available space, but only the available space less an amount that seems to be dependent on the paragraph font and size. If I use the same font, butencodedasWINANSI, all the space isoccupiedasexpected. Herefollows a sample code in C sharp (sorry, notJava): Documentdoc = newDocument(PageSize.A4, 0, 0, 0, 0); PdfWriterwriter = PdfWriter.GetInstance(doc, newFileStream("test.pdf", FileMode.Create, FileAccess.Write)); doc.Open(); Font itemFont = FontFactory.GetFont("Microsoft SansSerif", BaseFont.IDENTITY_H, true, 10.0F); Paragraph p = newParagraph("Some TextBefore", itemFont); p.Alignment = Element.ALIGN_JUSTIFIED_ALL; LineSeparatorls = newDottedLineSeparator(); ls.Percentage = 100; ChunkchunkedLs = newChunk(ls); p.Add(chunkedLs); p.Add("Some TextAfter")); p.IndentationLeft = 10; p.IndentationRight = 0; doc.Add(p); doc.Close(); For the "chunkedLs" chunk only, which includes the LineSeparator, I can set the same font used in the paragraph, but using WINANSI encoding. With this method the dotted line fills all the available space, but it doesn't appear to me a good solution, as I need fonts to be embedded and preferably IDENTITY_H encoded. Investigating through the iTextSharp 5.0.0 source, this behaviour seems to be in the BaseFont.GetWidth(string) property, when implemented by the TrueTypeFontUnicode class, for determining the width of Chunk.OBJECT_REPLACEMENT_CHAR (used when adding the LineSeparator to a Chunk). With WINANSI encoding, BaseFont.GetWidth() return 0 for this character, while with TrueTypeFontUnicode.GetWidth() it returns a size >0, and this seems to cause the dotted line to take up all the available space. Is there a method for using LineSeparators in paragraphs with fonts encoded as IDENTITY_H? Thanks, Fabrizio -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Unable to cast object of type 'iTextSharp.text.html.simpleparser.IncCell' to type 'iTextSharp.text.Rectangle'.
Hi, I am working on .Net 3.5 framework and version 4.1.0.0. I have a html table, and some controls and gridviews and datalist nested into it. When I export the table to pdf, the following error is thrown Unable to cast object of type 'iTextSharp.text.html.simpleparser.IncCell' to type 'iTextSharp.text.Rectangle'. My code for conversion is as below StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=EmployeeDetails.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); tblPowerReport.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 8f, 8f, 8f, 8f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); htmlparser.Parse(sr);pdfDoc.Close(); Response.Write(pdfDoc); Response.End(); The error is thrown at the bolded area. While googling out, I observed that one of them have asked to check the corresponding tags and the spell check. Everything has been doubly checked. Its more than 3 days that this error is haunting me, Tried various tricks, nothing worked. Can you please throw upon some light. Regards Hema -- View this message in context: http://old.nabble.com/Unable-to-cast-object-of-type-%27iTextSharp.text.html.simpleparser.IncCell%27-to-type-%27iTextSharp.text.Rectangle%27.-tp27073611p27073611.html Sent from the iText - General mailing list archive at Nabble.com. -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] LineSeparator in a paragraph with IDENTITY_H font encoding
Hi, I encountered a problem when using a DottedLineSeparator in a paragraph with a unicode font encoded as IDENTITY_H. The generated dotted line don't fill all the available space, but only the available space less an amount that seems to be dependent on the paragraph font and size. If I use the same font, butencodedasWINANSI, all the space isoccupiedasexpected. Herefollows a sample code in C sharp (sorry, notJava): Documentdoc = newDocument(PageSize.A4, 0, 0, 0, 0); PdfWriterwriter = PdfWriter.GetInstance(doc, newFileStream("test.pdf", FileMode.Create, FileAccess.Write)); doc.Open(); Font itemFont = FontFactory.GetFont("Microsoft SansSerif", BaseFont.IDENTITY_H, true, 10.0F); Paragraph p = newParagraph("Some TextBefore", itemFont); p.Alignment = Element.ALIGN_JUSTIFIED_ALL; LineSeparatorls = newDottedLineSeparator(); ls.Percentage = 100; ChunkchunkedLs = newChunk(ls); p.Add(chunkedLs); p.Add("Some TextAfter")); p.IndentationLeft = 10; p.IndentationRight = 0; doc.Add(p); doc.Close(); For the "chunkedLs" chunk only, which includes the LineSeparator, I can set the same font used in the paragraph, but using WINANSI encoding. With this method the dotted line fills all the available space, but it doesn't appear to me a good solution, as I need fonts to be embedded and preferably IDENTITY_H encoded. Investigating through the iTextSharp 5.0.0 source, this behaviour seems to be in the BaseFont.GetWidth(string) property, when implemented by the TrueTypeFontUnicode class, for determining the width of Chunk.OBJECT_REPLACEMENT_CHAR (used when adding the LineSeparator to a Chunk). With WINANSI encoding, BaseFont.GetWidth() return 0 for this character, while with TrueTypeFontUnicode.GetWidth() it returns a size >0, and this seems to cause the dotted line to take up all the available space. Is there a method for using LineSeparators in paragraphs with fonts encoded as IDENTITY_H? Thanks, Fabrizio -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Embedding subset of fonts
Thanks for the lively discussion. I totally agree to Leonard's comment, I have to, better must, archive the final (absolutly the same file as the print provider got used) version of the single PDF, so there is no way to produce or dispart on modules like text and font. On the other side, the generating, mean validate the jasperreport fields and rendering the PDF happens for a data collection of more then 10-15.000 records, should work as fast as possible. So the process loads the data from the DB, validate, render the PDF, creates the file (huge PDF) and sends to the print provider. This should work as fast as possible. Later, after finishing all letter production, the splitting process starting and have enough time to finish the job (archive the single documents into the DB, referencing each record loaded before). The end-user can load the single document(invoice, letter, etc.) in a fast way and be sure seeing the final version. This is fine and is running stable since few years. Times have changed - we are using exotic fonts, given as ttf, so we need to embed them -- requirement from the print provider. Further we won't explode the DB. Don't misunderstood me pls, won't teach you or repeat myself, but the system and the process is given, running stable. So we are searching for the "best complement solution", without extremly burden the budget. Zoltan > My only comment would be that in most cases, there are laws/regulations > that require that the "exact document" that was presented/distributed is > what goes into the archive. In such a case, it wouldn't be possible to > archive "parts"... > > Leonard > > -Original Message- > From: Mike Marchywka [mailto:marchy...@hotmail.com] > Sent: Thursday, January 07, 2010 12:44 PM > To: itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] Embedding subset of fonts > > > > > > > > > > >> Date: Thu, 7 Jan 2010 17:38:05 +0100 >> From: zoltan.kak...@bitmanager.de >> To: itext-questions@lists.sourceforge.net >> Subject: Re: [iText-questions] Embedding subset of fonts >> >> >> >> >> >> >> >> >> >> Hi, >> >> >> >> I can't agree that. >> >> Just to show you the difference between huge single PDF and broken down >> single PDF-s, have a look pls at the following table: >> >> >> >> embedded subset Huge PDF(kB) Pages Single PDF (averaged in >> kB) >> >> >> >> yes 130 61 >> 27 >> >> yes 2147 1184 >> 29 >> >> >> >> no 633 253 >> 6 >> >> no 14202 7577 >> 4 >> >> >> >> The single PDF is a lot of bigger, a factor of 5-6 of multiplication. >> >> Producing ca. 4 million pages per year and archiving this (this is only >> the beginning), the diference would be more then 100GB more space, data >> transfer and so on. > > > At the risk of antagonizing Leonard and Bruno again re the resource > requirements, > I guess I'd ask why you archive PDF files and not just the pieces that go > into making > them which presumably are smaller, and then recreate on the fly when > needed? You wouldn't archive page images > unless you value rendering speed over size. It is easier to store a font > and input string and have a "decompression" algorithm that happens to > convert > this into a human readable image. You wouldn't have many quams about > archiving a zip file, > why not "decompose" your pdf file into input pieces (text and fonts) that > probably are much smaller and for that > matter would probably allow better indexing with your DB facilities. > Then, you > can "decompress" using itext when needed. Creating a PDF file is a great > way to "decompress" > a concise representation of anything ( just to provoke a response from Leo > LOL). > > > > > >> >> >> >> Regards, >> >> Zoltan >> >> >> >> 1T3XT info schrieb: >> >> >> Zoltan Kakucs wrote: >> >> >> >> >> Thanks again. >> Do you mean with subset fonts embedding the ttf-s or using the metrik >> files (afm) together with the postscript (pfb)? >> We are using also fonts given only as ttf. >> It's a bit shadowy for me, how the final version looks like. >> >> >> >> >> If you embed Type1 fonts (afm or pfm + pfb), iText will embed >> the complete font. (But most Type1 fonts aren't that big.) >> If you embed True Type or Open Type fonts with True Type oulines >> (ttf files), iText will automatically subset the font. >> >> Now if you create the large document with the fonts embedded, >> chances are the separate files won't be that large, because you're >> basically using an alphabet of 26 letters (times 2 for caps) and >> some interpunction. >> >> If you have a capital Z in one page, the description of this glyph >> will also be in the subsetted font of documents that don't contain >> the capital Z, but that's not a technical problem. The file will be >> a little bit bigger because of the unused Z, but is that a problem? >> >> >> >> > > _ > Hotmail: Powerfu
Re: [iText-questions] Problem with forms
Phani Kumar Reddy Pamulapati wrote: > Hi, > > Thank you so much for the reply, i kind of agree with your point that no > forms no fields, is it possible to have editable text box / line in the > PDF without having a form. Without a form: no. Without an AcroForm: yes. > As per your reply "without seeing the PDF we can't say anything that > makes sense.", are your refering to any specific properties do you want > me to check. Do you have an AcroForm or an XFA form or no form? If you use iText to inspect the fields (instead of filling them), what is returned? Note that answering these questions in a back and forth scenario is time-consuming and you risk not getting an answer because lack of time on our side. You should consider buying a support contract if you don't want to publish your form publicly. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] The entity name must immediately follow the '&' in the entity reference.
itsdines wrote: > HI > when i try to convert html to pdf am parsing jsp page that time i am getting > exception. > i have given like this. >HtmlParser.parse(document, > "http://192.168.10.170:7077/final/reporter/SendMail.jsp";); > > please help me. > > > ExceptionConverter: org.xml.sax.SAXParseException: The entity name must > immediately follow the '&' in the entity reference. In the original document, you have an ampersand that isn't followed by a valid entity name. This is not an iText question, it's an XML question. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Setting pagesize correctly , Multipage PDF
crm...@gmail.com wrote: > Sirs, > > > > I am developing a java class to import JPEG images into a multipage PDF. > The files are stored into a single directory which has images with > different sizes, like first page is an A4 (portrait), second page is an > A5 and the third page is an A4 (landscape). I suppose that I am doing > something wrong because the multipage PDF is created but all pages > remains with the first page Image size. Any thoughts? > writer.setPageSize(rectangle); Use document.setPageSize(rectangle); -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Column Width
pbs wrote: > Hi. > > I am trying to se the first column in a table to a different width. The > table can have a different number of columns each time the program is run, > for example it may have 5 columns one time, then depending on the date it is > presenting it may have 7. > > This works fine using by passing the number of columns while creating the > table object as follows : > PdfPTable table = new PdfPTable(intColumns); > > All columns are of the same width. However, I would like the first column to > be narrower. If I always knew the number of columns I could use this > PdfPTable table = new PdfPTable (new float [] { 1.0f, 2.0f, 2.0f, 2.0f, 2.0f > }); > > Is there a way around this? Why do you use a hardcoded float[]? If you can create a table with intColumns, surely you can create a float array like this: float[] columns = new float[intColumns]; and then fill that float. Questions like this are off-topic on the list. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Horizontal scrolling
Rodney Williams wrote: > I need to display 25 columns of PdfPtable data horizontally using the > first column as a frozen header. How do I accomplish? Rephrase your question (an example of what you're trying to achieve would help). -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] html to Pdf conversion using iText
itsdines wrote: > i have images and data's in my html page when in convert to pdf i didn't get > any error but image is not displayed in my pdf am using iText2.0.8 please > help me Did you implement an ImageProvider? See http://itextpdf.com/examples/index.php?page=example&id=56 -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Column Width
Hi pbs, 2010/1/6 pbs > > Hi. > > I am trying to se the first column in a table to a different width. The > table can have a different number of columns each time the program is run, > for example it may have 5 columns one time, then depending on the date it > is > presenting it may have 7. > > This works fine using by passing the number of columns while creating the > table object as follows : > PdfPTable table = new PdfPTable(intColumns); > > All columns are of the same width. However, I would like the first column > to > be narrower. If I always knew the number of columns I could use this > PdfPTable table = new PdfPTable (new float [] { 1.0f, 2.0f, 2.0f, 2.0f, > 2.0f > }); > > Is there a way around this? > Have you tried simple math? - Create an array which size is the number of columns (i.e. your variable intColumns). - The first value will be the fixed width of the first column. - The other values can be calculated quite easily: (totalWidth - firstColumnWidth) / (intColumns - 1) - Use the array in the PdfPTable constructor. If you want the width of the first column to be a fraction of the others, it involves a little bit more calculus, but nothing you can't cope with, I'm sure. :) HTH, alexis -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/