We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Incorrect PDF being generated

I am using the nuget package of DocToPDF and am having trouble in generating PDF. My PDF is mainly consist of a single table with 2 columns, one being the label and the other being the value. While the labels are usually rather short but the value could be rather huge in size (e.g. an articl spanned across 2 or more pages). When the column comes to an end of a page, some text would be cut (and lost), e.g.

It seems that the layout of the text was incorrect while the cell itself might be fine since I could see a lot of unused white space at the end (on other page), e.g.

BTW the generated PDF could be viewed via my default viewer PDF-XChange while it would not load in Acrobat:

5 Replies

SK Sathish K Syncfusion Team July 13, 2015 05:52 AM UTC

Hi William,

Thank you for your interest in Syncfusion products.

Could you please provide us your input document along with the code snippet to reproduce the reported issues? Thereby we will analyse further on the reported issues and provide proper solution.

Please let us know if you have any other questions.


RJ Rilfanayasmin Jamal Nasar Syncfusion Team July 13, 2015 09:43 AM UTC

From: William Wong [mailto:wpywong@hku.hk]
Sent: Monday, July 13, 2015 5:11 AM
To: Syncfusion Support
Subject: RE: Syncfusion support community forum 119580, Incorrect PDF being generated, has been updated.

Dear Sathish,

I found that the incorrect layout of text was due to a special case of using “rowspan=1” in a pdf table. The table I am using has only 2 columns, i.e. a label column and a value column, since a label could be associated with a list of values, I have included rowspan in the label column. It was my own laziness in leaving rowspan of 1 even for a label of a single value (a huge text in this case) which caused the PDF component to behave incorrectly at that particular row. Once removed the unnecessary rowspan the PDF seems to be ok in PDF-XChange. However Acrobat still reports the file as corrupted. Attached please find a sample file produced by Syncfusion PDF which could not be opened using Acrobat. Hope that it could assist you in locating the issue.
Attachment : test
Best regards,



SK Sathish K Syncfusion Team July 14, 2015 08:48 AM UTC

Hi William,

Thank you for your update.

In the given attachment, we are able to see the corruption with the given Pdf document. In order to locate the issue in this document, we need the exact replication procedure to reproduce the issue. As requested earlier, kindly provide us your input document along with the code snippet to reproduce the issue. It will help us to investigate further on the exact cause of the issue, thereby we will provide you proper solution with minimal follow ups.

Please let us know if you have any other questions.


WW William Wong July 14, 2015 10:09 AM UTC

HI, by the help of a free online pdf validation tool, I am able to get the list of warnings from the pdf file. One of the issue is about data exists after the end of file mark, which is exactly the cause of the error. I have confirmed that it was my bad in generating the pdf file since I was using the GetBuffer method of MemoryStream in generating the pdf file inside a controller in the hope of saving memory/CPU. However GetBuffer has a side effect of including allocated unused bytes which are causing the trouble. Once I turned to the ToArray method everything works as expected. Sorry for causing all the troubles.

Also I would like to know if it is possible to reset the cell padding/spacing for a particular cell in a PDFGrid? I would like to embed a sub grid to a cell and with the padding/spacing in the parent grid the output looks strange.

AS Abirami Selvan Syncfusion Team July 15, 2015 07:51 AM UTC

Hi William,
We consider “Need to set cell padding/spacing for particular cell in PdfGrid” as a feature request and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.



Live Chat Icon For mobile
Up arrow icon