---
title: "สวัสดีโลก!"
---

"สวัสดีโลก!"รหัสมักจะเป็นตัวอย่างง่ายๆแรกที่จะเขียนโดย"Aspose.WordsสำหรับJava"และมันยังสามารถใช้เป็นแบบทดสอบสติเพื่อให้แน่ใจว่าซอฟต์แวร์ที่มีวัตถุประสงค์เพื่อรวบรวมหรือเรียกใช้รหัสแหล่งที่มาได้รับการติดตั้งอย่างถูกต้อง.

"Aspose.WordsสำหรับJava"ห้องสมุดช่วยให้นักพัฒนาเข้าถึงโดยตรงในการสร้าง,แก้ไข,ผสาน,แปลง,เปรียบเทีย PDF, DOCX, DOC, RTF, ODT, EPUB, HTML และรูปแบบไฟล์อื่นๆอีกมากมาย [รองรับ](/words/th/java/supported-document-formats/).

เป็นlow codeตัวอย่างทำตามขั้นตอนเหล่านี้:

1. สร้างใหม่ว่างเปล่า[Document](https://reference.aspose.com/words/java/com.aspose.words/document/)
1. เริ่มใช้งานคลาส[DocumentBuilder](https://reference.aspose.com/words/java/com.aspose.words/documentbuilder/)
1. แทรกข้อความลงในเอกสารเริ่มด้วยวิธีง่ายๆ[Write](https://reference.aspose.com/words/java/com.aspose.words/documentbuilder/#write-java.lang.String)
1. เปิด[Document](https://reference.aspose.com/words/java/com.aspose.words/document/#Document-java.lang.String)ที่มีอยู่จากแฟ้ม ตรวจหารูปแบบไฟล์โดยอัตโนมัติ
1. [Append](https://reference.aspose.com/words/java/com.aspose.words/document/#appendDocument-com.aspose.words.Document-int)เอกสาร"A"ไปยังและของเอกสาร"B"
1. [Save](https://reference.aspose.com/words/java/com.aspose.words/document/#save-java.lang.String)ผลลัพธ์เป็นPDF

ข้อมูลโค้ดต่อไปนี้คือ"สวัสดีโลก!"ตัวอย่างการแสดงการทำงานของ"Aspose.WordsสำหรับJava"API:

{{< gist "aspose-words-gists" "4e111aa3d11a41428c8a0cadfc23b972" "hello-world.java" >}}
