Welcome Guest Search | Active Topics | Sign In | Register

Manual Trigger of a Page view to PDF Conversion is not working Options
Vikram
Posted: Sunday, March 6, 2016 9:40:16 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

I am trying to convert a URL to a PDF. Everything is fine except the ajax results are not getting loaded. I have an MVC app with very generic structure where a single view is re-used across different views. Some of the javascripts are also re-used in different pages for extensibility. I have tried to call the eopdf.convert() from multiple places. It seems to work in some places and not work in some places. For instance, I set the trigger mode to manual and when I call the eopdf.convert() from the same page as the content, then the conversion is happening. However the ajax requests are executed after page load, the data is not coming. The ajax requests are hosted in another view where by its loaded into the parent view using the RenderPartial command.

Our code has a common ajax handler where by it knows when the page finished loading all the ajax requests. I tried adding the code in there also but no luck. I tried loading the trigger in the same view as the URL bring printed. It seems to work if there timeout length is 3 seconds, however 3 seconds is not enough for the ajax data to load. When I increase the timer upto 4 seconds, the page simple hangs there.

I have also tried to insert code dynamically into the page once the page is loaded and still the trigger is not firing. I am not sure what exactly I am doing incorrect. I'd appreciate any help you can provide.
eo_support
Posted: Monday, March 7, 2016 5:13:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

The converter wouldn't care about when you call eopdf.convert() or under what condition. It's a simple call that if you call the conversion starts and if you don't it doesn't. So I do not think how it is triggered would make a difference. As such the focus should still be whether it is called or not. You can use the debug console feature to help troubleshoot your code to find out why it is not called:

http://essentialobjects.com/doc/pdf/htmltopdf/js.aspx

Make sure you still use EO.Pdf 2015 when you use the debug console. Debug console is not yet supported in the 2016 release. This will be added in our next build.

Thanks!
Vikram
Posted: Monday, March 7, 2016 5:56:31 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

After some testing I found couple of things.

1. The EO.PDF convert is being called, however the ajax call on the view is simply showing an error and failing which is the reason why the grid ajax call is coming up empty.
2. I tried to make the ajax synchronous which hanged the whole conversion.
3. I am using EO.pdf version 6.0.36.2. I think its 2015 since we started using this product last year.

I have narrowed it down to an error in the ajax call, however there is no information as to what the error is about. The same call works fine when I run it on a chrome browser. But when I pass the view to the converter it simply fails to execute the ajax call.
eo_support
Posted: Monday, March 7, 2016 6:12:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You can try the latest build (the 2016 build on our download page) and see if it works for you. This build uses a much newer browser engine, so it can run "modern" web pages much better than EO.Pdf 2015 and earlier versions, which uses a much older browser engine.

As mentioned, the debug console feature is 2016 is still not working. This will work in our next build.

Thanks!
Vikram
Posted: Monday, March 7, 2016 6:44:15 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

To try the latest build 2016, should I download it from Nuget or run install from the package found on your server ?
eo_support
Posted: Monday, March 7, 2016 6:50:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You can do it either way. The main difference is the nuget package only contains DLL files, where as the installer from our download page also contains documentation and samples. If you are already familiar with our API, then you probably do not need the samples. You can also get the documentation online any time.

There are a couple of things you must keep in mind when you use the new version. One is that the DLLs are packaged differently in this version. See here for more details:

http://www.essentialobjects.com/doc/pdf/install/deploy.aspx

Another change is the root object name is changed from "eopdf" to "eoapi". The old name "eopdf" is still supported for now, but we may phase it out in future versions. See here for more information:

http://www.essentialobjects.com/doc/common/eo_js.aspx
http://www.essentialobjects.com/doc/pdf/htmltopdf/trigger.aspx

Please feel free to let us know if you still see any problems with the new version.

Thanks!
Vikram
Posted: Monday, March 7, 2016 8:33:30 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
I am getting two errors when I use the latest version.

1. Certificate error (It's probably because of the fact that I am running it under https with a invalid certificate).
2. Additional information: License 'XXX' is not valid for this build.

I am pretty sure the production was bought last year and we have a valid license. Is there a need for different license each year ?

eo_support
Posted: Tuesday, March 8, 2016 7:45:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Currently we do not allow invalid certificate. We will change our code to allow this in our next build.

As to the license, please try it WITHOUT applying your license key. We have looked into your order and you will need to renew your subscription in order to use this version. Each version uses a different license key but we provide free one year subscription along with your orders, which would usually give you license keys for some builds for the next version. You originally purchased EO.Pdf 2014 in 2014, so your subscription ended in 2015 and it does give you license key for some 2015 builds (builds made before your one year free subscription expires). To use 2015 builds made afterwards and newer 2016 builds, you will need to renew your subscription to current first. You can do this by logging into your account, then go to "My Orders" page, then click "Renew" under the "Subscription Status" column and then follow the screen instructions. Please see here for more information about subscription:

http://www.essentialobjects.com/PurchaseFAQ.aspx#sub

If you do not wish to renew, you can try to isolate your page into a small test project and send the test project to us, we will see if we can find out the root cause for it to fail in 2015. You can find more information on how to send test project to us here:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Vikram
Posted: Tuesday, March 8, 2016 5:57:07 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

Thank you for the response. I will test it out without giving the license and see how it works out. Also regarding the license renewal, I have forwarded the information to my lead.

Thanks!
Vikram
Posted: Wednesday, March 9, 2016 5:55:50 PM
Rank: Member
Groups: Member

Joined: 3/6/2016
Posts: 19
Hi

I was unable to try out the newer version without licensing. However I did some other testing. The controller action had the attribute [RenderAsPDF] and then after the options are set, calling MVCToPDF.RenderAsPDF() explicitly is causing the ajax call to fail. I am not sure why that seems to be the case.

If the attribute is present then we don't need to use the call ?
eo_support
Posted: Saturday, March 12, 2016 9:19:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You need to call MVCToPDF.RenderAsPDF only if you have [RenderAsPDF(AutoConvert=false)]. By default AutoConvert is true so you do not need to call RenderAsPDF. It can cause an error if AutoConvert is true and the conversion has already completed at the time when you explicitly call RenderAsPDF().

You will also want to update to the latest build (2016.0.21.0) from our download page. This build fixed a number of issues.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.