Canalplan Forums

Discussions => Canalplan Site issues => Topic started by: Nigel on Dec 16, 2018, 12:55 PM

Title: Creating PDF
Post by: Nigel on Dec 16, 2018, 12:55 PM
I am trying to create a PDF file for a cruise but it freezes, the message on the screen is  \"sending map to PDF generator.
Can anyone help.
Title: Creating PDF
Post by: Shultzy on Dec 16, 2018, 05:09 PM
I've tried it and it created the PDF, although the \"sending map to PDF generator\" was on for 45 sec which could be normal.
Title: Creating PDF
Post by: Nigel on Dec 16, 2018, 10:06 PM
I have tried again but no joy, I am trying for get details for the \"Leicester Ring - clockwise; starting at Stretton Wharf\" over 14 days. I have used this site in the past with great success and hope that things can be sorted.
Title: Creating PDF
Post by: Nigel on Dec 17, 2018, 11:06 AM
As I said I have tried again without success, but my wife tried on her phone and hey presto it worked, so she  emailed the PDF to me and I now have it, still don't know why I can't do it on my computer I tried various cruises but all with the same result, I have also been able to do it on my own phone so the future looks good, shall have to work on the problem on the computer.
Cheers.
Title: Creating PDF
Post by: Shultzy on Dec 17, 2018, 04:21 PM
I'm using Firefox, but you might not. Can you try it on a different browser?
Title: Creating PDF
Post by: Stephen Atty on Dec 17, 2018, 05:08 PM
Which browser are you using?
Title: Creating PDF
Post by: Administrator on Dec 18, 2018, 07:28 AM
What happens here is that I've not been able to find a way to generate images from the new maps on the server, but I can on browsers.  So the software takes the maps from your route output, uploads them to the CanalPlan server and builds them into the PDFs.

Clearly a lot can go wrong there.  I think the problem must be that your browser can't cope with this (though as you can see, both your phones can).

If you can help me a bit here I can either fix the problem or at least put up a warning on systems where I can't get it to work.

Can you follow the instructions here and let me know which browser and version you are using:
http://www.bbc.co.uk/accessibility/guides/which_browser.shtml

Thanks!
Title: Creating PDF
Post by: Nigel on Dec 18, 2018, 02:55 PM
I was connecting to the web through IE (internet explorer).

Our phones use Google Crome, so I have installed this on my computer and tried again and it seems to work fine.

Although there does seem to be a problem in that the map produced in the itinerary is in landscape and when sent to the PDF generator it gets cut in half as the PDF pages are in portrait, this cuts of part of the cruise map, I have managed to overcome this by moving the required  map details to the left before sending to PDF generator, not sure how this would work if the cruise route was the full width of the map.
Title: Creating PDF
Post by: Nigel on Dec 18, 2018, 03:06 PM
Sorry I said IE it should have been ME Microsoft Edge.
Title: Creating PDF
Post by: Stephen Atty on Dec 18, 2018, 03:31 PM
OK browsers I'm seeing for Nigel are:

Mozilla/5.0 (Linux; Android 6.0.1; LG-M160) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Mobile Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763
Mozilla/5.0 (Windows NT 6.1; Trident/7.0; NP07; NP07; rv:11.0) like Gecko
Title: Creating PDF
Post by: Administrator on Dec 19, 2018, 07:20 AM
It looks like Edge, for some reason, doesn't properly do everything I need (the magic bit is canvas.toBlob()).  I've found some patch code that will fix that - hopefully at the weekend.

The second thing is something I'd not thought about - that the maps need to be a specific size to work in the PDF and yet I let people pick the size and shape they want the route maps to be.  I think I need to force itineraries to be on a specific map size.

Thanks very much for the feedback - I'll get onto both of these issues over the next few days - watch this space (as I may ask for some testing!).
Title: Creating PDF
Post by: Stephen Atty on Dec 19, 2018, 01:07 PM
Typical of Microsoft to miss something important. I can check it too if you need as I've got edge on my laptop if I reboot into Windows.

Not sure if the move by MS over to the Chrome rendering engine will make things better for support as I don't know if MS are going to abandon their Javascript engine as well.
Title: Creating PDF
Post by: Nigel on Dec 19, 2018, 08:43 PM
I am using both edge and chrome on my laptop as I am use to edge but shall use chrome for planning cruises, I only get out once a year on the cut for a two week holiday, but it is nice to be able to plan it with the help  of CanalPlanAC.
So if I can be of help I am willing. Thanks for your help, it is only by talking that we can improve that which we have.
Title: Creating PDF
Post by: Administrator on Dec 27, 2018, 03:01 PM
I've added some code that is supposed to allow Edge to do things properly, and I've wrapped the map in the PDF in some formatting so it should always fit nicely on the page.

Let me know if it works any better now!
Title: Creating PDF
Post by: Nigel on Dec 28, 2018, 10:52 PM
Just tried it in Edge and it produced the PDF fine, but the map was still cut in half so I had to adjust it to the left to get it on the page.
Title: Creating PDF
Post by: Administrator on Dec 29, 2018, 12:40 AM
OK - so that's the difficult one fixed!   \"Just\" the other to go...