Django - Generate a pdf with html block text - django

I'm working on a project with Django (1.12) and python(2.7). I have a function which returns me in a string the content of an html page. I need to create the html page with this string, and after to transform it to pdf (already have the function), but WITHOUT leaving my actual page. I search since this morning on the internet but i don't find something like my case.
Does anybody knows if it's possible ? and if yes, how?
Thanks,
#Nikotine

Related

How can I create a plugin to insert templated html within a text plugin in Django CMS

I'm fairly new to Django CMS so please forgive me if my terminology isn't right.
I have a page with a placeholder within which I have added some html using the Text plugin. Within that, I would like to be able to add one or many pre-templated pieces of html.
I have looked into building my own plugin but the documentation that I've been reading here only allows the plugin to be added from outside the actual text plugin page and renders the result beneath my text plugin content. I've found the section on Nested Plugins, but I'm trying to nest my plugin within the built-in Text plugin which that doesn't seem to cover.
What I'm looking for is to be able to build something so that it places block-level html elements within the content like the Link or Image plugins (in my case, it would be some block-level html content).
How can I do this, or where can I find some more information on how this can be done?

Trix and Summer Note issues while content saving in database

I am building a rails blog and I needed to integrate a WYSIWYG editor so I tried with Summernote (v 0.8.1.1), everything is fine except when I create a new post , content is being saved into the database along with html tags instead of only the formatted text content. Latter I tried with Trix (v 0.10.1) and the same thing is happening.I followed everything correctly from the github docs but this only one issue persists. Thank you in advance.
This is the screen shot of the issue:screenshot
When you display data on page use raw like:
raw(#data)
which will convert yout html tags to proper html on page.
hey you should render output using raw function of ruby on rails
raw #post
or use <%=== %>

How to implement sitecore site search

I need to implement content site search based on sitecore API.
I know how to set up crawler for Lucene.Net, but this would be some kind of search by predefined template, I need to implement search by result content (final html), it should works like close to google search. Is is possible to do in sitecore ?
Thanks.
If you want the search to be based on the rendered HTML (are you really sure about that), some custom magic is required.
Crawling the content is needed in such case, thus if the publised item is visitable (has an URL), you can use the HTMLAgility framework to get the HTML, strip the tags and add the content to the index in any (new) field you like...

C++ HTML viewer for scanning?

I just need some help in pointing me in the right direction. I have no issue with research but I don't know where to start!!! I want to make a program that uses a websites search function, but doesn't display the page. It will save the page and scan the HTML for a specific string and display it.
Would it work better to display the page in the background and search it, this way I don't have to save anything??
Where do I start??
A web page is mostly simple text. You can download a page with cURL and search it pretty much like you would any other text. If you don't want to search the contents of the tags, you'd want to search after parsing.

Importing HTML into TinyMCE using ColdFusion

Hey everyone, I would appreciate a pointing in the right direction with the problem I'm having. In short, I'm working on an application that will create PDFs using TinyMCE and ColdFusion 8. I have the ability to create a PDF by just entering in text, pictures, etc. However, I want to be able to import an html template and insert it into the TinyMCE .
Basically, I have a file directory code snippet that lets me browse through my 'HTMLTemplates' folder, and am able to select an HTML document. Now, I want to be able to take all the code from that selected HTML document and insert it into my TinyMCE box. Any tips on how I might do this, maybe?
Thanks!
If I understood you correctly, you already have a TinyMCE plugin which pops up a window and allows you to browse the certain directory using existing cfm page which you render within the popup window. Right?
If not, you should start with this. Not sure how easy it is done in current version, but in the older TinyMCE I've created the custom upload plugin (needed to track the site security permissions for current user) pretty quickly.
Next, I can see two quick ways to pass the server file contents to the client-side:
Make it available via HTTP so you can make the GET request and read contents into the variable.
Output it on the page using CF (say, on form submit when file selected) and grab using JavaScript.
I'd personally tried the second option. After you grab the text into the variable you can put it into the TinyMCE using it's API.
It can be as simple as output escaped text into the hidden div with known ID and read it using DOM operations (assuming that there is cfoutput around):
<div id="myTemplate">#HTMLEditFormat(myFileContents)#</div>
Also you can output the text directly into the JavaScript variable (of cource, with accurate escaping), maybe like this.
<script type="text/javascript">
var text = '#HTMLEditFormat(myFileContents)#';
</script>
Most advanced and possibly better for performance (and definitely "cooler") way is to use the concept of script tags as data containers, like this:
<script type="text/plain">
#HTMLEditFormat(myFileContents)#
</script>
Last time I've seen this in Nadel's blog, I think. Read it, pretty interesting.
Hope this helps.