გააკეთეთ HTML Node.js via .NET ბიბლიოთეკის გამოყენებით

ჩვენი მძლავრი JavaScript ბიბლიოთეკა დეველოპერებს საშუალებას აძლევს პროგრამულად შექმნან HTML მხოლოდ რამდენიმე ნაბიჯით

Node.js via .NET დეველოპერებს შეუძლიათ მარტივად შექმნან HTML მხოლოდ ჩვენი ძლიერი პროდუქტის API ს გამოყენებით. ეს ნიშნავს, რომ ჩვენი გადაწყვეტა პროგრამისტებს მიაწვდის ყველაფერს, რაც მათ სჭირდებათ HTML ის შესაქმნელად JavaScript ში.

კოდის ნაწყვეტის ნახვა

შექმენით HTML JavaScript ში პროგრამულად

ჩვენი JavaScript ბიბლიოთეკის დეველოპერებს შეუძლიათ მარტივად შექმნან HTML ნულიდან. ამისათვის Node.js via .NET დეველოპერებმა უნდა შეასრულონ რამდენიმე ნაბიჯი:

  1. ფაილის სახელის დამატება
  2. დაიწყეთ HTML დოკუმენტის შექმნა JavaScript ის გამოყენებით
  3. შეინახეთ გამომავალი HTML ფაილი

აღსანიშნავია, რომ ცარიელი დოკუმენტი ტექნიკურად უნდა შეიცავდეს ერთ აბზაცს, ასე რომ, როდესაც თქვენ პროგრამულად შექმნით HTML დოკუმენტს, თქვენ მიიღებთ ზუსტად ამ დოკუმენტის ძირითად სტრუქტურას.

გაითვალისწინეთ, რომ თქვენ შეგიძლიათ მყისიერად დაამატოთ შინაარსი ახლად შექმნილ HTML ფაილში. ამრიგად, თქვენ მიიღებთ არა მხოლოდ ცარიელ დოკუმენტს, არამედ საჭირო შინაარსის შემცველ დოკუმენტს. დამატებითი ინფორმაციისთვის დოკუმენტის რედაქტირების შესახებ იხილეთ რედაქტირების გვერდი.

შექმენით HTML JavaScript ში

ეს Node.js via .NET ბიბლიოთეკა საშუალებას გაძლევთ პროგრამულად შექმნათ HTML დოკუმენტები. სცადეთ ჩვენი ძლიერი ფუნქციონირება და ნახეთ, როგორ შექმნათ HTML ზოგიერთ ფორმატში შემდეგი მაგალითის გამოყენებით:

შექმენით ახალი HTML JavaScript ის გამოყენებით
აირჩიეთ სამიზნე ფორმატი სიიდან
გაუშვით კოდი
npm install @aspose/words
კოპირება
const aw = require('@aspose/words');

var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)

font = builder.font
font.name = "Courier New"
font.color = '#FF0000'
font.size = 36
font.highlightColor = '#F0DB4F'

builder.write("Morbi enim nunc faucibus a.")

doc.save("Output.html")
const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") doc.save("Output.html") const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") var saveOptions = new aw.Saving.PdfSaveOptions() saveOptions.outlineOptions.bookmarksOutlineLevels.add("Aspose bookmark", 1); doc.save("Output.html", saveOptions)
const aw = require('@aspose/words');

var doc = new aw.Document()

var run = new aw.Run(doc, "Proin eros metus, sagittis sed.")
var para = doc.firstSection.body.firstParagraph
para.appendChild(run)

var comment = new aw.Comment(doc)
comment.author = "John Doe"
comment.initial = "JD"
comment.dateTime = new Date()
comment.setText("Quisque fringilla leo.")

var commentRangeStart = new aw.CommentRangeStart(doc, comment.id)
var commentRangeEnd = new aw.CommentRangeEnd(doc, comment.id)

run.parentNode.insertBefore(commentRangeStart, run)
run.parentNode.insertAfter(commentRangeEnd, run)
commentRangeEnd.parentNode.insertAfter(comment, commentRangeEnd)

comment.addReply("Jane Doe", "JD", new Date(), "Pellentesque vel sapien justo.")

doc.save("Output.html")
const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") doc.save("Output.html") const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") var saveOptions = new aw.Saving.PdfSaveOptions() saveOptions.outlineOptions.bookmarksOutlineLevels.add("Aspose bookmark", 1); doc.save("Output.html", saveOptions)
const aw = require('@aspose/words');

var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)

var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ")
var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.")
doc.firstSection.body.firstParagraph.appendChild(firstRun)
doc.firstSection.body.firstParagraph.appendChild(secondRun)

builder.moveTo(secondRun)
builder.startBookmark("Aspose bookmark")
// Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება.
if (secondRun.nextSibling != null)
    builder.moveTo(secondRun.nextSibling)
else
    builder.moveTo(secondRun.parentParagraph)
builder.endBookmark("Aspose bookmark")

doc.save("Output.html")
const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") doc.save("Output.html") const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") var saveOptions = new aw.Saving.PdfSaveOptions() saveOptions.outlineOptions.bookmarksOutlineLevels.add("Aspose bookmark", 1); doc.save("Output.html", saveOptions)
const aw = require('@aspose/words');

var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)

shape = builder.insertChart(aw.Drawing.Charts.ChartType.Pie, 432, 252)
chart = shape.chart
chart.title.text = "Demo Chart"

chart.series.clear()
chart.series.add("Series 1",
    ["Category1", "Category2", "Category3"],
    [2.7, 3.2, 0.8])

doc.save("Output.html")
const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") doc.save("Output.html") const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) var firstRun = new aw.Run(doc, "Proin eros metus, sagittis sed. ") var secondRun = new aw.Run(doc, "Morbi enim nunc faucibus a.") doc.firstSection.body.firstParagraph.appendChild(firstRun) doc.firstSection.body.firstParagraph.appendChild(secondRun) builder.moveTo(secondRun) builder.startBookmark("Aspose bookmark") // Თუ NextSibling არის null, მაშინ, სავარაუდოდ, ეს არის აბზაცის ბოლო გაშვება. if (secondRun.nextSibling != null) builder.moveTo(secondRun.nextSibling) else builder.moveTo(secondRun.parentParagraph) builder.endBookmark("Aspose bookmark") var saveOptions = new aw.Saving.PdfSaveOptions() saveOptions.outlineOptions.bookmarksOutlineLevels.add("Aspose bookmark", 1); doc.save("Output.html", saveOptions)
გაუშვით კოდი

როგორ გავაკეთოთ HTML JavaScript ში

  1. დააინსტალირეთ Aspose.Words for Node.js via .NET
  2. დაამატეთ ბიბლიოთეკის მითითება (ბიბლიოთეკის იმპორტი) თქვენს JavaScript პროექტს
  3. შექმენით ახალი HTML დოკუმენტი
  4. გამოიძახეთ save() მეთოდი, გადასვით ფაილის სახელი
  5. მიიღეთ შედეგი ცალკე ფაილის სახით

JavaScript ბიბლიოთეკა HTML ის შესაქმნელად

We host our Node.js via .Net packages in NPM repositories. Please follow the step-by-step instructions on how to install "Aspose.Words for Node.js via .NET" to your developer environment.

System Requirements

This package is compatible with Node.js 14.17.0 or higher.

სხვა მხარდაჭერილი ფაილის ფორმატები

თქვენ შეგიძლიათ შექმნათ დოკუმენტები ფაილის სხვა ფორმატებში:

5%

გამოიწერეთ Aspose პროდუქტის განახლებები

მიიღეთ ყოველთვიური გაზეთები და შეთავაზებები პირდაპირ თქვენს საფოსტო ყუთში.