java.lang.Object
com.aspose.words.SaveOutputParameters
public class SaveOutputParameters
To learn more, visit the Save a Document documentation article. Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Hello world!");
// After we save a document, we can access the Internet Media Type (MIME type) of the newly created output document.
SaveOutputParameters parameters = doc.save(getArtifactsDir() + "Document.SaveOutputParameters.doc");
Assert.assertEquals("application/msword", parameters.getContentType());
// This property changes depending on the save format.
parameters = doc.save(getArtifactsDir() + "Document.SaveOutputParameters.pdf");
Assert.assertEquals("application/pdf", parameters.getContentType());
| Property Getters/Setters Summary | ||
|---|---|---|
java.lang.String | getContentType() | |
| Returns the Content-Type string (Internet Media Type) that identifies the type of the saved document. | ||
| Property Getters/Setters Detail |
|---|
getContentType | |
public java.lang.String getContentType() | |
Example:
Shows how to access output parameters of a document's save operation.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Hello world!");
// After we save a document, we can access the Internet Media Type (MIME type) of the newly created output document.
SaveOutputParameters parameters = doc.save(getArtifactsDir() + "Document.SaveOutputParameters.doc");
Assert.assertEquals("application/msword", parameters.getContentType());
// This property changes depending on the save format.
parameters = doc.save(getArtifactsDir() + "Document.SaveOutputParameters.pdf");
Assert.assertEquals("application/pdf", parameters.getContentType());