Change font in Document
Hi there. I have a rtf file in which I am inserting string using Java:
FileInputStream fis= new FileInputStream(exampleFile);
RTFEditorKit rtf = new RTFEditorKit();
Document doc = rtf.createDefaultDocument();
rtf.read(fis, doc, 0);
doc.insertString(52,strName.toUpperCase(),null);However that inserts string in font size 12 how can I change that to 8
Another thing is how to set bold to that text.
Thank you
I see where you can see fonts in Acrobat 9 Pro under Document Properties. But the poster was trying to help guide you in the right direction. Don't be malicious towards people who are here to HELP you.
try reading this document:
http://ballade.cs.ucla.edu/~kohcc/sigdacdrom/instruct/fonts.html
and especially this one from adobe's knowledgebase:
http://kb2.adobe.com/cps/328/328509.html
hope that helps.
-markerline
Similar Messages
-
Signing digitally changes fonts in document when saved
I have just been sent a couple of document to sign - something I have done many times in the past few weeks.
When I save these documents after signing them - much of the text in the documents changes to something difficult to read (I suspect it may be courier).
This seems like a serious error to me as a lot of the point of digital signatures is that you sign and return a document that you can't otherwise have made changes to.
Is there anything I can do to stop this happening?
I'm using Acrobat Reader 10.1.9 on Mac OSX 10.9.2 (Mavericks). The documents were created on a PC.
I've attached a limited screen shot - although the document is fairly confidential so I can't upload most of it.Hi Steve,
Thanks for the reply. Unfortunately, my question was posted so long ago that I no longer have access to the documents. I printed and signed paper copies and deleted them. So the problem has gone away for me. However, I DO think this is a very serious issue.
I am a bit rusty now but I used to work a lot with Postscript and PDF. In my day, you could only realistically modify the content of a pdf document by appending new content to the file and then appending a new index. That ensured that, although the visual appearance changed, the underlying electronic document did not and even deleted items were still present - just no longer indexed and hence not displayed. That was a great system as it maintained an audit trail. I assumed that was how signatures worked which is why I was surprised to see the symptom I sent you.
I fully understand all you say about font substitution and multi-master fonts but I fail to see why it is relevant. If adding a signature is coded in a “well behaved” manner, adding it could not affect the rest of the document - including embedded or non embedded fonts. If it is not coded in that way, and some sort of active editing of the original content is going on, I am concerned that the legality of signed documents is seriously compromised as, if you can modify one bit of the original to add a signature you can edit any other bit of the document and subtly change it’s meaning WITHOUT AN AUDIT TRAIL. If that is what is happening, I for one would be wary of accepting important documents as signed PDFs instead of paper documents without thoroughly scrutinising the whole thing to see if any subtle changes have been introduced.
All the best
Dave -
How to change Font size and alignment in Appraisal document - Font settings
Dear Eperts,
We are working on 360 Appraisal. Can Any body explain how to change the fornt size and allignment (text wrapping to wndow size) in Appraisal document.
Thanks and Regards,
AjaykumarHello Ajaykumar,
if I am not completely mistaking the 360° Appraisal uses the Adobe Forms.
In this case the font can be set in the Adobe Live Cycle Designer by selecting "Palettes" -> "Font".
Here is a discussion which addresses this question, and also contains a link to how to handle Adobe Forms:
Adobe Print Form - Change Font Type/Size | SCN
Best regards,
Laszlo -
How do I change font in the whole document at the same time?
How do I change font in the whole document at the same time?
Menu > View > Show Styles Drawer
Menu > Help > Pages User Guide
Download and read page 27 on creating and using Styles, which is done largely by example ie you make the text what you want then save it as a Style to be applied wherever you want in the document from the Styles Drawer.
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=180&mforum=iworktips ntrick
Peter -
help! I have adobe acrobat X pro. Cannot edit a pdf. watched videos, followed directions, nothing. Tried tools, edit document text, recognize text, then tried even to change font, nothing.
This is the Reader forum. The Acrobat one is here: Acrobat
-
When I try to print from Numbers on my ipad using fingerprint app, the font size change automatically from document to document
FingerPrint is not listed as supported on this page: AirPrint Basics
You might check with the makers of FingerPrint. -
How do I change fonts in a Text field ??
Okay I've tried to implement a JComboBox that allows the user to change fonts in the text field. So far I've tried different methods to do it but to no avail. Could somebodoy here read the programs source code for me and tell me where I went wrong?
/* * My GUI Client */
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import javax.swing.event.*;
//for HTML Headers
import javax.swing.text.StyledEditorKit.*;
import javax.swing.text.html.HTMLEditorKit.*;
import javax.swing.text.html.*;
import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.text.html.HTMLFrameHyperlinkEvent;
//for layout managers
import java.awt.event.*;
//for action and window events
import java.io.*;
import java.net.*;
import java.awt.GraphicsEnvironment;
//for font settings
import java.lang.Integer;
import java.util.Vector;
import java.awt.font.*;
import java.awt.geom.*;
public class guiClient extends JFrame implements ActionListener {
protected static final String textFieldString = "JTextField";
protected static final String loadgraphicString = "LoadGraphic";
protected static final String connectString = "Connect";
static JEditorPane editorPane;
static JPanel layoutPanel = new JPanel(new BorderLayout());
static JPanel controlPanel = new JPanel(new BorderLayout());
static JPanel buttonPanel = new JPanel(new BorderLayout());
static JPanel fontPanel = new JPanel(new BorderLayout());
static PrintStream out;
static DrawPanel dPanel;
static DrawPanel dPButton;
static DrawPanel dFonts;
static DrawControls dControls;
static DrawButtons dButtons;
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public static JMenuBar menuBar;
private static JButton connectbutton = new JButton("Connect");
static boolean CONNECTFLAG = false;
//create the gui interface
public guiClient() {
super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
fontlist.setSelectedIndex(0);
fontlist.setEditable(true);
fontlist.addActionListener(this);
fontchoice = envfonts[0];
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
//Create an editor pane.
editorPane = new JEditorPane();
editorPane.setContentType("text");
editorPane.setEditable(false);
//set up HTML editor kit
HTMLDocument m_doc = new HTMLDocument();
editorPane.setDocument(m_doc);
HTMLEditorKit hkit = new HTMLEditorKit();
editorPane.setEditorKit( hkit );
editorPane.addHyperlinkListener( new HyperListener());
//Create whiteboard
dPanel = new DrawPanel();
dPButton = new DrawPanel();
dFonts = new DrawPanel();
dControls = new DrawControls(dPanel);
dButtons = new DrawButtons(dPButton);
//JLable fontLab = new JLabel(fontLable);
//fontLab.setText("Fonts");
//Font newFont = getFont().deriveFont(1);
//fontLab.setFont(newFont);
//fontLab.setHorizontalAlignment(JLabel.CENTER);
JPanel whiteboard = new JPanel();
whiteboard.setLayout(new BorderLayout());
whiteboard.setPreferredSize(new Dimension(300,300));
whiteboard.add("Center",dPanel);
whiteboard.add("South",dControls);
whiteboard.add("North",dButtons);
JScrollPane editorScrollPane = new JScrollPane(editorPane);
editorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(new Dimension(250, 145));
editorScrollPane.setMinimumSize(new Dimension(50, 50));
//put everything in a panel
JPanel contentPane = new JPanel();
JPanel fontPane = new JPanel();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
//add whiteboard
contentPane.add(whiteboard);
//add editor box
contentPane.add(editorScrollPane);
//add spacer
contentPane.add(Box.createRigidArea(new Dimension(0,5)));
//add textfield
contentPane.add(textField);
//set up layout pane
//layoutPanel.add(GridLayout(2,1),fontLab);
layoutPanel.add( BorderLayout.NORTH, fontlist);
layoutPanel.add(BorderLayout.WEST,new Label("Name: ")); //add a label
layoutPanel.add(BorderLayout.CENTER, userName ); //add textfield for user names
layoutPanel.add(BorderLayout.SOUTH, connectbutton);//add dropdown box for fonts
//fontPane.add(BorderLayout.NORTH,fontlist);
contentPane.add(layoutPanel);
contentPane.add(controlPanel);
contentPane.add(buttonPanel);
//Create the menu bar.
menuBar = new JMenuBar();
setJMenuBar(menuBar);
//Build the first menu.
JMenu menu = new JMenu("File");
menu.setMnemonic(KeyEvent.VK_F);
menuBar.add(menu);
//a group of JMenuItems
JMenuItem menuItem = new JMenuItem("Load Graphic", KeyEvent.VK_L);
menu.add(menuItem);
menuItem.setActionCommand(loadgraphicString);
menuItem.addActionListener(this);
connectbutton.setActionCommand(connectString);
connectbutton.addActionListener(this);
setContentPane(contentPane);
static private void insertTheHTML(JEditorPane editor, String html, int location) throws IOException {
HTMLEditorKit kit = (HTMLEditorKit) editor.getEditorKit();
Document doc = editor.getDocument();
StringReader reader = new StringReader(html);
try {
kit.read(reader, doc, location);
} catch (BadLocationException e) {}
//listen for actions being performed and process them
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
if (e.getActionCommand().equals(textFieldString)) {
JTextField fromUser = (JTextField)e.getSource();
if (fromUser != null){
//place user text in editor pane
//send message to server
if (userName.getText() != null) {
userString = userName.getText().trim();
out.println(userString + ": " + fromUser.getText());
fromUser.setText("");
} else if(e.getActionCommand().equals(connectString)) {
CONNECTFLAG = true;
} else if (e.getActionCommand().equals(loadgraphicString) ) {
final JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
dPanel.loadImage(file.getAbsolutePath());
sendImage(file);
else if (e.getActionCommand().equals(fontlist)){
JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
userString = currentFont;
return;
/*public void itemStateChanged (ItemEvent e) {
if ( e.getStateChange() != ItemEvent.SELECTED ) {
return;
if ( list == fontlist ) {
fontchoice = (String)fontlist.getSelectedItem();
userString.changeFont(fontchoice);
//append text to the editor pane and put it at the bottom
public static void appendText(String text) {
if (text.startsWith("ID ") ) {
userString = text.substring(3);
} else if (text.startsWith("DRAW ") ) {
if (text.regionMatches(5,"LINE",0,4)) {
dPanel.processLine(text);
}else if (text.regionMatches(5,"POINTS",0,5)) {
dPanel.processPoint(text);
} else if (text.startsWith("IMAGE ") ) {
int len = (new Integer( text.substring(6, text.indexOf(",")))).intValue();
//get x and y coordinates
byte[] data = new byte[ (int)len ];
int read = 0;
try {
while (read < len) {
data = text.getBytes( text.substring(0, len) );
} catch (Exception e) {}
Image theImage = null;
theImage = dPanel.getToolkit().createImage(data);
dPanel.getToolkit().prepareImage(theImage, -1, -1, dPanel);
while ((dPanel.getToolkit().checkImage(theImage, -1, -1, dPanel) & dPanel.ALLBITS) == 0) {}
dPanel.drawPicture(0, 0, theImage);
} else {
//set current position in editorPane to the end
editorPane.setCaretPosition(editorPane.getDocument().getLength());
//put text into the editorPane
try {
insertTheHTML(editorPane, text, editorPane.getDocument().getLength());
} catch (IOException e) {}
} //end of appendText(String)
public void sendImage(File file) {
//find length of file
long len = file.length();
//read file into byte array
byte[] byteArray = new byte[(int)len];
try {
FileInputStream fstream = new FileInputStream(file);
if (fstream.read(byteArray) < len) {
//error could not load file
} else {
out.println("IMAGE " + len + ",");
out.write(byteArray, 0, (int)len); //write file to stream
} catch(Exception e){}
//run the client
public static void main(String[] args) {
String ipAddr=null, portNr=null;
if (args.length != 2) {
System.out.println("USAGE: java guiClient IP_Address port_number");
System.exit(0);
} else {
ipAddr = args[0];
portNr = args[1];
JFrame frame = new guiClient();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0); }
frame.pack();
frame.setVisible(true);
while(CONNECTFLAG == false){}
//sames as previous client,
//set up connection and then listen for messages from the Server
String socketIP = ipAddr;
int port = Integer.parseInt(portNr);
//the IP address of the machine where the server is running
Socket theSocket = null;
//communication line to the server
out = null;
//for message sending
BufferedReader in = null;
//for message receiving
try {
theSocket = new Socket(socketIP, port );
//try to connect
out = new PrintStream(theSocket.getOutputStream());
dPanel.out = out;
//for client to send messages
in = new BufferedReader(new InputStreamReader(theSocket.getInputStream()));
BufferedReader userIn = new BufferedReader(new InputStreamReader(System.in));
String fromServer;
while ((fromServer = in.readLine()) != null) {
appendText(fromServer);
if (fromServer.equals("BYE")) {
appendText("Connection Closed");
break;
out.close();
//close all streams
in.close();
theSocket.close();
//close the socket
} catch (UnknownHostException e) {
//if the socket cannot be openned
System.err.println("Cannot find " + socketIP);
System.exit(1);
} catch (IOException e) { //if the socket cannot be read or written
System.err.println("Could not make I/O connection with " + socketIP);
System.exit(1);
class HyperListener implements HyperlinkListener {
public JEditorPane sourcePane;
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
sourcePane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent event = (HTMLFrameHyperlinkEvent) e;
System.out.println(event.getTarget());
HTMLDocument doc = (HTMLDocument) sourcePane.getDocument();
doc.processHTMLFrameHyperlinkEvent(event);
else {
try {}
catch (Exception ev){
ev.printStackTrace();
Well sorry the source code takes up the whole forum but I need a good feedback from this.All right...
public class guiClient extends JFrame implements ActionListener {
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public guiClient() {
super("My Client");
public guiClient() {
super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
fontlist.setSelectedIndex(0);
fontlist.setEditable(true);
fontlist.addActionListener(this);
fontchoice = envfonts[0];
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
if (e.getActionCommand().equals(textFieldString)) {
JTextField fromUser = (JTextField)e.getSource();
if (fromUser != null){
//place user text in editor pane
//send message to server
if (userName.getText() != null) {
userString = userName.getText().trim();
out.println(userString + ": " + fromUser.getText());
fromUser.setText("");
else if (e.getActionCommand().equals(fontlist)){
JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
userString = currentFont;
return; -
How to change font size in a call-out tool box?
Hi, the other day i inserted a call-out tool box in a PDF document, however i cannot find anything that can change the font size of the letters i input in that box. could anyone help? Thanks.
ShermanThis is a question for the Acrobat support forums – please post there.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Wed, 23 Nov 2011 10:55:07 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: how to change font size in a call-out tool box?
Re: how to change font size in a call-out tool box?
created by danmarch<http://forums.adobe.com/people/danmarch> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4043425#4043425 -
How to change font size in a table?
How to change font size in a table without using the font style of another document? Please show a sample script. Thanks!
Hi Dave,
Thank you so much for the email. I tried every object and method I can
posibly think about such as
myTable.Rows.Item(1).PointSize = 24
myCell.Characters.Item(1).PointSize = 24
I got error message all the time. These objects don’t support PointSize.
All I need is to change point size of the text in InDesign tables created
using VBScript. Could you help me with this? Thanks,
Regards,
Li -
Just purchased Deskjet 1010 & don't know how to change font size.
hellinger
Welcome to the HP Community Forum.
In most cases you can adjust the scale of your documents before you print.
Please take a look at the following:
Manage Print Output with Print Preview
Click the Kudos Thumbs-Up to say Thank You!
And...Click Accept as Solution when my Answer provides a Fix or Workaround!
I am pleased to provide assistance on behalf of HP. I do not work for HP.
Kind Regards,
Dragon-Fur -
Changing Font in Adobe reader?
I was doing some pages, in which I can enter the information. The problem when I got to some of the places, is the font was to large in adobe reader? I looked at preferences and could not find any area to change the size of font, so it would fit properly?
Appreciate any help. This is adobe reader 8.1.2
thanks BruceAdobe Reader is used for displaying PDF files. PDF files are intended to be an accurate representation of the original document so changing font size isn't normally a feature of PDF readers.
You're probably thinking of EPUB or Kindle files. EPUB readers and Kindles let you change font size.
In a PDF, you need to zoom in on the text to view it larger. Use the normal way of doing it on an iPad: Spreading your fingers on the screen increases your zoom magnification. Closing your fingers on the screen decreases your magnification. -
hello
First, Indesign function to automatically open fonts from "Document fonts" folder is fantastic, quasy font manager. BUT, fonts is available ONLY for THAT indesign document, no other application can use it, even from CS6 suite. This is probably the most stupid decision about how this function must work. IDEALLY, fonts will be available for ALL application inside CS package until indd doc is closed. If I need some font for editing links in photoshop, illustrator I need to install them. This workflow have wrong concept.
We now have problem, sorry Indesign have problem. Example, I need type1 font mt-symbol for mathtype AND for Indesign. This font is installed in c:\windows\fonts folder. Everything work fine. When I make package from Indesign and reopen indesign indd document inside package, Indesign report that mt-symbol IS INCOMPLETE. WHY, BECAUSE CONCURENT FONTS from both C:\windows\fonts folder AND FROM "Document fonts" folder. If I rename "Document fonts" folder, Indesign open font only from system and everything work properly.
THIS IS BIG PROBLEM, fonts circles around workflow/folders and always will be duplicates in "document fonts" and system\fonts folder because different application need same fonts.
Any solution?Another problem with the Document Fonts folder that we just noticed: in CS5, you could place Windows Type 1 fonts (.pfm and .pfb) into the Document Fonts folder on a Mac and InDesign would activate them.
This no longer works in CS6. (Bug report filed.)
Huge bummer, as this was a great timesaver and workaround in a high-production prepress environment when working with old Windows files. Hopefully this was not an intentional change and will be restored in a later bugfix release, or at worst in CS7. -
Hi,
I want to change font in a table. It's the only item in the document. Selecting all, and changing font doesn't change anything. It does change any text I subsequently type outside the table, but not the table itself. Adding another row to the table uses the table font. Selecting an individual cell before changing font doesn't change anything either. Selecting the text within the cell before changing font does work, but it would be time consuming to do the whole table like this.
Hope you can help,
Tris.DennisG wrote:
Tris,
After I read your post, I tried changing typefaces in a table, and it's not as intuitive as it should be.
My favourite word processor, TechWriter, uses a menu so you can choose what aspect of the text you want to select at the point at which the caret is, be it Document or Chapter, down to Table row or Table cell.
But there's a method that worked well for me. Double click on the first cell to select it. Hold down the Shift key, then click on the last cell. The whole table should be selected. Now change the typeface.
Works for me, thanks. I'd still like to know how to inspect the style for the table though. -
How do I change font in Ical 4.04
How do I change font/size in Ical 4.04 montly event edit?
Menu > View > Show Styles Drawer
Menu > Help > Pages User Guide
Download and read page 27 on creating and using Styles, which is done largely by example ie you make the text what you want then save it as a Style to be applied wherever you want in the document from the Styles Drawer.
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=180&mforum=iworktips ntrick
Peter -
How to make exception rules for Stylish rules which change fonts?
How to make exception rules for Stylish rules which change fonts?
I use [https://addons.mozilla.org/en-US/firefox/addon/stylish/ Stylish add-on] to change specific fonts to other fonts of my choice, but I have a problem. I want to change the font Arial to Tahoma in almost all pages I visit, but with the exception of websites as wikipedia.org. Because of this, I find myself having a very long list of domains to change Arial to Tahoma, only because I don't want that rule to apply to wikipedia.org and additional one or two other websites.
The current rule I'm using is, (my actual list is a lot longer, but this is just an example):<br/>
'''''@-moz-document domain("mozilla.org"), domain("thefreelibrary.com"), domain("sil.org"), domain("ethnologue.com") {'''''<br/>
'''''@font-face { font-family: 'Arial'; src: local('Tahoma'); }'''''<br/>
I can't use the following rule because I don't want it to apply to wikipedia.org:<br/>
'''''@font-face { font-family: 'Arial'; src: local('Tahoma'); }'''''Try something like this:<br />
<br />
<pre><nowiki>@font-face { font-family: 'Arial'; src: local('Tahoma'); }
@-moz-document domain(wikipedia.org){
@font-face { font-family: 'Arial'; src: local('Arial'); }
</nowiki></pre>
Maybe you are looking for
-
Extending customer and vendor master idoc
Hi, Please explain me for what fields or data debmas and cremas should be extended. Thanks. Moderator message: please do your own research before asking. Edited by: Thomas Zloch on Jan 5, 2011 1:49 PM
-
Using a Samsung syncmaster 2343bwx with iMac
I have a fairly recent iMac 23" (2011) and I also purchased a Samsung syncmaster 2343bwx. Would I be able to use this as an external monitor to my iMac? Has anyone tried this? thanks in advance!
-
Video has noise after compression
Hi, does anyone know why my videos are showing up wavey after compression is complete? The following is what's going on: Video files originally imported to FCPX at 1920x1080p. I then realized I should have imported them at 720p per what has been su
-
Is the export of webm files possible in AME?
Hello everyone, please forgive me if I start a new discussion on a well known topic. Is there a way to enable AME to export webm formats? There is a wonderful tutorial by Adobe evangelist Jason Levine on how to work this out on a Mac: http://boodahjo
-
Graphic Design Software Advice
I have an IMAC G5 with the 'as it came out of the box' software. I am looking to do some T-Shirt designs and so was after a piece of software to assist. Nothing spectacular, just images and text and so I'm hoping not to spend too much money. I am new