PDF to text extraction using Poppler C API - c

I need do extract the text from the PDF file.With the help of Poppler API i can able to extract all text available in that page . even i can able to get the font information like Bold and italic .But i cant able to get the size of the text.Please let me know the way to get the size of text.
Thanks

Although late by an eternity, take a look at TextWord::getFontSize().

Related

how to render data generated by text-editor

I am using this (Tiny) text editor in the web platform. Able to integrate basic editor also
Now problem i am facing is how to render output html data(which is in the string format) like this
so output data in string format is like this :
please help me out to render this string formatted data in a separate block.
whole idea is like this i need a rich text editor like stackoverflow/medium and want to render the data in a separate location. I'm little confused about all this please help me out or suggest a better approach to handle this.

How do i let a user insert a link in an input field with normal text?

I am using react.js
I'm trying to build a blog page.
there is a texterea tag to write a blog for the user.
now I want to add the function that allows users to add words that are linked.
so that when i show the text from that input words that are linked are clickable
enter image description here
like the blue words in wiki in the image above.
pardon my mistakes (1st question in StackOverflow)
I know about dangerouslysetinnerhtml. but not sure if it's the right way to do so. because then users can modify the code inside (i think). so what is the safe and right way to do so
Reading your case Markdown seems best option as it also supports links insertion. For rendering user entered markdown you may use library like React Markdown. For writing markdown textarea is fine as long as you write markdown syntax properly but you may want to consider libraries like React textarea markdown editor to make things easier.

How to render ₹ symbol in PDF in C# using PDFsharp

I want to render ₹ in PDF using C#.
Instead of this I am getting ?.
In form am able to print how to render ₹ but I am facing this issue only with PDF.
Attached image
Make sure Unicode is enabled in PDFsharp and also make sure the font use are using contains that symbol.
Since you get "?" instead of the symbol, you most likely just have to set the PdfFontEncoding.Unicode option as shown in the sample.
See this sample:
http://pdfsharp.net/wiki/Unicode-sample.ashx

PDF in aspose made is not showing chinese characters

I am using aspose.total package for pdf generation. The reports are generated fine for english language some characters in chinese language are not coming fine. I have found that instead of showing characters its showing square like image. Does any one know how to deal with this ?
Thanks,
Please note that Aspose.Words requires TrueType fonts when rendering documents to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts that are used in your document on the machine where you're converting documents to Pdf. Please refer to the following articles:
How Aspose.Words Uses True Type Fonts
I work with Aspose as Developer evangelist.
You can set the font as follow:
TextFragment textFragment = new TextFragment("text");
textFragment.TextState.Font = FontRepository.OpenFont("C:\\WINDOWS\\FONTS\\SIMHEI.TTF");

Is it possible to output formated text in a text file?

I`m working at a little text editor. My application is a winapi one in C. The idea is to write text in a large textbox(like in notepad) and then when I press a button it will take all text into a buffer, format it after some rules and then put it in a .txt file.
For example, if my input is:
Anne \red(got) \blue(\bold(apples)) and \italic(\bold(snails!))
After I parse it, it`s possible to put it into a .txt file and after I open it to see it like this?
I want to thank everyone for their time. I got exactly what answer I wanted. Everyone here rocks
I think that you are programming for fun, just for the pleasure of it, and with the perspective of learning more. If that is the objective, then it is okay to invent your own formats and essay your own solutions.
The problem presented can be twofold:
does the format results need to be shown in the editor itself?
or do you just need to do something that is going to be rendered in an external program?
If you are after the first possibility, then you need some Win32 (given your environment) component that will show the formatting. That component is RichEdit, and it implements RTF, a codification that can be saved to a text file, and which is more or less standard.
If you have the second possibility in mind, then you can choose from a variety of codifications. You would just be creating a text editor, probably with some helpers that write part of the commands for the user. For example, you could be creating a HTML editor, or a RTF editor.
There is a third possibility, though. You create your own codification, and when saving, you translate that codification to HTML, and then open the document in a web browser.
Say that you have:
\bold(hello), world.
You would translate that to:
<html><body><b>hello</b>, world.</body></html>
The possibilities, as you can see, are inifinite.
Hope this helps.

Resources