[iText-questions] Unicode formatting characters

2014-05-03 Thread Vahid Nasiri
Hello, `ProcessChar` method of FontSelector class, drops Unicode formatting characters. http://www.fileformat.info/info/unicode/category/Cf/list.htm For example I need these 2 chars to process RTL data correctly: const char RightToLeftEmbedding = (char)0x202B; const char PopDirectionalFormatting

[iText-questions] Paragraph & PdfDiv

2014-03-06 Thread Vahid Nasiri
Hello, Right now it's not possible to add a PdfDiv to a Paragraph. The result is empty. It would be nice to have this feature as well. (It's possible to dissect it manually using its Content property) -- Subversion Kills

[iText-questions] Setting SetFullCompression location in the latest iTextSharp

2013-08-22 Thread Vahid Nasiri
Hello,   The following sample does not work with the latest iTextSharp. The produced PDF file has not the related XObjects of the image file. So the Adobe reader is not able to show the image. But this code works fine with iTextSharp 5.4.1. I found a simple solution for that: I have to move the lin

[iText-questions] Missing `/ProcSet` and XObject entries in the latest iTextSharp

2013-08-21 Thread Vahid Nasiri
Hello, In the recent versions of iTextSharp, some definitions of image dictionaries are missing in the produced PDF files:   With error (corrupted image, can't be displayed using Adobe reader, produced with latest iTextSharp) 1 0 obj <>>>/BBox[0 0 50 50]/FormType 1/Matrix [1 0 0 1 0 0]/Length 39/Fi

[iText-questions] New constructor for PdfReader

2013-08-20 Thread Vahid Nasiri
Hello,   I added the following constructor to PdfReader class to be able to work with streams:       public PdfReader(Stream isp, X509Certificate certificate, ICipherParameters certificateKey)     {     this.certificate = certificate;     this.certificateKey = certificateKey

[iText-questions] XMLWorker and RTL

2013-08-15 Thread Vahid Nasiri
Hello, I've attached a working sample of using XMLWorker with RTL Unicode HTML.using System; using System.Diagnostics; using System.IO; using System.Text; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.tool.xml; using iTextSharp.tool.xml.css; using iTextSharp.tool.xml.html;

[iText-questions] Using Path.Combine instead of concatenating strings in .NET

2013-08-15 Thread Vahid Nasiri
Hello, I was playing with XMLWroker and its AbstractImageProvider was not working correctly, because RetrieveImage method of ImageRetrieve.cs file has this line path = root + src; Which means GetImageRootPath of AbstractImageProvider must end with \\ in Windows machines. To solve this problem for a

[iText-questions] iTextSharp 5.4.2 and Rowspan in RTL conditions

2013-06-29 Thread Vahid Nasiri
Hello,   iTextSharp 5.4.2 won't process Rowspan in RTL conditions. It reports "Index was outside the bounds of the array." in line 494 of PdfPTable.cs file. Here is the sample to reproduce it:       using (var pdfDoc = new Document(PageSize.A4))     {     var pdfWriter

[iText-questions] iTextSharp 5.4.2 and Cell's HorizontalAlignment

2013-06-28 Thread Vahid Nasiri
Hello, Cell's HorizontalAlignment  does not work/has no effect in the latest iTextSharp for the added elements. (It was working file in previous versions)   using (var pdfDoc = new Document(PageSize.A4))     {     var pdfWriter = PdfWriter.GetInstance(pdfDoc, new FileStream("Tes

[iText-questions] Extracting glyph outlines

2012-12-12 Thread Vahid Nasiri
Hello, Is it possible to extract glyph outlines of the embedded fonts with iTextSharp? Something like GeneralPath info, 2D shape info of the available characters from the embedded fonts. -- LogMeIn Rescue: Anywhere, Anytime

[iText-questions] iTextSharp 5.3.4 & PdfSmartCopy

2012-12-09 Thread Vahid Nasiri
Hello, Here is the fix for the new PdfSmartCopy: public class PdfSmartCopy2 : PdfSmartCopy { public PdfSmartCopy2(Document document, Stream os) : base(document, os) { }   /// /// This is a forgotten feature in iTextSharp 5.3.4. /// Actually its PdfSmartCopy is useles

[iText-questions] Replacing duplicate images

2012-12-05 Thread Vahid Nasiri
Hello, I am trying to replace the duplicate images with available images in PDF file, but the result is corrupted. PdfReader.KillIndirect nulls the duplicate image, but writer.AddDirectImageSimple won't replace it with the reference of the previously available image. What's is the problem here? Tha

[iText-questions] PdfSmartCopy and PdfCopy are the same during the PdfConcatenate

2012-12-04 Thread Vahid Nasiri
Hello, PdfConcatenate of iTextSharp uses PdfSmartCopy and PdfCopy this way:       if (smart)     copy = new PdfSmartCopy(document, os);     else     copy = new PdfCopy(document, os);     But in reality, CopyIndirect method of PdfSmartCopy won't be called at

[iText-questions] PdfPtable TotalHeight is always zero in v 5.3.4

2012-11-13 Thread Vahid Nasiri
Hello, After adding a table to the page, its TotalHeight is always zero in v 5.3.4       document.Add(table);     var data =   table.TotalHeight; //it was OK in v 5.3.2-- Monitor your physical, virtual and c

[iText-questions] PdfConcatenate does not work in 5.3.4

2012-11-13 Thread Vahid Nasiri
Hello, A working code for merging documents (PdfConcatenate) is not working anymore in v5.3.4 It throws an exception in this method for copy.AddPage: --> protected PdfStream CopyStream(PRStream inp) { //... parentObjects.Add(value, inp); // duplicate value Same code works fine in 5.3.2---

[iText-questions] Relocationg to the new SVN

2012-11-13 Thread Vahid Nasiri
Hello everyone! iTextSharp's SVN location has changed and its new repository is located at http://svn.code.sf.net/p/itextsharp/code/ with new uuid '820d3149-562b-4f88-9aa4-a8e61a3485cf' and not the old one: 'da003780-e18d-4f51-86a4-c2ecb517afe5' to fix this issue, open the 'wc.db' database and edit

[iText-questions] iTextSharp SVN

2012-11-12 Thread Vahid Nasiri
Hello, It seems iTextSharp SVN's (https://itextsharp.svn.sourceforge.net/svnroot/itextsharp) is not updated to the last version, right? Thanks, Vahid -- Everyone hates slow websites. So do we. Make your web apps faster wi

[iText-questions] Row span and RTL bug

2012-10-23 Thread Vahid Nasiri
Hello, Setting the row span works fine in LTR conditions, but when I set the run direction to RTL, currentColIdx will be -1.   =       private void SkipColsWithRowspanAbove() {     int direction = 1;     if (runDirection ==PdfWriter.RUN_DIRECTION_RTL)    

[iText-questions] PdfAWriter and iTextSharp

2012-08-18 Thread Vahid Nasiri
Hello, Is there any equivalent of PdfAWriter class for iTextSharp as described in this sample? http://www.itextpdf.com/examples/iia.php?id=226 -- Live Security Virtual Conference Exclusive live event will cover all the wa

[iText-questions] HTMLWorker

2012-08-13 Thread Vahid Nasiri
Hello, There are a lot of confusions about HTMLWorker class of iTextSharp. Many people are creating new libraries out of it and they don't know: - It's obsolete - It won't be maintained (correct me if I'm wrong) - It's replaced with xml worker. So its better to use the Obsolete attribute and ma

[iText-questions] PDFA1A & PDFA1B

2012-08-12 Thread Vahid Nasiri
Hello, It seems PDFA1A & PDFA1B constants are removed from the latest iText/Sharp. Is there any sample about these new changes? Thanks for your time. -- Live Security Virtual Conference Exclusive live event will cover al

[iText-questions] (no subject)

2012-07-30 Thread Vahid Nasiri
Hello, I have updated a working solution (iTextSharp) to the latest svn and now I'm getting this exception:   "Destination array is not long enough to copy all the items in the collection. Check array index and length." Here in TtfUnicodeWriter class on line 22:   int[][] metrics = new int[0][]; li

Re: [iText-questions] Font subsets document

2012-02-11 Thread Vahid Nasiri
Hello, MS-Word uses "Font Fallback" mechanism to show "missing glyphs" of your selected font. more info: http://msdn.microsoft.com/en-us/goglobal/bb688134 iText/Sharp has the same capability which is defined in FontSelector class. Here you can define your "Font Substitution" strategy and then cal

Re: [iText-questions] PdfShading.SimpleAxial in a landscape page

2012-02-10 Thread Vahid Nasiri
ew Document(pageRect)) //... From: Leonard Rosenthol To: Vahid Nasiri ; Post all your questions about iText here Sent: Friday, February 10, 2012 4:13 PM Subject: Re: [iText-questions] PdfShading.SimpleAxial in a landscape page This is as defined in the PDF spec.   You need to “u

[iText-questions] PdfShading.SimpleAxial in a landscape page

2012-02-09 Thread Vahid Nasiri
Hello, If I use PageSize.A4.Rotate() as the page size, It rotates PdfShading.SimpleAxial too. For example   public void CellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) {    //...     var shading = PdfShading.SimpleAxial(     cb.PdfWri

[iText-questions] FontSelector.Process method drops none visible Unicode chars.

2012-02-08 Thread Vahid Nasiri
Hello, Suppose I have a string like: string txt = "1\u202B/\u202C2\u202B/\u202C3";   If I use FontSelector.Process method, all of the none visible characters of txt will be dropped, because those are not available in any fonts (font.BaseFont.CharExists is always false here), but I need them for som

Re: [iText-questions] Concatenating pdfs with owner password

2012-01-26 Thread Vahid Nasiri
Hi, Try PdfReader.unethicalreading = true; From: Idar Borlaug To: itext-questions@lists.sourceforge.net Sent: Thursday, January 26, 2012 12:51 PM Subject: [iText-questions] Concatenating pdfs with owner password Hi I have an application thats been concatenat

Re: [iText-questions] PDF Comparison

2012-01-23 Thread Vahid Nasiri
Hi, Try itextrups: http://sourceforge.net/projects/itextrups/ From: jfitextnoob To: itext-questions@lists.sourceforge.net Sent: Monday, January 23, 2012 8:42 AM Subject: [iText-questions] PDF Comparison I need to create a tool to test the differences betwee

Re: [iText-questions] form filling with password protected pdf documents

2012-01-09 Thread Vahid Nasiri
Hi, Try PdfReader.unethicalreading = true; From: Edward Cooke To: "itext-questions@lists.sourceforge.net" Sent: Monday, January 9, 2012 6:01 AM Subject: [iText-questions] form filling with password protected pdf documents Hi, I’m trying to fill a secur

[iText-questions] Unit tests

2012-01-06 Thread Vahid Nasiri
Hello, Is it possible to write unit tests for programs based on the iText or iTextSharp? If yes, what should be tested? because the result is a binary file and it's a highly visual medium... Are there any samples available about this subject? Thanks for your time. -

Re: [iText-questions] CPU Utilization Problem

2011-12-29 Thread Vahid Nasiri
Hi, If you are using IIS7, you can limit the max CPU usage per application pool: http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/cpu From: Keith O To: Post all your questions about iText here Sent: Thursday, December 29, 2011

Re: [iText-questions] Fwd: Re: XMLWorker & RTL

2011-12-12 Thread Vahid Nasiri
directionality strength of the characters. However, this is something that should be explicitly coded in the CSS as Balder suggested, as it also involves specific fonts and encoding.   Paulo - Original Message ----- >From: Vahid Nasiri >To: Post all your questions about iText he

Re: [iText-questions] Fwd: Re: XMLWorker & RTL

2011-12-12 Thread Vahid Nasiri
; RTL There's a confusion between run direction and bidi processing with Arabic shapping. RUN_DIRECTION_RTL and RUN_DIRECTION_LTR will show Arabic (and Latin) correctly but the former will start the text from the right and the latter from the left. The text will be correct in both cases

Re: [iText-questions] Fwd: Re: XMLWorker & RTL

2011-12-10 Thread Vahid Nasiri
a, that's right. Thanks for the idea ps: please don't hijack other threads, write a new message for a new topic, I almost mist this mail. On 8/12/2011 22:34, Vahid Nasiri wrote: Hello, >In iTextSharp.tool.xml.css.apply.ChunkCssApplier class, String encoding is >hardcoded to Ba

[iText-questions] XMLWorker & RTL

2011-12-08 Thread Vahid Nasiri
Hello, In iTextSharp.tool.xml.css.apply.ChunkCssApplier class, String encoding is hardcoded to BaseFont.CP1252. It's easy to detect right to left languages data:       static readonly Regex MatchArabicHebrew = new Regex(@"[\u0600-\u06FF,\u0590-\u05FF]+", RegexOptions.IgnoreCase | RegexOptions.

Re: [iText-questions] iTextSharp default FilterHandlers

2011-11-25 Thread Vahid Nasiri
Paulo > > From: Vahid Nasiri [mailto:vahid_nas...@yahoo.com] >Sent: Friday, November 25, 2011 2:30 PM >To: itext-questions@lists.sourceforge.net >Subject: [iText-questions] iTextSharp default FilterHandlers > > >Hello, >In FilterHandlers class we

[iText-questions] iTextSharp default FilterHandlers

2011-11-25 Thread Vahid Nasiri
Hello, In FilterHandlers class we have   static FilterHandlers() {     Dictionary map = new Dictionary();         map[PdfName.FLATEDECODE] = new Filter_FLATEDECODE();     map[PdfName.FL] = new Filter_FLATEDECODE();     map[PdfName.ASCIIHEXDECODE] = new Filte

[iText-questions] PdfReader

2011-11-11 Thread Vahid Nasiri
Hello, Please add this new overload to PdfReader class as well. public PdfReader(Stream isp, X509Certificate certificate, ICipherParameters certificateKey)   Thanks.-- RSA(R) Conference 2012 Save $700 by Nov 18 Register no

Re: [iText-questions] HTMLWorker and arabic direction RTL

2011-11-02 Thread Vahid Nasiri
Hello, This should fix that issue:         foreach (var htmlElement in parsedHtmlElements)     {     fixRunDirection(htmlElement);     pdfCell.AddElement(htmlElement);     } ...     private static void fixRunDirection(IElement htmlElement)     {   

Re: [iText-questions] iText - Dynamic Table + Footer

2011-10-14 Thread Vahid Nasiri
This is a bug. setting the bottom margin won't help. From: Mark Storer To: Post all your questions about iText here Sent: Friday, October 14, 2011 8:14 PM Subject: Re: [iText-questions] iText - Dynamic Table + Footer Use a bottom margin to protect your page

[iText-questions] drawing a checkmark

2011-10-12 Thread Vahid Nasiri
Hello, I am using iTextSharp and I want to draw (move) and fit (scale) the following checkmark inside an arbitrary Rectangle with a given with & height anywhere in the page. Is it possible?       class Program     {     static void Main(string[] args)     {     using (var pdfDoc =

[iText-questions] FooterRows and HeaderRows

2011-09-23 Thread Vahid Nasiri
Hello, If I set the FooterRows and HeaderRows of a table and then after rendering of that table, when I add a new table to the pdfDoc, it will start at FooterRow (it will hide the auto generated footer row of the previous table). It seems FooterRow height is not considered at all. (sample-1 bel

Re: [iText-questions] limited fonts

2011-09-12 Thread Vahid Nasiri
ur questions about iText here >Subject: Re: [iText-questions] limited fonts > > >FontSelector >- Original Message - >>From: Mark Storer >>To: Vahid Nasiri ; Post all your questions about iText here >>Sent: Monday, September 12, 2011 11:30 PM >>Subje

[iText-questions] limited fonts

2011-09-12 Thread Vahid Nasiri
Hello, I have a custom font which supports a very few characters such as A, B and C. If I set and use this font, It will not print the D part of ABCD, which seems correct but is it possible, like browsers, force iText lib to switch to a default font and print that D char too. I need this function