|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi I consider buying EOPdf converter, but I try to convert page with right-to-left script and I get unhandled exception (Object reference not set to an instance of an object. )
How can I fix it? Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We do support right to left. Please check whether you are running the latest version (dll version number 3.0.84.2). There was a problem in early version that can cause Object reference not set to an instance of an object error but that has been fixed.
If you still see the error after updating to the new version, please try to create a small test page that can demonstrate the problem and send the test page to us. Once we have that we will investigate. As soon as we can see the problem here we should be able to find out the root cause.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
I will try it Thanks for the fast answer.
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi,
Now it create PDF greatly and with no alignment problem for live pages. but when I try to convert page in my ASP.Net MVC3 application (right-to-lift) label disappear Ex. try to insert ( رقم 4 و 100 بالمئة ) in the view.
can you please help me in this. Thanks,
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
And please note when I try it in ASP.Net web application it convert the data correctly maybe the problem from MVC rasor view engine.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
It should not have anything to do with MC view engine. The HTML to PDF converter converts HTML to PDF, it doesn't really care how your HTML is generated; Whether it's from ASP.NET, or ASP.NET MVC, or PHP, or static HTML, it's all the same to the converter.
I would recommend you to check your MVC page with Google Chrome and Safari browser and see if they render it correctly. Different browsers interpret certain things differently. Our result is most close to these two browsers. So if you see the same result in these two browsers, then you need to tweak your style/HTML to make it render correctly in the browser first.
If it renders fine in these two browsers but not in the PDF, then please create a minimum page to demonstrate the problem and send it to us. Let us know if you want to do that so that we can give you the email address.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi, I try it in Chrome and Safari and it render correctly. this is small page example
Code: HTML/ASPX
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<br />
<label>رقم 4 و 100 بالمئة</label>
the Arabic data disappear in the PDF file. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We tested your code and it works fine. Your server code that sets ViewBag.Title is something unrelated. So we removed that. Once we copy the rest into a static HTML file and it works fine.
Remember the HTML to PDF converter deals with HTML, not how your HTML is generated. So you can always verify whether the problem is on the converter side or in your server side (be it ASP.NET WebForm or MVC or whatever else) by saving the output as a static HTML file and then convert that HTML file. If the HTML file converts fine, then the converter works fine. Make sure you place the HTML file at the same location as your original .ASPX file. So for example, if your original Url is "http://www.anything.com/Page1.aspx", then the Url for the HTML file should be something like "http://www.anything.com/Page1.html". This ensures both having the same BaseUrl so that all your script/styles will be the same for both pages.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi, I find the HTML result like this
Code: HTML/ASPX
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<label>رقم 100 بالمئة</label>
</body>
</html>
when I delete the Css link the PDF result work correctly this just when the page have arabic data so I don't know where is the problem can you help me with this? Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Then it's obvious that it has to do with your CSS rules. Are you sure the same page works fine in Google Chrome browser?
Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi,
yes it render OK in chrome. and i try to empty CSS but it still not work.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can try to copy the contents of your CSS file into your HTML file as a CSS block, something like this:
Code: HTML/ASPX
<head>
<title></title>
<style rel="stylesheet" type="text/css">
...copy the content of your Site.css here....
</style>
</head>
....
Then try to delete the CSS rules block by block until you find out which CSS rule triggers the error. Once you find that out, post the HTML file with the CSS rule again and we will see if we can find anything. The goal is to have a single file (no external CSS files) to reproduce the problem first. Once we have that and see the problem, we will be able to tell you what's wrong. Thanks
|
|
Rank: Member Groups: Member
Joined: 10/31/2011 Posts: 10
|
Hi,
Now I find it, the problem in this tag
body { font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; }
thanks a lot for you'r help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Thanks for the additional information. We have posted a new build that should handle this scenario correctly. Please see your private message for the download location.
Thanks!
|
|