Razvijalci Java lahko preprosto ustvarijo HTML samo z uporabo našega zmogljivega API ja izdelka. To pomeni, da bo naša rešitev programerjem zagotovila vse, kar potrebujejo za ustvarjanje HTML v Java.
Z našo knjižnico Java lahko razvijalci preprosto ustvarijo HTML iz nič. Za to morajo razvijalci Java izvesti le nekaj korakov:
Omeniti velja, da naj bi prazen dokument tehnično vseboval en odstavek, tako da boste, ko programsko ustvarite HTML dokument, dobili točno to osnovno strukturo dokumenta.
Upoštevajte, da lahko takoj dodate vsebino v novo ustvarjeno HTML datoteko. Tako ne boste dobili le praznega dokumenta, temveč dokument s potrebno vsebino. Za več informacij o urejanju dokumenta glejte stran Urejanje.
Ta knjižnica Java vam omogoča programsko ustvarjanje HTML dokumentov. Preizkusite našo zmogljivo funkcionalnost in si oglejte, kako ustvariti HTML v nekaterih formatih z naslednjim primerom:
// Repository path: https://releases.aspose.com/java/repo/
// Maven, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>ver</version>
<classifier>jdk17</classifier>
</dependency>
Kopirati
// Repository path: https://releases.aspose.com/java/repo/
// Gradle, where 'ver' - Aspose.Words version number, for example, 24.4.
compile(group: 'com.aspose', name: 'aspose-words', version: 'ver', classifier: 'jdk17')
Kopirati
// Repository path: https://releases.aspose.com/java/repo/
// Ivy, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency org="com.aspose" name="aspose-words" rev="ver">
<artifact name="aspose-words" m:classifier="jdk17" ext="jar"/>
</dependency>
Kopirati
// Repository path: https://releases.aspose.com/java/repo/
// Sbt, where 'ver' - Aspose.Words version number, for example, 24.4.
libraryDependencies += "com.aspose" % "aspose-words" % "ver"
Kopirati
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Font font = builder.getFont();
font.setName("Courier New");
font.setColor(Color.BLUE);
font.setSize(36);
font.setHighlightColor(Color.YELLOW);
builder.write("Morbi enim nunc faucibus a.");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.getOutlineOptions().getBookmarksOutlineLevels().add("Aspose bookmark", 1);
doc.save("Output.html", saveOptions);
import com.aspose.words.*;
Document doc = new Document();
Run run = new Run(doc, "Proin eros metus, sagittis sed.");
Paragraph para = doc.getFirstSection().getBody().getFirstParagraph();
para.appendChild(run);
Comment comment = new Comment(doc);
comment.setAuthor("John Doe");
comment.setInitial("JD");
comment.setDateTime(new Date());
comment.setText("Quisque fringilla leo.");
CommentRangeStart commentRangeStart = new CommentRangeStart(doc, comment.getId());
CommentRangeEnd commentRangeEnd = new CommentRangeEnd(doc, comment.getId());
run.getParentNode().insertBefore(commentRangeStart, run);
run.getParentNode().insertAfter(commentRangeEnd, run);
commentRangeEnd.getParentNode().insertAfter(comment, commentRangeEnd);
comment.addReply("Jane Doe", "JD", new Date(), "Pellentesque vel sapien justo.");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.getOutlineOptions().getBookmarksOutlineLevels().add("Aspose bookmark", 1);
doc.save("Output.html", saveOptions);
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.getOutlineOptions().getBookmarksOutlineLevels().add("Aspose bookmark", 1);
doc.save("Output.html", saveOptions);
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertChart(ChartType.PIE, 432, 252);
Chart chart = shape.getChart();
chart.getTitle().setText("Demo Chart");
chart.getSeries().clear();
chart.getSeries().add("Series 1",
new String[] { "Category1", "Category2", "Category3" },
new double[] { 2.7, 3.2, 0.8 });
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
doc.save("Output.html");
import com.aspose.words.*;
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Run firstRun = new Run(doc, "Proin eros metus, sagittis sed. ");
Run secondRun = new Run(doc, "Morbi enim nunc faucibus a.");
doc.getFirstSection().getBody().getFirstParagraph().appendChild(firstRun);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(secondRun);
builder.moveTo(secondRun);
builder.startBookmark("Aspose bookmark");
// Če je NextSibling nič, je to najverjetneje zadnji Run v odstavku.
if (secondRun.getNextSibling() != null)
builder.moveTo(secondRun.getNextSibling());
else
builder.moveTo(secondRun.getParentParagraph());
builder.endBookmark("Aspose bookmark");
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.getOutlineOptions().getBookmarksOutlineLevels().add("Aspose bookmark", 1);
doc.save("Output.html", saveOptions);
Podprte so Java SE 7 in novejše Java Ponujamo tudi ločen paket za Java SE 6 če morate uporabiti to zastarelo JRE.
Naš Java je med platformami in deluje v vseh operacijskih sistemih z JVM, vključno z Microsoft Windows, Linux, macOS, Android in iOS.
Za informacije o izbirnih odvisnostih paketov, kot so JogAmp JOGL, Harfbuzz pisav Java Advanced Imaging JAI, glejte dokumentacijo izdelka.
Ustvarite lahko dokumente v drugih oblikah datotek: