PDF rendering only in presentation mode while using PDF.JS - javascript

I have been through with the provided documentation on PDF.js, I am able to render the buttons correctly, but there is something wrong, my pdf is not rendering and background of the page is also white.When I click on the presentation mode, pdf renders in the full page which is perfect. But not able to understand what possible be wrong with the render thing that it is not rendering on page load.
I am using
1.compatibility.js
2.l10n.js
3.pdf.js
4.debugger.js
5.viewer.js
6.metadata.js
7.bidi.js
The only warning which I got is
The provided value 'moz-chunked-arraybuffer' is not a valid enum value of type XMLHttpRequestResponseType.
I am currently not able to understand why most of the issues are still not solved,
Thanks in advance

Related

How to hide/not display PDF title in the toolbar

Is there any way to access metadata of PDF file I embedded using pdfobject.js? I would like to replace/change its title because it's not corresponding to its filename. example is the snip below. filename of that is 'D1000SPN.pdf' which is different from the title displaying.
I tried to search but found none. However, since I can't find a solution to that. I decided to just not display the PDF title on its toolbar anymore or hide it.
I'm a newbie so please bare with me.
sample image
Check the section https://pdfobject.com/#the-why
Specifically, where it says "What PDFObject doesn't do".
In a nutshell:
"PDFObject does not provide the ability to customize the look and feel of the PDF toolbar."
Why?
"PDFObject is not a rendering engine. PDFObject just writes an element to the page, and relies on the browser or browser plugins to render the PDF."
It continues elaborating...
"If you really need to customize the toolbar, try forking Mozilla's PDF.js and customizing it to suit your needs."
But maybe there is hope...
"Some of these browsers provide the ability to show or hide the toolbar, or a feature such as the search field, via PDF Open Parmeters".
See the image below:
I tried it on Chrome and worked for me.
Good luck.

(Moodle) I keep getting raw data when exporting .xlsx file containing HighCharts Images

This issue has baffled me, mainly because it makes no sense. I have some custom PHP code that I wrote on top of my LMS system (Moodle) to display some of its collected data in a HighCharts Table. What makes no sense is that I can almost GUARANTEE the code isn't broken because I checked older working versions of it and the same problem occurs. I never ran an update on Moodle in a long time so no known changes could have affected this.
Here are some weird things I found while troubleshooting:
Only this report is giving this issue.
Whenever I move this ENTIRE code to another PHP with a different name the issue doesn't occur.
Some more important details:
Uses the online version of highcharts.js scripts
The scripts I'm using are:
"https://code.highcharts.com/highcharts.js"
"https://code.highcharts.com/highcharts-more.js"
"https://code.highcharts.com/modules/exporting.js"
"https://code.highcharts.com/modules/export-data.js"
"https://code.highcharts.com/modules/accessibility.js
Please let me know if you've seen this issue before and what step you took to fix it. Also, I can't share the website this issue is on because the content password locked within my Organization.
CLICK HERE FOR IMAGE: This is what happens when I click the export button. The URL changes to something long and then outputs this.

Trying to see what options are pre-configured with another site's Ckeditor

So I basically have a rails app that is loading another full page in Ckeditor, but it's having a ton of issues trying to render the HTML. The styling is different, lots of text is being manipulated and swapped around, etc.
However, there's another app that uses ckeditor and the site renders just fine for it. I've tried hunting through the source code to see how the ckeditor is initialized, but the only thing I see is $("#html_editor").ckeditor(); which doesn't appear that any extra options are being loaded.
Just trying to find some other ways to determine why my ckeditor isn't displaying HTMl pages properly even though I'm initializing it the same way.
I've tried enabling the fullPage option, but it still looks extremely weird (things are completely misplaced), etc.
Looking for any suggestions.
Found it after hunting down a default config.js that contains default options when loading CKEditor

Can't find html table on source code of a website

I'm a member in a website and there's a huge (automatically generated) HTML table on this PHP page that is only available to me and I wanted the table source code because I want to copy it to a HTML page on my computer to then process it with a program.
The problem is that when I right-click to display the page source code it works. However, I'm tired of looking at the source code and inside all the linked JavaScript files. I can't seem to find the table or any data of it on the scripts/page source codes.
I can select the table data and copy it, but it is just the data. It doesn't say anything about flash, so I'm assuming it's not flash. The data of the scripts/pages isn't obfuscated, it's easily human-readable.
I used Google Chrome's 'inspect element' and it worked.
I was thinking on doing a PHP script that would import data from a similar table, but I will have to know more about a lot of stuff mentioned here.
What can I be doing wrong or what can cause this kind of behavior?
Two possible reasons could be that the table may be returned from an AJAX call to another page that returns the HTML for the table, or they could be generating the table's html code and contents on the fly from a list of values coming from javascript or some other source rather than serving the HTML output to you from the server side.
Something you can do to figure it out is see if there are any empty div or other html elements where the table appears to be inserted, and search their javascript files for references to those elements. That may shed some light on how they populate it.
Feel free to update your question with the raw html (where you don't see the table) and maybe some javascript and we can look. Use pastebin if it is a lot of content.
Would it help to use the Firefox plugin called Firebug?
Using this plugin you can click on an area of a page to see the code displayed in the Firebug section at the bottom of your window.
Here are the details: https://getfirebug.com/whatisfirebug
Maybe the table is generated with a JS script, if that's the case, doing right click and "View source" would not show you the html. You need to use something like Chrome's devtools. Open google chrome and visit that page, once there, right click the table and select "Inspect element", the devtools will open and then you'll see the table's code, right click it's opening tag and select "Copy as html".
Let me know if that works :)
Try a developer extension like http://getfirebug.com/ The underlying source code may not reflect output due to how much the DOM can be modified by javascript with extensive use of ajax. This plugin will permit you to view elements as they're interacting with the browser.
its probably that the table is dynamically generated on the fly so looking at the source code won't actually give you much. try looking at the "GENERATED" source code or inspecting the DOM using Firebug, or the Developer tools of chrome/safari.
Or better yet, try your hand at web scraping:
http://vancouverdata.blogspot.com/2011/02/how-to-web-scraping-xpath-html-google.html
Although I'm not sure if it'll work for pages that need a login. But hey, at least you learned something new :p

Convert my Xcode application to a webapp (to use tabbar)

I have made a basic tabbar view app in xcode but I need it to be a webapp as I will be viewing the data from a server so do not need/ want it on the app store.
I've looked at some other questions with this kind of topic and nothing is relevant. Also I've done plenty of googling and looking into other code plus using things like cubiq.org's slide-in menu.
I really want that tabbar look. I've tried to do this in HTML with images as buttons and using frames but (I think) because I'm using the JS code to stop the UIview from moving (to look more native) it seems that the buttons open the link in a new page, or switch to Safari, rather then open them in the same frame as they would in a regular browser.
Alternatively, does anyone know of a way I can implement a taskbar in a webapp?
Regards,
Eric.
Have you seen JQuery Mobile !?
It's awesome... but still in Beta.
They have precisely the toolbar you're looking for: JQuery Mobile Navbar
Without code, it's hard to pinpoint your problem exactly, but you should not be doing:
Text of Button
Because the above code will actually load a different page. Rather, you want:
<div class="some_button_type" onclick="doSomeAction()"><!-- ... --></div>
And that "doSomeAction()" function should use DOM manipulation to transform the current page to look like whatever you want it to look like (rather than navigating to some separate page).
P.S. I'm assuming you have some CSS styling based on class type, and you might want content in the DIV (for example, for the text of the button). I've also omitted some attributes (e.g. "role") that you want.

Categories

Resources