ubot.prin 0 Posted May 1, 2014 Report Share Posted May 1, 2014 Loading a pdf page gives a blank page. This loads in normal browser. Could any one please help with this? Quote Link to post Share on other sites
UBotDev 276 Posted May 1, 2014 Report Share Posted May 1, 2014 I guess it's still a bug: http://www.ubotstudio.com/forum/index.php?/topic/15735-is-ubot-4-or-5-capable-of-displaying-a-pdf-file/ Quote Link to post Share on other sites
drhum 3 Posted May 4, 2014 Report Share Posted May 4, 2014 Someone tried a work around here but no updates yet. I guess that was a no go. Quote Link to post Share on other sites
mk21 1 Posted May 20, 2014 Report Share Posted May 20, 2014 Have you tried to disable javascript? Quote Link to post Share on other sites
UBotDev 276 Posted May 20, 2014 Report Share Posted May 20, 2014 Have you tried to disable javascript?I don't think javascript has anything to do with this. I think that UBot browser tries to look for pdf viewer, but for some reason it doesn't work, that's why I think we get a blank page. Quote Link to post Share on other sites
Kev 69 Posted May 24, 2014 Report Share Posted May 24, 2014 I've looked at a similar thing before. What I ended up doing was taking a screenshot of a page and uploading it to an OCR website. Then it would email me the content of the text that appeared in the screenshot. Would this work as a temporary workaround? Quote Link to post Share on other sites
UBotDev 276 Posted May 24, 2014 Report Share Posted May 24, 2014 I've looked at a similar thing before. What I ended up doing was taking a screenshot of a page and uploading it to an OCR website. Then it would email me the content of the text that appeared in the screenshot. Would this work as a temporary workaround?I don't think it would, since page comes up blank so taking screenshot of blank page wouldn't take you far. Quote Link to post Share on other sites
Kev 69 Posted May 24, 2014 Report Share Posted May 24, 2014 Ahh sorry yeah! Blank page won't be much good in fairness! Idea: download the pdf then add it to google drive? Might be able to automate something from that perhaps? Quote Link to post Share on other sites
UBotDev 276 Posted May 24, 2014 Report Share Posted May 24, 2014 Ahh sorry yeah! Blank page won't be much good in fairness! Idea: download the pdf then add it to google drive? Might be able to automate something from that perhaps?If URL exists there is no problem downloading the PDF with UBot's download command, but if you don't have URL (URL generated on server side, and you get PDF served after redirect) you won't be able to download it, since after clicking the button it will auto load the page/pdf from a random URL and your screen will remain blank. Quote Link to post Share on other sites
Kev 69 Posted May 24, 2014 Report Share Posted May 24, 2014 If URL exists there is no problem downloading the PDF with UBot's download command, but if you don't have URL (URL generated on server side, and you get PDF served after redirect) you won't be able to download it, since after clicking the button it will auto load the page/pdf from a random URL and your screen will remain blank. Ok I got the dark screen by browsing in through ubot's browser. However, I have managed to get a pdf to load inside ubot's browser, albeit via a non-traditional method and not sure whether it will be what's required. Ultimately I think it will need to go to an OCR site or some such, but, the PDF does load, as images but it loads ALL the pages contained inside the PDF. Here's the code: ui text box("URL to PDF", #pdfurl) navigate(#pdfurl, "Wait") navigate("http://view.samurajdata.se/", "Wait") change attribute(<url field>, "value", "http://{#pdfurl}") click($element offset(<name="submit">, 0), "Left Click", "No") wait for element(<innertext="Viewer home">, "", "Appear") alert("PDF Loaded") Sample PDF: www.handysoftware.com/cpif/docs/CPIF-Lesson-04.pdf I've made the code so as you can simply add a PDF to the text box. It first Navigates to the pdf as normal so you'll see it load a dark page then it loads via that website. Quote Link to post Share on other sites
UBotDev 276 Posted May 24, 2014 Report Share Posted May 24, 2014 Ok I got the dark screen by browsing in through ubot's browser. However, I have managed to get a pdf to load inside ubot's browser, albeit via a non-traditional method and not sure whether it will be what's required. Ultimately I think it will need to go to an OCR site or some such, but, the PDF does load, as images but it loads ALL the pages contained inside the PDF. Here's the code: ui text box("URL to PDF", #pdfurl) navigate(#pdfurl, "Wait") navigate("http://view.samurajdata.se/", "Wait") change attribute(<url field>, "value", "http://{#pdfurl}") click($element offset(<name="submit">, 0), "Left Click", "No") wait for element(<innertext="Viewer home">, "", "Appear") alert("PDF Loaded") Sample PDF: www.handysoftware.com/cpif/docs/CPIF-Lesson-04.pdf I've made the code so as you can simply add a PDF to the text box. It first Navigates to the pdf as normal so you'll see it load a dark page then it loads via that website. Why wouldn't you just use "download file" when you have the url already? download file("http://www.handysoftware.com/cpif/docs/CPIF-Lesson-04.pdf", "c:\\downloaded.pdf") Again, the problem exists in case where you don't have/can't find PDF URL on the website, but instead the website loads PDF after redirect. The problem is that if you navigate to the URL again it won't show PDF anymore since it's generated dynamically... Quote Link to post Share on other sites
Kev 69 Posted May 24, 2014 Report Share Posted May 24, 2014 The OP couldn't load a pdf in the browser. Sure he could of downloaded it but my interpretation of the post was he needed it loaded in a browser. Download file seemed too obvious didn't it?! Quote Link to post Share on other sites
Kev 69 Posted May 24, 2014 Report Share Posted May 24, 2014 I have an invoicing system that does something similar to what you described about downloading the pdf file. I'll take a look on my end. I am sure a dialogue box will appear though but TJ has a plugin for that which will bring it to front if I recall. Quote Link to post Share on other sites
UBotDev 276 Posted May 24, 2014 Report Share Posted May 24, 2014 The OP couldn't load a pdf in the browser. Sure he could of downloaded it but my interpretation of the post was he needed it loaded in a browser. Download file seemed too obvious didn't it?!Ah, you are right...forgot what OP actually wanted to achieve. Nice workaround, although if he doesn't have URL (as described above) that also won't be possible. I think this is something UBot team would need to fix... Quote Link to post Share on other sites
UBotDev 276 Posted May 24, 2014 Report Share Posted May 24, 2014 I have an invoicing system that does something similar to what you described about downloading the pdf file. I'll take a look on my end. I am sure a dialogue box will appear though but TJ has a plugin for that which will bring it to front if I recall.I think I had problems a year ago when I tried to download PDF from Scribd.com. Instead of a download popup pdf got rendered blank and the URL didn't work when I tried to download PDF after it got displayed (URL was expired, so I would need to click download button again to generate a new one). So I'm just saying that if that happens he won't be even able to use the workaround you provided. Quote Link to post Share on other sites
ubot.prin 0 Posted May 30, 2014 Author Report Share Posted May 30, 2014 Thanks for your replies..I was trying to down load a file as pdf by a button click. Here, i don't get the url. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.