GroupDocs.Editor ตระกูลผลิตภัณฑ์คลาวด์

ข่าวดีสำหรับ Cloud Developers! GroupDocs ได้เปิดตัว Document Editing Cloud API ซึ่งช่วยปรับปรุง โซลูชันการแก้ไขเอกสาร ของ GroupDocs โซลูชันนี้มีอยู่แล้วสำหรับนักพัฒนา .NET และ Java ในฐานะ on-premises API และในฐานะ แอปออนไลน์ข้ามแพลตฟอร์ม เพื่อให้ผู้ใช้ทุกประเภทสามารถแก้ไขเอกสารออนไลน์ได้ฟรี GroupDocs.Editor Cloud API พร้อมกับ SDK ช่วยให้นักพัฒนาสามารถแก้ไขรูปแบบเอกสารยอดนิยมส่วนใหญ่โดยใช้ตัวแก้ไข WYSIWYG ส่วนหน้าโดยไม่ต้องมีแอปพลิเคชันเพิ่มเติม

GroupDocs.Editor Cloud เป็น REST API ที่มีตัวเลือกการแก้ไขมากมายและการปรับแต่งเอาต์พุตเพื่อปรับแต่งกระบวนการแก้ไขของเอกสารประเภทต่างๆ คุณสมบัติหลักบางประการ ได้แก่ :

  • แก้ไขเอกสารการประมวลผลคำในโหมดโฟลว์หรือเพจ
  • จัดการการแยกฟอนต์เพื่อให้ผู้ใช้ได้รับประสบการณ์เดียวกัน
  • การเพิ่มประสิทธิภาพการใช้หน่วยความจำของไฟล์ขนาดใหญ่
  • รองรับสเปรดชีตแบบหลายแท็บ
  • การแปลงตัวเลขและวันที่ที่ยืดหยุ่น
  • URI และการรับรู้ที่อยู่อีเมล

เพื่อให้ได้แนวคิดที่ดีขึ้นเกี่ยวกับคุณสมบัติและผลิตภัณฑ์ คุณสามารถไปที่คู่มือสำหรับนักพัฒนาในส่วน เอกสารประกอบ ได้เสมอ

ประเภทเอกสารที่รองรับ

นี่คือรูปแบบเอกสารที่รองรับในปัจจุบัน คุณสามารถเยี่ยมชมเอกสารสำหรับ GroupDocs.Editor Cloud ได้ตลอดเวลาเพื่อทราบเกี่ยวกับ รูปแบบเอกสารที่รองรับ ทั้งหมด

SDK และตัวอย่าง

นอกเหนือจากการแก้ไขเอกสาร REST API สำหรับ Cloud แล้ว GroupDocs ยังมี SDK แบบโอเพ่นซอร์ส ดังนั้นจึงสามารถปรับแต่งสิ่งเหล่านี้ได้เองตามข้อกำหนด นักพัฒนาสามารถใช้ cURL เพื่อโต้ตอบกับ GroupDocs.Editor Cloud API และยังสามารถใช้ SDK ที่เกี่ยวข้องเพื่อเร่งการพัฒนา สิ่งนี้ช่วยให้นักพัฒนาเลิกกังวลเกี่ยวกับรายละเอียดระดับต่ำของการร้องขอและการจัดการการตอบกลับ SDK ที่กล่าวถึงด้านล่างพร้อมกับตัวอย่างโค้ด พร้อมใช้งานบน GitHub:

แก้ไขเอกสาร Word ใน C#

ที่นี่ คุณสามารถดูตัวอย่างโค้ด C# เพื่อแก้ไขเอกสารคำโดยใช้ GroupDocs.Editor Cloud SDK for .NET สามารถทำเช่นเดียวกันได้อย่างง่ายดายใน Java, PHP, Python, Ruby และ Node.js โดยใช้ SDK ที่เกี่ยวข้องที่มีอยู่ วิธีนี้จะแปลงเอกสารต้นฉบับในรูปแบบ HTML และอนุญาตให้แก้ไขได้ หลังจากนั้นจะแปลงเอกสารที่อัปเดตแล้วกลับเป็นรูปแบบเดิม

// สำหรับตัวอย่างและไฟล์ข้อมูลทั้งหมด โปรดไปที่ https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-dotnet-samples
string MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
string MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
var configuration = new Configuration(MyAppSid, MyAppKey);
 
// สร้างอินสแตนซ์ API ที่จำเป็น
var editApi = new EditApi(configuration );
var fileApi = new FileApi(configuration );
 
// เอกสารถูกอัปโหลดไปยังพื้นที่จัดเก็บแล้ว
// โหลดลงในสถานะที่สามารถแก้ไขได้
var loadOptions = new WordProcessingLoadOptions
{
    FileInfo = new FileInfo
    {
        FilePath = "WordProcessing/password-protected.docx",
        Password = "password"
    },
    OutputPath = "output"
};
var loadResult = editApi.Load(new LoadRequest(loadOptions));
 
// ดาวน์โหลดเอกสาร html
var stream = fileApi.DownloadFile(new DownloadFileRequest(loadResult.HtmlPath));
var htmlString = new StreamReader(stream, Encoding.UTF8).ReadToEnd();
 
// แก้ไขบางอย่าง...
htmlString = htmlString.Replace("Sample test text", "Hello world");
 
// อัปโหลด html กลับไปยังที่เก็บข้อมูล
fileApi.UploadFile(new UploadFileRequest(loadResult.HtmlPath,
    new MemoryStream(Encoding.UTF8.GetBytes(htmlString))));
 
// บันทึก html กลับไปที่ docx
var saveOptions = new WordProcessingSaveOptions
{
    FileInfo = loadOptions.FileInfo,
    OutputPath = "output/edited.docx",
    HtmlPath = loadResult.HtmlPath,
    ResourcesPath = loadResult.ResourcesPath
};
var saveResult = editApi.Save(new SaveRequest(saveOptions));

อัปเดตเอกสารสเปรดชีต Excel ใน Java

ด้านล่างนี้คือข้อมูลโค้ดที่แสดงวิธีแก้ไขเอกสารสเปรดชีตอย่างรวดเร็วในแอปพลิเคชัน Java ของคุณด้วย GroupDocs.Editor Cloud SDK for Java

// สำหรับตัวอย่างและไฟล์ข้อมูลทั้งหมด โปรดไปที่ https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-java-samples
String MyAppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
String MyAppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
Configuration configuration = new Configuration(MyAppSid, MyAppKey);
 
 
// สร้างอินสแตนซ์ API ที่จำเป็น
EditApi editApi = new EditApi(configuration);
FileApi fileApi = new FileApi(configuration);
 
// เอกสารถูกอัปโหลดไปยังพื้นที่จัดเก็บแล้ว
// โหลดลงในสถานะที่สามารถแก้ไขได้
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("Spreadsheet/four-sheets.xlsx");           
SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions();
loadOptions.setFileInfo(fileInfo);
loadOptions.setOutputPath("output");
LoadResult loadResult = editApi.load(new LoadRequest(loadOptions));
 
// ดาวน์โหลดเอกสาร html
File file = fileApi.downloadFile(new DownloadFileRequest(loadResult.getHtmlPath(), null, null));
             
// แก้ไขบางอย่าง...
List<String> lines = Files.readAllLines(file.toPath());
List<String> newLines = new ArrayList<String>();
for (String line : lines) {
    newLines.add(line.replaceAll("This is sample sheet", "This is sample sheep"));
}
Files.write(file.toPath(), newLines);
 
// อัปโหลด html กลับไปยังที่เก็บข้อมูล
fileApi.uploadFile(new UploadFileRequest(loadResult.getHtmlPath(), file, Common.MYStorage));
 
// บันทึก html กลับเป็น xlsx
SpreadsheetSaveOptions saveOptions = new SpreadsheetSaveOptions();
saveOptions.setFileInfo(fileInfo);
saveOptions.setOutputPath("output/edited.xlsx");    
saveOptions.setHtmlPath(loadResult.getHtmlPath());      
saveOptions.setResourcesPath(loadResult.getResourcesPath());
DocumentResult saveResult = editApi.save(new SaveRequest(saveOptions));
 
System.out.println("Document edited: " + saveResult.getPath());

แก้ไขงานนำเสนอใน Python

นี่คือตัวอย่างโค้ดเพื่อแสดงวิธีแก้ไขงานนำเสนอ PowerPoint หรือ OpenDocument ใน Python

# สำหรับตัวอย่างและไฟล์ข้อมูลทั้งหมด โปรดไปที่ https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-python-samples
import groupdocs_editor_cloud
 
app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud
app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from https://dashboard.groupdocs.cloud
  
editApi = groupdocs_editor_cloud.EditApi.from_keys(app_sid, app_key)
fileApi = groupdocs_editor_cloud.FileApi.from_keys(app_sid, app_key)
 
# เอกสารถูกอัปโหลดไปยังพื้นที่จัดเก็บแล้ว
# โหลดลงในสถานะที่สามารถแก้ไขได้
fileInfo = groupdocs_editor_cloud.FileInfo("Presentation/with-notes.pptx")
loadOptions = groupdocs_editor_cloud.PresentationLoadOptions()
loadOptions.file_info = fileInfo
loadOptions.output_path = "output"
loadOptions.slide_number = 0
loadResult = editApi.load(groupdocs_editor_cloud.LoadRequest(loadOptions))        
 
# ดาวน์โหลดเอกสาร html
htmlFile = fileApi.download_file(groupdocs_editor_cloud.DownloadFileRequest(loadResult.html_path))
html = ""       
with open(htmlFile, 'r') as file:
    html = file.read()
 
# แก้ไขบางอย่าง...    
html = html.replace("Slide sub-heading", "Hello world!")
 
# อัปโหลด html กลับไปยังที่เก็บข้อมูล
with open(htmlFile, 'w') as file:
    file.write(html)
 
fileApi.upload_file(groupdocs_editor_cloud.UploadFileRequest(loadResult.html_path, htmlFile))
 
# บันทึก html กลับไปเป็น pptx
saveOptions = groupdocs_editor_cloud.PresentationSaveOptions()
saveOptions.file_info = fileInfo
saveOptions.output_path = "output/edited.pptx"
saveOptions.html_path = loadResult.html_path
saveOptions.resources_path = loadResult.resources_path
saveResult = editApi.save(groupdocs_editor_cloud.SaveRequest(saveOptions))
 
# เสร็จแล้ว
print("Document edited: " + saveResult.path)

ทรัพยากร

ต่อไปนี้เป็นลิงก์ที่สำคัญบางส่วนไปยังแหล่งข้อมูลที่เกี่ยวข้อง:

ยินดีที่ได้พบคุณที่นี่สำหรับ Document Editing Cloud API คุณสามารถติดต่อเราได้อย่างอิสระบน ฟอรัม ในกรณีที่คุณรู้สึกลำบากหรือสับสน หรือต้องการให้คำแนะนำที่ดี ขอบคุณ.