Multiple HTML links to specific pages in PDF - html

I have created a sort of table of content in html that link to specific page into pdf using #page=n and it works fine if i have 1 link for 1 pdf.
The problem comes when i have multiple link to the same pdf.
ie:
href="001.pdf#page=10"
href="001.pdf#page=20"
href="001.pdf#page=30"
The first time it works fine and open the pdf at the right page, then if i use others link with the pdf opne, the page didn't change.
There is a workaround for this?
Thanks for the first answer. You right, i've forgot some informations.
The final output have to be cross-browsers.
This is my test code with random online pdf:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
link 001
link 002
link 003
link 004
link 005
<iframe style="height:800px; width:800px;" name="PDFcontent" src="http://www.naplesip.com/wp-content/uploads/2015/10/pdf-logo.png"></iframe>
</body>
</html>
I've tried to used it on jsfiddle but does not work. Instead it work on browsers (firefox/chrome/edge/ie).

There is not much background information about how you are opening the PDF, what browser you are using, and how you use the other links. I will answer as well as I can in a general way.
Opening PDFs into a desktop program might accept your page anchor tag and jump to the requested page upon opening a PDF, but opening the same document again (while it is still open) will result in the system simply switching your active application to the one with the PDF open.
If you first close the document, then open another page, I suspect it would work, unless settings in your PDF reader are remembering the previous page.
This behaviour is something you have little control over on your own computer, and no control over on anyone else's so you might have to come up with an alternative.

Related

Clicking href links to pdf pages sometimes takes you to the previous link you clicked (Edge)

We have a place where there are multiple href links that take you to different page numbers in the same PDF document, like so:
href="https://url.website.fake/files/2021-01/documents/a_pdf_file.pdf#page=39"
The tester reports that sometimes if they click on link A and then link B, where both links are like the one above but going to different page numbers, the second click will take you to the page number from the previous link.
I've been trying to reproduce but can never do it. The tester is able to reproduce fairly easily. Does this sound like anything anyone here has experienced? Tester has only been able to reproduce this in Edge. Thanks.
All browser users are different, so too may be their PDF extension, thus in this case seems they may not have adjusted their Edge viewer use to same as yours. Other browsers have different methods but effect can be the same. You need to educate users to change their browser security.
Check the second setting.
Most likely theirs is On and yours is Off
its included in how to handle site response such as the download to view.
Using a simple two page file attempting to swap href Sometimes (but not always) throws me a warning
so asking for page 1, I see page 2
if I switch it off and refresh I will see Page 1
For web secure use it is best set On, however for local personal use I tend to switch it Off. Most other users would possibly prefer it On to continue at the page where they last read up to.
My MWE which shows above behavior is
<html><head></head>
<body>
link A (page 2)<p>
link B (Page 1)
</body></html>
link A (page 2)
link B (Page 1)

Page shows code not rendering

I know this is simple question, but i am fighting with it for few hrs, so its better to ask in forum to get help quickly. I have added the following simple html snippet in a TextEdit program and saved the file as webpage(.html). When I run this file in any browser, like safari, chrome or firefox, it shows the same code there instead of rendering this as web page.
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Could someone help me to show this as real web page rather than source code showing?
If you have access to the server scripts creating the page, then check if somewhere the http headers are being changed by that code. The browser needs to receive a header like that
Content-Type: text/html
[example in PHP: header(Content-Type: text/html);]
in order to render html properly. If this header is changed, then the browser won't be able to interpret it as html.
It is likely that TextEdit has formatted your text, since by saving it as a Web Document it thinks that you have typed up the web page how you want it displayed, with all formatting, instead of raw HTML code. Try to save the document as raw text, then change the extension manually from whatever it is (probably .txt) to .html. For a more permanent solution, it is advisable to use a non-formatting text editor when coding.
EDIT: This is what Apple have to say: http://support.apple.com/kb/ta20406
The solution to your problem is simple.
Just open TextEdit and go to preferences.
Just tick the box which says"display html files as html code instead of formatted text".
Your problem will be solved. :)
You have saved the text you pasted in as HTML content, in the HTML editor. Instead, you should try to paste the text in the code view, not the editor view.
In case any of you have already created the file and not sure how to proceed, open the file in TextEdit. Go to Format -> Make plan text. Then save and close the file. Then open the file location in finder and rename to .html and this will convert the file appropriately.

Google Chrome Extension: Webpage in Popup

I'm new to creating extensions and I also don't know much about html but I have an idea for a chrome extension that should be pretty simple so if you give me a little help I may be able to do it.
I want a popup to open when the user clicks the extension-icon (like most extensions) and the popup is supposed to contain a webpage like "http://google.com". That's actually about it. I created the manifest file with the required data and thats fine, now I need to know how to make the html file contain the external webpage.
Another problem: when I tried different things in the html file the popup was tiny and just white.
I hope someone can give me hint. Thanks!
I have made an extension wich displays links to several websites.
My popup.html looks like this:
<!DOCTYPE html>
<html>
<body>
<p>
<a href="http://www.google.com" target="_blank>Google</a> <br/>
<a href="http://stackoverflow.com" target="_blank>StackOverflow</a> <br/>
</p>
</body>
</html>
The target="blank means it opens the site in a new tab
More information about html is found here:
http://www.w3schools.com/html/html_links.asp
Be sure to make the icon 19x19 pixels,and be sure to name it in the manifest.json file
with the filename extension for example
"browser_action":{
"default_icon":"iconname.png",
"default_popup":"popup.html"
}
You should be able to use an iframe tag within your popup. I do that many times to point the user a FAQ page hosted outside.

Viewing rendered HTML in IntelliJ IDEA 10

Is there any way to view an HTML file in IntelliJ fully rendered? I have a simple HTML file with a listing of links in a project. When I view the file I see this:
link 1
link 2
link 3
I would like to open the file in IntelliJ and have it show the rendered HTML instead:
link 1
link 2
link 3
This way I can avoid launching it in an external browser.
Short answer: No.
But, honestly, because one of the issues we all know about all-so-well is the (now) minor differences in browsers - it's best to test in all of the real browsers anyways.
This is why they give you this convenient little menu in the upper right of the document:
For HTML view in IDEA
move your mouse cursor to the upper right corner of the page, or type ALT+F2, you will see a small pop-up menu with the icons for various browsers. Click one to launch it in that browser. Configure the locations of the browser executables in File > Settings > IDE Settings > Web Browsers

HTML Email jump links not working

I've written a HTML Email using tables (:sad face:) and it displays perfectly while using Internet Explorer's Send -> Page by Email. My issue is that my jump links
Go to the jump link
no longer work, thye just open the complete URL of the page that I was sending. I've looked through the source of emails in which the jump links do work and I saw that the jumps links looked like this
Word generated jump link
I tried adding this but I'm still getting IE opening and it's now going to http:///
Any idea if there's any extra tags I need to add or another way to get around this?
Essentially, this is something that has to do with the way Microsoft deals with Internet Security. It is best practice to avoid named (jump) anchors in HTML email, unfortunately. However, to overcome this you might want to provide a link to a webpage with the HTML email on, which can of course have named anchors.
You can read more about best practices for email design on this article at Sitepoint. There is also a great resource for HTML email design at the Email Standards Project.
You can try this!!
In outlook -> new email->attach file->insert(select the html file here)->insert as text(dropdown on the insert)
Which will make the jump links work.
but the problem is all with the active links and visited link color. Doing this leave you no control over visited and active link colors.
You could create the email template as signature.
Open the tempalte in IE and click CTRL+A to copy the page.
Create a signature and Page the content as it is.
Create a New email and insert the Signature. The template will be loaded.
I had the same problem. When trying to send a html page using Internet Explorer's Send -> Page by Email, the anchor pointed to the url of the webpage instead of to the internal link in the mail.
This can be solved by adding this in the head of the page:
<base href="" />