java.lang.Object
com.aspose.words.LayoutOptions
public class LayoutOptions
You do not create instances of this class directly. Use the Note that after changing any of the options present in this class, Example:
Document doc = new Document();
Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(
"This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options.");
doc.stopTrackRevisions();
// Layout options can be used to show hidden text too
builder.writeln("This text is not hidden.");
builder.getFont().setHidden(true);
builder.writeln(
"This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");
doc.getLayoutOptions().setShowHiddenText(true);
doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");
| Property Getters/Setters Summary | ||
|---|---|---|
RevisionOptions | getRevisionOptions() | |
| Gets revision options. | ||
boolean | getShowComments() | |
void | setShowComments(boolean value) | |
| Gets or sets indication of whether comments are rendered. Default is True. | ||
boolean | getShowHiddenText() | |
void | setShowHiddenText(boolean value) | |
| Gets or sets indication of whether hidden text in the document is rendered. Default is False. | ||
boolean | getShowParagraphMarks() | |
void | setShowParagraphMarks(boolean value) | |
| Gets or sets indication of whether paragraph marks are rendered. Default is False. | ||
Aspose.Words.Shaping.ITextShaperFactory | getTextShaperFactory() | |
|
Gets or sets |
||
| Property Getters/Setters Detail |
|---|
getRevisionOptions | |
public RevisionOptions getRevisionOptions() | |
Example:
Shows how to set a document's layout options.
Document doc = new Document();
Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(
"This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options.");
doc.stopTrackRevisions();
// Layout options can be used to show hidden text too
builder.writeln("This text is not hidden.");
builder.getFont().setHidden(true);
builder.writeln(
"This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");
doc.getLayoutOptions().setShowHiddenText(true);
doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");getShowComments/setShowComments | |
public boolean getShowComments() / public void setShowComments(boolean value) | |
Example:
Shows how to show or hide comments in PDF document.Document doc = new Document(getMyDir() + "Comment.Document.docx"); doc.getLayoutOptions().setShowComments(false); doc.save(getArtifactsDir() + "Document.DoNotShowComments.pdf");
getShowHiddenText/setShowHiddenText | |
public boolean getShowHiddenText() / public void setShowHiddenText(boolean value) | |
Example:
Shows how to set a document's layout options.
Document doc = new Document();
Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(
"This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options.");
doc.stopTrackRevisions();
// Layout options can be used to show hidden text too
builder.writeln("This text is not hidden.");
builder.getFont().setHidden(true);
builder.writeln(
"This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");
doc.getLayoutOptions().setShowHiddenText(true);
doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");getShowParagraphMarks/setShowParagraphMarks | |
public boolean getShowParagraphMarks() / public void setShowParagraphMarks(boolean value) | |
Example:
Shows how to set a document's layout options.
Document doc = new Document();
Assert.assertFalse(doc.getLayoutOptions().getShowHiddenText());
Assert.assertFalse(doc.getLayoutOptions().getShowParagraphMarks());
// The appearance of revisions can be controlled from the layout options property
doc.startTrackRevisions("John Doe", new Date());
doc.getLayoutOptions().getRevisionOptions().setInsertedTextColor(RevisionColor.BRIGHT_GREEN);
doc.getLayoutOptions().getRevisionOptions().setShowRevisionBars(false);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(
"This is a revision. Normally the text is red with a bar to the left, but we made some changes to the revision options.");
doc.stopTrackRevisions();
// Layout options can be used to show hidden text too
builder.writeln("This text is not hidden.");
builder.getFont().setHidden(true);
builder.writeln(
"This text is hidden. It will only show up in the output if we allow it to via doc.LayoutOptions.");
doc.getLayoutOptions().setShowHiddenText(true);
doc.save(getArtifactsDir() + "Document.LayoutOptions.pdf");getTextShaperFactory | |
public Aspose.Words.Shaping.ITextShaperFactory getTextShaperFactory() | |
Example:
Shows how to support OpenType features using HarfBuzz text shaping engine.// Open a document Document doc = new Document(getMyDir() + "OpenType.Document.docx"); // Please note that text shaping is only performed when exporting to PDF or XPS formats now // Aspose.Words is capable of using text shaper objects provided externally. // A text shaper represents a font and computes shaping information for a text. // A document typically refers to multiple fonts thus a text shaper factory is necessary. // When text shaper factory is set, layout starts to use OpenType features. // An Instance property returns static BasicTextShaperCache object wrapping HarfBuzzTextShaperFactory doc.getLayoutOptions().setTextShaperFactory(HarfBuzzTextShaperFactory.getInstance()); // Render the document to PDF format doc.save(getArtifactsDir() + "Document.OpenType.pdf");