I am creating PDFs using headless chrome, but I have a need to insert bookmarks. Is there any markup I can add to the html that Chrome would interpret into a PDF bookmark?
Thus far I've tried:
<link title="foo" rel="bookmark">Foo</link> <!-- in both the body and head tags -->
<link title="foo" rel="bookmark"/> <!-- empty link tag -->
<a name="foo">Foo</a> <!-- obsolete name attribute -->
Foo <!-- link to a internal id -->
Foo <!-- two above combined -->
Foo <!-- from https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types -->
This is not currently possible in Chrome. See Chrome Issue 781797 and Skia Issue 7532 on which it depends.
My current workaround is to use wkhtmltopdf which generates bookmarks from headings.
We have a sample site which has a basic template and a page level component.
In its head.html we have included the context hub which is not reflecting on the page. The code snippet for head.html of our sample site as shown below:
<head>
<sly data-sly-resource="${ # path = 'contexthub' , resourceType='libs/granite/contexthub/components/contexthub'}"></sly>
<title>${head.title}</title>
</head>
As per my understanding, To enable the ContextHub features we need to include contexthub component in the head section of our page level component. I am still unable to see the contexthub component on my page. Please correct if am missing any step in implementing the same.
Try this:
<head>
<meta data-sly-resource="${'./config' #resourceType='cq/personalization/components/clientcontext_optimized/config'}" data-sly-unwrap></meta>
<meta data-sly-resource="${'./contexthub' #resourceType='granite/contexthub/components/contexthub'}" data-sly-unwrap></meta>
<title>${head.title}</title>
</head>
I have to create something similar to a Facebook 'Like' button. My client would link to some custom javascript and they would put a custom dom element on their page for whatever functionality.
<head>
<script src="www.domain.com/client1.js"></script>
</head>
<body>
<my-element></my-element>
</body>
I think aot would be perfect for this scenario. Would that be a good assessment?
client1.js would be my bundled ng2 files. But what about compatibility? Will this work in all evergreen browsers? What if client1 also has ng2 files linked to their webpage?
I have a github webpage. How do I make a page displaying purely a pdf? I.e my cv?
To clarify, I wish the page to be filled only with the pdf - not any headings etc.
Just commit your pdf into your repo and it will be accessible just like any other file.
For instance, my resume is committed to my repo at https://github.com/xiongchiamiov/xiongchiamiov.github.com/blob/master/about/resume.pdf and is available on the web at https://changedmy.name/about/resume.pdf (I have a CNAME set up for changedmy.name).
Rather than redirecting to the PDF, you could embed it using an iframe or something like https://github.com/mozilla/pdf.js.
This way, the PDF will be accessible within the page and you could prevent it from being downloaded without viewing it in the browser.
It's not possible to make the page display "purely" the pdf, as to do that, you would need to alter the response headers, which obviously isn't possible with github pages.
You could have a JS redirect in your index.html that points to a pdf file that's also in your github-pages repo.
Suppose your file structure is like this:-
index.html
- cv(folder)
-----cv.pdf (your cv)
Then your code should look like this.
<html>
<body>
</body>
<script type="text/javascript">
document.location = "robin.github.io/cv/cv.pdf"
</script>
</html>
You can also do this:
<html lang="fr">
<head>
<!-- note the meta tag -->
<meta http-equiv="refresh" content="0; url=http://yourprofile.github.io/cv.pdf" />
<meta charset="utf-8">
<title>Will CV</title>
</head>
<body>
</body>
</html>
See Redirect from an HTML page for more info.
Github is using PDF.js to display PDFs, e.g. https://github.com/mozilla/pdf.js/blob/master/web/compressed.tracemonkey-pldi-09.pdf , you may find iframe with URL you can use to embed your resume (e.g. https://render.githubusercontent.com/view/pdf?commit=b261203018f847c89e05bb4c03c820fad0c90672&enc_url=68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f6d6f7a696c6c612f7064662e6a732f623236313230333031386638343763383965303562623463303363383230666164306339303637322f7765622f636f6d707265737365642e74726163656d6f6e6b65792d706c64692d30392e706466&nwo=mozilla%2Fpdf.js&path=web%2Fcompressed.tracemonkey-pldi-09.pdf&repository_id=1663468#13eff6e4-ecdb-4fe1-85e4-b7a468697e26)
I have a bunch of pages with the following structure:
<html>
<body>
<div id="summary">
</div>
<div id="promotions">
</div>
</body>
</html>
I want these pages to be accessible by both:
/items/one
/items/two
/items/three
And:
/promotional-offers/2014/february/one
/promotional-offers/2014/february/two
/promotional-offers/2014/february/three
/items/... should just open the page. /promotional-offers/2014/february/... should open the page /items/... and go to the anchor #promotions (scroll down to the appropriate div).
/items/one/#promotions
/items/two/#promotions
/items/three/#promotions
I'm not sure though how to set up rewrite rules in web.config to help search engines with indexing my pages and avoid having 'duplicate content'.
I would add a Canonical tag to completely avoid duplicate content, so It won't matter from which page you are showing the same content.
<!--url /promotional-offers/2014/february/one-->
<link rel="canonical" href="http://www.example.com/items/one" />