Appending header and footer to pdf add on in Plone - plone

I am using the aws.pdfbook add on in plone. This add on uses htmldoc and converts a page to pdf which can be printed or downloaded. I would like to append a header and a footer to the pdf-ed content. How can i do this?. I am fairly new to plone and do not know where the code for add ons is stored. I would also be grateful if anyone can give me the code to append a header and a footer to the pdf. I am using plone 4.2 on a linux box.Thanks.

Fixed. This is quite straightforward. Go to ZMI> portal_view_customizations> printlayout (aws.pdfbook.interfaces.IAWSPDFBOOKLayer) and add the header in tag.

Well, you could actually check the HTMLDOC documentation yourself.
Headers and Footers are configurable using HTML comments.
Since aws.pdfbook uses custom templates per content-types
https://svn.plone.org/svn/collective/aws.pdfbook/trunk/aws/pdfbook/browser/templates/
you should be able to customize the related template by using z3c.jbot inside your own policy package in order to override one of these templates.

Related

How can i use same header and footer in every reportviewer?

I am developing an ASP.NET application and i need to create a lot of report with same header and footer "skeleton". There is a way to create a custom component to solve this?
It is easier to make one Report with coresponding header/footer and then use it a s template. I have few of those. When I need new report, I just open Template and then use "Save As" and name it as I like.

Add html to drupal 6 page

I am trying to add html to the bottom of all the pages of a drupal 6 site.
I tried following Adding HTML to Drupal closure? but I'm not familiar enough with drupal to follow it.
The code is a google remarketing code, so I can't use drupal_add_js because the code I have already has script tags and , and the drupal_add_js wraps everything in tags.
hook_footer seems to be the best solution but I can't figure out how to use it.
Thanks
The best solution is to use hook_footer().
You have to create a Drupal module. I think this link might help you: https://drupal.org/developing/modules/7
Basically you have to create a module an implementes hook_footer(). In here you can add your custom html.
But there are another ways to do it. For example you can edit your theme. Find the page.tpl.php file in your theme and add, in the footer, the content. It's appears in all pages.
Another option is to create a block with full html filter, and add your html.
Regards.
I ended up putting the html i needed in $vars["closure"]

Creating custom layouts for Images in page content TYPO3 6

Typo3 provides option to add multiple images to a page content, but all the images are wrapped under some default <div> tags. I want these images to be wrapped under <ul> and <li> tags instead and giving my own custom CSS ids and classes to it.
There are not many resources on TYPO3 for me to approach this issue. Can TYPO3 allow to use custom tags for the page content elements?
UPDATE
From Jost's answer was able to get my images displayed, but how do I split the image details?
My each image will have title, alt-text, image-path and image-link. Now, using TypoScript how do I retrieve this, because each details has to go in separate tags.
Check the TypoScript object browser. There you will find the object tt_content, which contains the rendering definitions for content elements. The rendering definition for images is found at tt_content.image.20, for example
tt_content.image.20.imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap" style="width:{register:totalwidth}px;"> | </div>
The default definitions given there are usually provided by the static TypoScript of CSS-styled-content. You can overwrite them in your own TS, but when updating to a newer TYPO3-version, the default template may change, which could result in additional wrappers.
Update
Most content rendering in TYPO3 is defined in the TypoScript object tt_content. You can browse all TS-objects that will be used on a page by selecting the "Template" module and the page in question, and then choose "TypoScript Object Browser" in the selectbox at the top of the window. To understand what that stuff means, knowledge of TypoScript is necessary (Tutorial, Reference).
You can add your own TypoScript, which may override existing settings. You can do that in the Template-module too, but usually this is done by creating a file containing the script somewhere in the fileadmin folder and including it from the Template module.
The above enables you to edit the markup of the page. (Additional) CSS is usually defined in external files, that are included by a PAGE object (see the reference about that).
This post is a bit older but I want to add the following:
If you want to understand how the different content elements are wrapped, you may have a look into the css_styled_content extension. I assume that you have included the "Static Template (from extension)" in your main Typoscript template.
You can find the setup.txt here:
typo3/sysext/css_styled_content/static/setup.txt
There you´ll find the line Jost mentioned in line 860 (TYPO3 version 6.1), for example. And of course a lot of other definitions, too.
But check to read the documentation and tutorials on typo3.org.
HTH
merzilla

How not to inherit format when pasting into CKEditor?

Problem: When a user copies a load of code from another website and pastes it into CKEditor it includes a load of inline styles which refer to the style of the content on the website it was copied from. When the pasted content is then saved and shown on my website it doesn't use my styles but the copied inline ones which conflict.
I've had a look through the CKEditor documentation, and to be honest I don't find the documentation to narrow down to what I'm looking for. There is a paste function available which removes formatting but this is an optional button in the menu, whereas most users will just post into the main large area, so its pretty worthless.
Main Question: is there a way to set CKEditor to strip formatting when pasting?
Ah, I found the answer:
// Apply editor instance settings.
CKEDITOR.config.forcePasteAsPlainText = true;

How to disable header on frontpage of rst2pdf document?

I am generating some PDF's and I would like to disable the header on the frontpage. I know there are built-in templates in rst2pdf and one template is called coverPage but I don't seem to be able to get it to work.
The manual is saying you should use a
..raw:: pdf
PageBreak coverPage
statement but that will insert a empty before the coverpage, so how can I have a coverpage without a header and without using the oddeven directive (I want to use the same header on all remaining pages).
Thanks for your suggestions!
That's how you change the stylesheet after the cover page. You'll need to create a custom stylesheet that specifies what is the format of the first page and then change the style for the rest of document. Have a look at chapter 15 of the manual.
Note: current accepted answer contains broken link (linked website has gone).
The correct answer is simple:
1) In you style-file define:
pageSetup:
firstTemplate: coverPage
2) Then in your template, when you want to start using header/footer add:
..raw:: pdf
PageBreak cutePage
Make sure cutePage has set header/footer to true.

Resources