Change font size for whole document - c#

I am trying to make a document but my font is currently to big.
Currenty i am changing the font like this
t2.Rows[0].Cells[0].Paragraphs.First().Append("Data").FontSize(9);
Is there a way to change the font size for the whole document ?

Related

changing font size and font name of range containing RTF text

I'm dynamically generating the word document which handles lot of RTF text. I want to apply certain font type and size to particular range in the document. Following is the code I'm trying
initialRange.Font.Size = 12;
initialRange.Font.Name = "Times New Roman";
start = initialRange.End;
Clipboard.SetData(System.Windows.DataFormats.Rtf, <RTF TEXT TO BE PASTED>);
initialRange.PasteSpecial(DataType:
Microsoft.Office.Interop.Word.WdPasteDataType.wdPasteRTF);
end = initialRange.End;
initialRange.Collapse(WdCollapseDirection.wdCollapseEnd);
But it always takes the formatting of the RTF Text instead of font size and name, I'm trying to set. Can anyone help how I can maintain the RTF Text format while changing just font size and name?
Another issue I'm facing is with adding the empty line. I add following code in order to add empty line.
initialRange.InsertAfter(Environment.NewLine);
initialRange.Collapse(WdCollapseDirection.wdCollapseEnd);
with above code, It does add new line but font size of this empty line is just 2. Hence, it is very less space is visible between the two lines. Is there anyway to set font size of empty line as well?
Thanks

How to Use RibbonControl in C#.Net?

My image: enter image description here
I am starting with RibbonControl in Devexpress. My problem is
Change Font Size in sub-item, if the font size is bigger than 10, it ran out of the area.
I need it to read my character in Unicode font.
There is any way to make the font area auto size with the font size?

change font size of template zebra printer

We are printing labels to printer directly. The printer is Zebra.
We are using templates to define fields. Here is line which i want to change font size a bit more bigger
^FT465,819^A0N,56,55^FH\^FD<Address>^FS
You can see that its Address field. I want to change font to be bit bigger but i have no clue what this code. I read a bit and its ZPL code but dont know how i change font size for that field. Has anyone experience with zebra printing. I am printing programatically through c#
Try using something like this:
^XA
^FO485,945^CF0,60^FD<Address>^FS
^FO485,900^CF0,40^FD<Address>^FS
^XZ
You can see I change font size from 60 pixels to 40 pixels.

How to increase the font size in a pdf using c# with wkhtmltopdf?

A have created a pdf file from an .aspx page using the wkhtmltopdf converter. It's showing a smaller font size than the actual font shown on the page. So when I take the print out of the pdf file, it looks as if it has been compressed to a smaller size. Do any of you have any idea how can I set/increase the font size by number (14 or 15) or percentage using C# code? I'm using the string switches to fix the margin, page etc. as follows:
string switches = "";
switches += "--print-media-type ";
switches += "--margin-top 5mm --margin-bottom 5mm --margin-right 10mm --margin-left 30mm ";
switches += "--page-size A4 ";
Can you suggest how I can incorporate font size here? My page has different font types and sizes for different controls. I want to increase the font size for ALL elements (if possible, by some percentage).
The problem above can be solved by the following code:--
I added this line of code and the newly created pdf file has exactly the font size what I want.
switches +="--disable-smart-shrinking";
It'll stop font shrinking.
If you can't edit the html/css before sending it to wkhtmltopdf, try the --minimum-font-size option. If that doesn't work, and you don't mind making everything bigger, there is also --zoom.

Generating Text to a PNG File with Transparent Background

I need to Export some PNG Images with Transparent Background from a C# Application .
But that is not a Huge Concern .
What make's it complicated and beyond my knowledge is ,how am i able to Export to PNG Image File With Transparent Background with Some Text in it,like a Label only without Background so in that way i can export as many images i want with Different Text into it.
And that PNG should had the Size of the Label ,or if there is a way it should FIT the Font Size and Text Length ,so it Height and Width should be same as Font one .
Bests.
You're looking for the Bitmap and Graphics classes, along with the Font class and the TextRenderer.MeasureText method.

Categories