|
Rank: Newbie Groups: Member
Joined: 2/15/2014 Posts: 5
|
we are using eo pdf for PDF conversion in asp.net but we are facing broken PDF problem as sometimes its generates pdf in chunks where one page is converted into many pages as one fieldset resides on one page second on the second page and so on. Also its behavior is inconsistent because if we again generate pdf for the same page it will generate perfect pdf. Please look in to this matter as its very urgent. Waiting for your prompt response. below is the code for PDF generation.
Code: C#
protected void ASPXToPDF1_AfterRender(object sender, EventArgs e)
{
try
{
new utility().Save_Document((HtmlToPdfResult)ASPXToPDF1.Result, "CPV.PDF", application_number);
}
catch (CustomException) { }
catch (Exception ex)
{
throw new CustomException("ASPXToPDF1_AfterRender", "", ex);
}
}
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
We can't tell you anything when pretty much the only thing you are telling us is "something sometimes is broken". You have to tell us how it breaks. Do you get an invalid file? Do you get an exception? What's the exception error? etc.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/15/2014 Posts: 5
|
We are not getting any error nor an exception on pdf generation. We want to share sample files with you where you can clearly see for the same page once it generates broken pdf and when you try to generate pdf again it will generate the perfect pdf. For detailed clarification please provide me your id or is there any way to send you an attachment as its very urgent and we want to resolve it as soon as possible, Thank you.
|
|
Rank: Newbie Groups: Member
Joined: 2/15/2014 Posts: 5
|
|
|
Rank: Newbie Groups: Member
Joined: 2/15/2014 Posts: 5
|
Hi, thanks for you reply. the problem is i myself have no clue what's going wrong. i get a valid pdf, there is nothing wrong with that pdf.i can open and view it but its not in the desired format. when i generate it again (without making any changes in the code) i get the perfect pdf in the desired format. i have both those pdfs (perfect and broken) which i can share with you. please let me know how can i share those pdfs. May be that will give you some clue in identifying the root cause and what else i need to share with you ? thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
You may want to ask someone who has more experience to help you to analyze the problem first. To start, you must be very specific on how it is broken, why do you say it is not in the desired format? Is there an area in your PDF file that is red but it should be blue? Is the font wrong? Is a picture missing? Is there a link not working? You can not go to a doctor and just tell a doctor that you are sick and hope he/she can fix you up. You have to be able to describe the problem first. We are not in a position to check 1000 items with you just because you say something is wrong without any details. Our product is for programmers, so you have to have basic programming skills first, that means first you have to be able to precisely describe the problem. You also have to be able to follow our instructions. For example, if we tell you to check your CSS file, do you know how to verify whether it's working or not? If you do not know, then you have to ask someone around you to help you on that because we are not in a position to guide you on those generic programming issues.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 2/15/2014 Posts: 5
|
hi, i asked you if you can upload image/pdf on your support website but i did not get the answer for that instead you gave me a lecture on how i should post my questions. i know how to investigate the issues and then try to resolve them. i have already tried my level best but when i could not figure out i posted the question here. OK lets take a fresh start.
I have lets say five field sets with 8-10 textbox controls on my aspx page. when i convert it using your generic code it converts it to PDF (one pager) most of time but fewer times it creates five pages PDF with each fieldset on a new page. I don't get any error message nor any exception through which i can figure out what exactly is the problem.
i also tried to search it on your support forum but could not find any thing similar to this.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, We were not trying to give you a lecture. We were trying to tell you that you need to provide a very specific description of the problem first. I apologize that if you feel that we were lecturing you. However based on the new information you provided we can help you a little bit further ---- that is our goal. We can't help if you don't tell us anything. We do not just take your images/PDF files and try to guess what's wrong with your file either. In your case, what if you indeed have special code that tries to divide the output into five pages? That's why in all cases, you have to start with a very clear description first. We pointed this out to you in our very first reply and you still didn't provide any details, that's why we went a step further to explain what you need to do. As a general rule, we do not debug our customer's code. What we do is we tell them what to check and explain to them how various options work. That's why you can not tell us hey something is not working, here are the "wrong" file, please take a look and tell us how to fix it. As to paging, there are two things involved: automatic paging and manual paging. Automatic paging is affected by your HTML content width. For example, if the paper is 1000 pixels wide and 1500 pixels high and your HTML is 2000 pixels by 2000 pixels, then in order for the HTML to fit into the paper horizontally, the output has to be scaled by a scale factor of 0.5, thus the rendered result will be 1000 pixels by 1000 on the paper. As a result, the output fits on a single page. However, if your HTML is 1000 pixels wide and 2000 pixels high, then it's not necessary to apply the scale factor. In this case, the output size will be 1000 pixels wide and 2000 pixels high. Now the HTML won't fit in one paper because the paper is only 1500 pixels high. In this case an automatic paging occurs. In addition to automatic paging, you can also have manual paging settings. See here for more details about manual paging: http://www.essentialobjects.com/doc/4/htmltopdf/paging.aspxThe manual "page-inside:avoid" CSS attribute can also trigger automatic paging. For example, if your paper is 1000 by 1000 and you have two paragraphs in your HTML, the first one is 800 pixel high and the second one is 300 pixel high. If you do not have "page-inside:avoid" on the second paragraph, then the second paragraph will be split: 200 pixels on the first page and the remaining 100 pixels on the second page. However if you have "page-inside:avoid" on the second paragraph, then the whole second paragraph will be moved to the second page in order to keep it together (because the whole paragraph won't fit on the first page since the first page only has 200 pixels left and but the paragraph is 300 pixels). There are other things too but these are the basics. As you can see, many things can affect how paging occurs. You can check those to see which one is causing the output to be different for you. Once you find out the root cause, you can then set out to resolve it in whatever way acceptable for your business scenario. Hope this helps. Thanks!
|
|