Set Reportlab generated PDF to open in SinglePage Layout? - django

I created a Django app in which I render a PDF by ReportLab. Everything works fine, so I am working on the refinements.
I think it is common knowledge, that the PDF specifications allow to open a document in a specific layout. I am especially looking for the PageLayout SinglePage. See page 140 in the Adobe PDF reference, version 1.7.
Is there such a functionality in ReportLab? I went through the document for the 3rd time, but I only found "2.6 Other canvas methods" in the ReportLab User Guide. Any hints on how I can add the PageLayout functionality to my canvas or page in ReportLab?
Thanks
Martin

Related

Restrict Images on Rich Text Editor in oracle apex 18.2

I am using Rich text editor of CLOB data type in apex 18.2, can I restrict users from pasting images in the field.
Can I show some error message when they are trying to paste images.
Please suggest.
Regards,
SwaZ
APEX uses CKEditor for the rich text editor. APEX 19.2 uses CKEditor v4.11.4. You can find the documentation here:
https://ckeditor.com/docs/ckeditor4/latest/api/
There's a configuration setting named pasteFilter:
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-pasteFilter
Configuration options can be set using the JavaScript Initialization option (in the Advanced section) of the item. I added the following code to that setting and it prevented images from being pasted in:
function (options) {
options.pasteFilter = 'img';
return options;
}
pasteFromWord_inlineImages may be useful as well.
You can also play with the allowedContent and disallowedContent settings, which apply to more than just pasting.
Unfortunately, I couldn't find anything simple that allowed for the specification of a function that could do more interesting things on paste. I suspect if you need additional functionality, such at prompting the user about the removal of the image or differentiating images that have base64 encoded images vs URLs, things would get complicated quickly.

How to remove the link from the logo in Oracle Apex 5.1 Universal Theme

I'm working on a project in Oracle Apex 5.1 with Universal Theme. We need the logo (actually, an image), but want to remove the hyperlink from it.
I tried custom css by setting the class t-Header-logo (and t-Header-logo-link, too) to "pointer-event:none" (in Theme Toller), but it does not work. Can anyone help?
Thanks: Peter
You can use below jquery code for removing link from logo
Put this code on page zero. It will work you whole application across.
$(".t-Header-logo a").removeAttr("href")

Sitecore 8 - Adding images, callouts and videos in RTF field

I am working on a requirement in Sitecore 8 according to which there is a Rich text field and the content author can not only add html data but can also add predefined call outs/renderings/images directly in page editor mode.
Is there any way I can achieve this ? Please help.
We achieve this using Components in Experience Editor. As you create pages, we created components for Image, Video, Text and any Callouts. You will be able to drop components on the page based on specified placeholder settings. In my opinion it is the cleanest approach.
It sounds like 'snippets' is the way to go for you. There are some posts on the web about how to add snippets to RTF fields:
http://davetayls.me/blog/2011/02/07/adding-rich-snippets-to-sitecore-rich-text-editors/
http://sitecoreblog.blogspot.ca/2010/11/richtext-editor-add-code-snippet-or.html
http://learnsitecore.cmsuniverse.net/en/Editors/Articles/2009/06/How%20to%20use%20snippets.aspx

Django Markdown or WYSIWYG editor

I have user generated context that extends multiple paragraphs. I'd like to enable the user to create paragraphs, possibly change font-weight, but nothing too huge.
I've seen a tutorial which uses the Python-Markdown module. Would anyone recommend this or should I just go with a WYSIWYG plugin? I've seen plugins for the admin but have not yet seen it applied to a general Django template.
Thanks
Brendan
I have used django tiny-mce with tinymce in my comment app and is working. Defining plugins for this WYSIWYG editor is easy and comes only to specifying name of plugin in settings.py and JS file.
MarkItUp! editor can help http://markitup.jaysalvat.com/
It have many rich features, includes django model class MarkupField(models.TextField), JS-settingynized editor's toolbar, etc.

Get website thumbnail snapshot with C++

Is there any way to capture an image of a web page using a C++ CGI? I've been searching high and low, and while I've found a number of implementations in everything from Perl to C#, haven't been able to find any implementations in C++.
The idea is for a user visiting a site to be able to specify a URL. The script would then take a picture of the URL's website, and then show load it to the C++ CGI website I am building.
Any help on this would be much appreciated!
Thanks!
Example in Perl:
Webthumb
You need to render the webpage in order to create a snapshot. To render the page in C++ you need to include a browser engine. You can do this easily using Qt (a toolkit for c++).
This is taken from the documentation of Qt and is all you need to show a webpage.
QWebView *view = new QWebView(ui->centralWidget);
view->load(QUrl("http://qt.nokia.com/"));
view->show();
The view object has a loadFinished signal. You could connect some code to this signal. When the page is rendered you tak a snapshot as described here.
It boils down to:
QPixmap::grabWindow(mainwindow->winId())
When you have got the screenshot you can return the bytes on stdout from your cgi and your done.