How to Specify fonts for Text fields using muPDF - c++

I am using muPDF library to add fields in existing PDF Documents.
I have successfully added a checkbox by defining its appearance.
But Text Fields are a problem as they need a Font Resource.
I cant figure out how to add fonts in a PDF document.
muPDF does have functions that deal with fonts, but I am unable to use them in a proper manner.
So i need to know how to load a font in a PDF document and how to reference them to my Text Field in the default appearance(DA).
----------------------------------------------------------EDIT------------------------------------------------------------------
Currently I am using the function pdf_set_free_text_details in pdf-annot-edit.c
But it only sets the predefined fonts . i wish to use other fonts as well
If this is not the right place to ask this question, then please if somebody could redirect me to the correct place. MuPDF only has a bug report site as far as i know.

Pass any of the font types specified on pdf-font.c as a string.
For eg: "Courier", "CourierNew", etc..

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.

Django CMS Group/Nest Placeholders

I'm trying to group my placeholders in Django CMS so that they don't appear in one long list. I want some sort of indication that some placeholders are linked together other than just their name.
Currently I want the user to be able to choose their own Header Image, Title and Subtitle so my placeholder tree looks like this:
-- Header Image
-- Header Title
-- Header Subtitle
I want to be able to group these together in my template to show a correlation like so:
-- Header
---- Header Image
---- Header Title
---- Header Subtitle
I found a post from 2013 that said this was possible but the plugin that was suggested that would give this functionality no longer exists.
This is possible in django-cms 3.
What you do is you create you placeholder in your template as normal. Then when you go to edit the page, find the empty placeholder that you just created and click the plus sign to add a plugin ie a text plugin called 'Header'. Then click the same plus sign to add a second text plugin. ie a text plugin called 'subheader' and so on.
You can mix different types of plugins and, like CMS pages on the menus, you can reorder your plugins by dragging them with the left drag tab.
Alternatively if you want things a little more tightly nested, you can add a text plugin to your placeholder. The when you edit the text, the toolbar has a link to allow you to add other plugins ie links, images etc, within the parent text plugin.
I know this is a fairly old question but I just stumbled across it so maybe this might help someone else.

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

How to create style sheet for creating html preview

I am developing a visual c++ Win-API application and I want to create a style sheet to display the html contents(I am not sure that i need to create style sheet only may be some thing else.But want to know what else can be used instead ?). Any idea how to achieve that??.Is it the same procedure as is the case with XML style sheet creation ?? (in xml file case we create a style sheet in order to preview on preview-pane)
If not please give idea how to do that ? As in case of html file we also have to take in account the font colour/background colour/font sizes etc. How to do that ?
(Actually i have to create preview handler for .html file) I have done every thing i just need to create style sheet (If not style sheet then some thing like this which will help me to display the html contents) and i already have data of .html file in a stream (which is IStreal * FinalHTMLStream)I just need to find the mechanism (like cretaing style sheet or may be any other)to create the html preview on preview pane using this stream.
Any Idea how to accomplish this ?
There are certain frameworks that allow you to create an HTML control easily, Win32++ is one of them. Give it a try.

Using richtext in QTextEdit

What is exactly richtext and how do I format data in richtext in QTextEdit?
The internal rich text format is tag/attribute-based, and is similar to HTML using in-line CSS style="xxx" attributes. The default export/import format (using toHTML/setHTML) is a subset of HTML. See this link:
http://doc.trolltech.com/4.6/richtext-html-subset.html
Note that CSS classes are not supported internally and are converted to their representing attributes at import.
QTextEdit can display text that is formatted with additional layout and style information (i.e. enriched) which can be set either programatically or by using a subset of HTML.
The Rich Text Processing documentation gives you an overview and pointers to more in-depth information.
If you're looking for a WYSIWYG toolbar for the QTextEdit, you'll end up disappointed. There is no default one (although the SDK contains an example app). So you should either make the toolbar yourself or find one.