HtmlRenderer & PDFsharp add footer to each page - html

I am trying to put a copyright symbol at the bottom of each page when the PDF is generated but I cant seem to get it to work. How would I go about doing such a thing? I am using HtmlRenderer and PDFsharp, take my HTML body and convert it to a PDF file that the user can download.
I don't want to put a watermark over the top as it is a legal document for paying customers, I just wanted the little copyright symbol company name and date at the bottom.
Is there a way of saying to PDFsharp to use a say template PDF file that has a footer with the info at the bottom or is there a way of setting it in the physical code?

I Worked it out if you add styling position:fixed and then a top position because it doesnt understand bottom it will add a text to every page wherever you align it to.

If anyone would like more information on this I've linked a pull request which details the use of position: fixed to create header/footers.
There is also a class in the generator itself PdfGenerateConfig which will allow you to create corresponding margins in the document.
https://github.com/ArthurHub/HTML-Renderer/pull/41

I don't know if HtmlRenderer allows to add headers and footers that will be repeated on every page. HtmlRenderer is not part of PDFsharp.
With PDFsharp it is simple to open a document, loop through the pages and draw a string at the bottom of each page.
The Watermark sample can be used to get started - just remove the Transformation part and draw the text at the bottom of the page.
Similarly you can draw a PDF page (template) over each page of an existing PDF document.
A third option: Draw the text on an XForm and draw that XForm on each page. Overkill for a simple text string, but could reduce file size for a complex footer.
Watermark sample:
http://pdfsharp.net/wiki/Watermark-sample.ashx
XForms sample:
http://pdfsharp.net/wiki/XForms-sample.ashx

Related

How to make a clickable link in pdf footer using wkhtmltopdf?

We want to use links in the pdf footer. We utilize wkhtmltopdf tool to generate our pdfs.
wkhtmltopdf wrongly places the clickable area few millimeters above the link itself
When we use absolute links in the footer like https://google.com pdf viewers recognize the links and allow to click on it
But we would like to show custom text for our links like Terms and conditions and so on. As a possible workaround, we were trying to overlay our link text over a transparent link using absolute positioning (codepen). It works well for html but doesn't work for pdfs.
Do we have some other possible options to get around the issue?
We implemented a JS workaround where we duplicate footer content and move it down by 135px. So the footer replica is invisible to the end users but it provides clickable areas for the original footer. We could do it because we have constant top and bottom margins.

How can I import my html files into my Google Sites page?

The best I can do so far is to embed code from just one html file. On the preview page, I get a scrollable box taking up half the page that contains my desired output, surrounded by white space. Rather, I would prefer my page take up the entire page, if that makes any sense.
(In the end, I decided to create my site on Git Hub instead because it lets me directly post my HTML files.)

Identical HTML not rendering the same

I have a program that let's people design web pages graphically. Then hitting Publish creates an html file that is supposed to be an exact copy of what they created. The elements created by the editor are HTML elements. Publish then gathers up all the elements that have been created and for each one adds it to a string with
canvasOuterHTML += clone$[0].outerHTML;
So all the styles, text, etc., get put on the string. This string, along with some other information is written to the .html version of the page, and when this .html is loaded into a browser the browser displays the page!
But something is expanding the published page vertically. I've created the simple page below to illustrate. The first image is the page in the editor. The second image is what the html displays in the browser.
I'm completely stumped because the HTML and CSS for the two markups is exactly the same, so how can one be higher? I can't even think of a mechanism that would do that. Does anyone have any ideas? Thanks.

Convert rendered HTML 5 display (visible and invisible) to image when using HTML 5 canvas

Is there source code (or a browser plugin) to convert the contents of an HTML 5 web page to an image file? This would not just include the visible contents, but the hidden contents as well (assuming there were scroll bars in the page). If there isn't, any advice on how to approach this particular functionality would be appreciated, and I can look into it.
I found this...
html to jpg with c#
However...
I think they just had text in the page, so it doesn't have any dynamic images on the page. My page specifically uses the HTML 5 canvas functionality to draw images. So that must be part of the image file.
It looks like you should be able to do it using javascript with this technique:
http://www.html5canvastutorials.com/advanced/html5-canvas-save-drawing-as-an-image/
Make sure to take note of the following caveat however:
Note: The toDataURL() method requires that any images drawn onto the canvas are hosted on a web server with the same domain as the code executing it. If this condition is not met, a SECURITY_ERR exception is thrown.
EDIT: You may also want to check out these related questions:
Save HTML5 canvas contents, including dragged-upon images
How to save a HTML5 Canvas as Image on a server

Converting pptx file to html with links working

I have a pptx file, complete with working links which i would now like to convert to html. The idea really is to convert the pptx file into a website.
I am using Power Point 2010. I got some tips on how to do this conversion
# http://support.microsoft.com/kb/980553 and a tool which does exactly the same thing
# http://www.ultrashareware.com/Ultra-PPT-To-HTML-Converter.htm
I am able to get an html version,but the links do not work. Navigation is only possible by clicking the slide number created on the left pane of the created html frame.
My questions
1. How do i get the links on the html page to work as they did in the pptx
2. The main page is divided into 2 frames, the left showing the slide numbers. How do i get rid of the left frame entirely?
Thank you
Sameer
If you're interested in writing it yourself, it's a fairly substantial undertaking. The most direct method is to export an image of each slide and put that into the resulting HTML with an IMG tag. You'd also need to construct an image map and include in it each of the hyperlink URLs from the slide, along with coordinates normalized from PPT's slide size to the size of the image you're adding to the HTML. Or work out how to put links in DIVs atop the image.
If you're looking for an immediately available commercial add-in that gives you more control over the appearance of the HTML, I've written one. There's more info and a free demo at http://www.pptools.com/ppt2html/
I'd be happy to answer any questions you have about it, but it might be best not to clutter SO with support chat. There's a Contact link on each page of the pptools site; best to use that to get in touch, if you wish.