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.
Unfortunately, activation email could not send to your email. Please try again.

Incorrect PDF being generated

Thread ID:

Created:

Updated:

Platform:

Replies:

119580 Jul 10,2015 02:25 AM Jul 15,2015 03:51 AM ASP.NET MVC 5
loading
Tags: PDF
William Wong
Asked On July 10, 2015 02:25 AM

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:




Sathish K [Syncfusion]
Replied On July 13, 2015 01:52 AM

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.

Regards,
Sathish


Rilfanayasmin Jamal Nasar [Syncfusion]
Replied On July 13, 2015 05:43 AM

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,

William
 
 


 


Sathish K [Syncfusion]
Replied On July 14, 2015 04:48 AM

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.

Regards,
Sathish


William Wong
Replied On July 14, 2015 06:09 AM

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.

Abirami Selvan [Syncfusion]
Replied On July 15, 2015 03:51 AM

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.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,
Abirami.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;