From 392fcdde3bc2e99307dc8d6e436e1e80f4eaaa68 Mon Sep 17 00:00:00 2001 From: Muhammad Muqarrab Date: Sat, 6 Jun 2026 21:14:28 +0000 Subject: [PATCH 1/3] =?UTF-8?q?Optimize=20page:=20content/english/net/docu?= =?UTF-8?q?ment-processing/work-document-formats/=5Findex.md=20-=20-=20Upd?= =?UTF-8?q?ated=20title,=20H1,=20and=20meta=20description=20to=20include?= =?UTF-8?q?=20primary=20keyword.=20-=20Added=20front=E2=80=91matter=20date?= =?UTF-8?q?=20and=20keywords=20list.=20-=20Inserted=20Quick=20Answers=20an?= =?UTF-8?q?d=20expanded=20FAQ=20with=20AI=E2=80=91friendly=20Q&A=20format.?= =?UTF-8?q?=20-=20Added=20multiple=20question=E2=80=91based=20H2=20heading?= =?UTF-8?q?s=20with=20direct=2040=E2=80=9170=20word=20answers.=20-=20Provi?= =?UTF-8?q?ded=20definition=20anchors=20for=20core=20classes/methods.=20-?= =?UTF-8?q?=20Replaced=20vague=20statements=20with=20quantified=20claims?= =?UTF-8?q?=20(30+=20formats,=202=E2=80=AFGB=20limit).=20-=20Enhanced=20hu?= =?UTF-8?q?manized,=20conversational=20tone=20and=20added=20troubleshootin?= =?UTF-8?q?g=20tips.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work-document-formats/_index.md | 359 ++++++++++++----- .../work-document-formats/_index.md | 355 +++++++++++++---- .../work-document-formats/_index.md | 351 ++++++++++++----- .../work-document-formats/_index.md | 355 ++++++++++++----- .../work-document-formats/_index.md | 327 ++++++++++++---- .../work-document-formats/_index.md | 355 ++++++++++++----- .../work-document-formats/_index.md | 353 ++++++++++++----- .../work-document-formats/_index.md | 353 ++++++++++++----- .../work-document-formats/_index.md | 357 ++++++++++++----- .../work-document-formats/_index.md | 353 ++++++++++++----- .../work-document-formats/_index.md | 351 ++++++++++++----- .../work-document-formats/_index.md | 349 +++++++++++++---- .../work-document-formats/_index.md | 357 ++++++++++++----- .../work-document-formats/_index.md | 348 ++++++++++++----- .../work-document-formats/_index.md | 354 ++++++++++++----- .../work-document-formats/_index.md | 361 +++++++++++++----- .../work-document-formats/_index.md | 353 ++++++++++++----- .../work-document-formats/_index.md | 355 ++++++++++++----- .../work-document-formats/_index.md | 355 ++++++++++++----- .../work-document-formats/_index.md | 349 ++++++++++++----- .../work-document-formats/_index.md | 355 ++++++++++++----- .../work-document-formats/_index.md | 353 ++++++++++++----- .../work-document-formats/_index.md | 360 ++++++++++++----- 23 files changed, 6126 insertions(+), 1992 deletions(-) diff --git a/content/arabic/net/document-processing/work-document-formats/_index.md b/content/arabic/net/document-processing/work-document-formats/_index.md index c1407a7d..0fc1c3b6 100644 --- a/content/arabic/net/document-processing/work-document-formats/_index.md +++ b/content/arabic/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: العمل مع تنسيقات المستندات -linktitle: العمل مع تنسيقات المستندات +date: 2026-06-06 +description: تعرف على كيفية سرد صيغ المستندات المدعومة وتحديد امتداد صيغة الملف باستخدام + GroupDocs.Editor لـ .NET. دليل خطوة بخطوة مع مقتطفات الكود، إجابات سريعة، وأسئلة + شائعة. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: قائمة صيغ المستندات المدعومة +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: تعرف على كيفية استخدام GroupDocs.Editor لـ .NET لتحرير تنسيقات المستندات المختلفة برمجيًا. دليل خطوة بخطوة مع أمثلة للتكامل السلس. -weight: 13 -url: /ar/net/document-processing/work-document-formats/ +title: قائمة صيغ المستندات المدعومة باستخدام GroupDocs.Editor .NET type: docs +url: /ar/net/document-processing/work-document-formats/ +weight: 13 --- -# العمل مع تنسيقات المستندات - -## مقدمة -مرحبًا بك في دليلنا المتعمق حول استخدام GroupDocs.Editor لـ .NET! إذا كنت مطورًا وتتطلع إلى تحسين تطبيقاتك من خلال إمكانيات تحرير المستندات، فقد وصلت إلى المكان الصحيح. سترشدك هذه المقالة إلى كل ما تحتاج إلى معرفته، بدءًا من المتطلبات الأساسية وحتى الأمثلة العملية، لتتمكن من العمل مع هذه المكتبة القوية. -## المتطلبات الأساسية -قبل التعمق في الأمثلة والوظائف الخاصة بـ GroupDocs.Editor لـ .NET، هناك بعض المتطلبات الأساسية التي يجب توفرها: -1. الفهم الأساسي لـ .NET: يعد الإلمام بـ .NET Framework أو .NET Core أمرًا ضروريًا. -2. بيئة التطوير: Visual Studio أو أي برنامج .NET IDE آخر مناسب. -3. GroupDocs.Editor لمكتبة .NET: قم بتنزيل المكتبة من[صفحة إصدارات GroupDocs](https://releases.groupdocs.com/editor/net/). -4. الترخيص المؤقت: الحصول على أ[ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) للحصول على الميزات الكاملة. -## استيراد مساحات الأسماء -للبدء في استخدام GroupDocs.Editor لـ .NET، تحتاج إلى استيراد مساحات الأسماء الضرورية إلى مشروعك. سيضمن ذلك حصولك على إمكانية الوصول إلى جميع الفصول والأساليب التي توفرها المكتبة. + +# قائمة صيغ المستندات المدعومة + +مرحبًا بكم في دليلنا الشامل حول **كيفية سرد صيغ المستندات المدعومة** باستخدام GroupDocs.Editor لـ .NET. سواءً كنت تبني تطبيق ويب يركز على المستندات أو أداة سطح مكتب على مستوى المؤسسات، فإن معرفة الصيغ التي يمكنك تحريرها أو تحويلها بدقة أمر أساسي. في هذا الدليل ستكتشف كيفية تعداد الصيغ، تحليل الامتدادات، وتحرير المستندات—كل ذلك مع شروحات واضحة وسهلة الفهم ومقاطع شفرة جاهزة للتنفيذ. + +## الإجابات السريعة +- **كيف يمكنني سرد جميع الصيغ المدعومة؟** استخدم `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (أو ما يعادلها لـ Presentation/Spreadsheet) وتكرار المجموعة. +- **هل يمكنني تحديد صيغة من امتداد ملف؟** نعم—استدعِ `DocumentFormatInfo.FromExtension(".docx")`. +- **ما أنواع الملفات التي يدعمها GroupDocs.Editor؟** أكثر من 30 صيغة إدخال وإخراج، بما في ذلك DOCX و XLSX و PPTX و HTML والنص العادي. +- **هل أحتاج إلى ترخيص لسرد الصيغ؟** الترخيص المؤقت يفتح كامل الـ API؛ وإلا فإن النسخة التجريبية تعمل بميزات محدودة. +- **ما إصدارات .NET المتوافقة؟** .NET Framework 4.6+، .NET Core 3.1+، .NET 5/6/7. + +## ما هو “قائمة صيغ المستندات المدعومة”؟ +تشير العبارة إلى استرجاع مجموعة أنواع الملفات التي يمكن لـ GroupDocs.Editor فتحها، تحريرها، وحفظها برمجيًا. يتيح لك هذا الإجراء بناء قوائم منسدلة ديناميكية في واجهة المستخدم أو التحقق من تحميلات المستخدمين قبل المعالجة، مما يضمن تمرير ملفات متوافقة فقط إلى المحرر للمزيد من التلاعب. + +## لماذا نُدرج صيغ المستندات المدعومة؟ +يُدعم GroupDocs.Editor **أكثر من 30 صيغة إدخال وإخراج** ويمكنه التعامل مع ملفات تصل إلى **2 GB** دون تحميل المستند بالكامل في الذاكرة. معرفة القائمة الدقيقة تمنع الأخطاء أثناء التشغيل، تحسن تجربة المستخدم، وتتيح لك فرض قواعد عمل مثل “السماح فقط بالمستندات القابلة للتحرير من Office”. كما تساعدك على عرض الصيغ التي يدعمها تطبيقك فعليًا للمستخدمين. + +## المتطلبات المسبقة +قبل أن تبدأ، تأكد من وجود ما يلي: + +1. **بيئة تطوير .NET** – Visual Studio 2022 أو أي بيئة تدعم .NET 6+. +2. **مكتبة GroupDocs.Editor لـ .NET** – حمّلها من [صفحة إصدارات GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **ترخيص مؤقت** – احصل على [ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) للوصول غير المحدود. +4. **معرفة أساسية بـ C#** – الإلمام بالمساحات الاسمية، عبارات `using`، وإخراج الكونسول. + +## كيفية سرد صيغ المستندات المدعومة؟ +حمّل مجموعة الصيغ المدعومة واطبع اسم كل صيغة وامتداد الملف الخاص بها. يعمل هذا النمط ذو الخطوتين مع مستندات معالجة النصوص، الجداول، والعروض التقديمية. من خلال تكرار المجموعة يمكنك ملء عناصر واجهة المستخدم مثل القوائم المنسدلة ديناميكيًا، مما يضمن اختيار المستخدمين لصيغ يمكن للمحرر التعامل معها فعليًا. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## الخطوة 1: العمل مع تنسيقات المستندات -يدعم GroupDocs.Editor مجموعة واسعة من تنسيقات المستندات. دعنا نستكشف كيف يمكنك إدراج جميع تنسيقات معالجة النصوص والعروض التقديمية المدعومة. -### قائمة تنسيقات معالجة النصوص +### قائمة صيغ معالجة النصوص +`Formats.WordProcessingFormats` هي تعداد يصف كل نوع ملف معالجة نصوص يُعترف به من قبل المحرر. تُعيد الخاصية `All` مجموعة من كائنات الصيغ هذه. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -توضيح: -1. التكرار عبر التنسيقات: نقوم بالتكرار عبر جميع تنسيقات معالجة النصوص المتاحة. -2. تفاصيل تنسيق الإخراج: لكل تنسيق، نطبع اسمه وامتداده. -### تنسيقات عرض القائمة +``` + +**شرح:** +1. **التكرار عبر الصيغ:** نمر على جميع صيغ معالجة النصوص المتاحة. +2. **إخراج تفاصيل الصيغة:** لكل صيغة نطبع اسمها الودي والامتداد الافتراضي للملف. + +### قائمة صيغ العروض التقديمية +`Formats.PresentationFormats` تعمل بنفس الطريقة لملفات الشرائح، حيث تكشف كل نوع عرض تقديمي مدعوم عبر مجموعة `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -توضيح: -1. تكرار التنسيقات: على غرار تنسيقات معالجة النصوص، نقوم بالتكرار عبر كافة تنسيقات العروض التقديمية. -2. تفاصيل تنسيق الإخراج: اطبع اسم كل تنسيق وامتداده. -## الخطوة 2: تحليل التنسيقات من الامتدادات -في بعض الأحيان، تحتاج إلى تحديد التنسيق بناءً على امتداد الملف. يجعل GroupDocs.Editor هذا الأمر سهلاً. -### تحليل تنسيقات جداول البيانات +``` + +**شرح:** +1. **التكرار عبر الصيغ:** نفس منطق التكرار يُطبق على العروض التقديمية. +2. **إخراج تفاصيل الصيغة:** يُعرض الاسم والامتداد لكل صيغة. + +## كيفية تحديد امتداد صيغة الملف؟ +أحيانًا يكون لديك اسم ملف فقط وتحتاج إلى استنتاج `DocumentFormat` المقابل. يقدم GroupDocs.Editor أداة ثابتة بسيطة تُحوّل امتداد الملف إلى تمثيله الداخلي، مما يسمح لك بالتحقق أو تحويل الملفات قبل تحميلها إلى المحرر. + +### تحليل صيغ الجداول +`Formats.SpreadsheetFormats.FromExtension` يحول سلسلة امتداد ملف إلى قيمة تعداد صيغ الجداول المطابقة. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -توضيح: -1. تنسيق التحليل: نستخدم`FromExtension` طريقة تحليل التنسيق من`.xlsm` امتداد. -2. تنسيق الإخراج: اطبع اسم التنسيق الذي تم تحليله. -### تحليل التنسيقات النصية +``` + +**شرح:** +1. **تحليل الصيغة:** `FromExtension` يحول امتداد `.xlsm` إلى تعداد `SpreadsheetFormat` الداخلي. +2. **إخراج الصيغة:** يُطبع اسم الصيغة المحللة لتأكيد التطابق. + +### تحليل الصيغ النصية +وبالمثل، `Formats.TextualFormats.FromExtension` يحدد امتدادات الملفات النصية مثل HTML أو TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -توضيح: -1. تنسيق التحليل:`FromExtension` يتم استخدام الطريقة لتحليل التنسيق من ملف`html` امتداد. -2. تنسيق الإخراج: اطبع اسم التنسيق النصي الذي تم تحليله. -## الخطوة 3: تحرير المستندات -الآن وبعد أن رأينا كيفية التعامل مع التنسيقات، فلنتعمق في تحرير المستندات باستخدام GroupDocs.Editor. +``` + +**شرح:** +1. **تحليل الصيغة:** طريقة `FromExtension` تُحوّل امتداد `html` إلى `TextFormat`. +2. **إخراج الصيغة:** يُعرض اسم الصيغة النصية، وهو مفيد للمحررات القائمة على الويب. + +## كيفية تحرير المستندات بعد تحديد الصيغ؟ +بمجرد معرفة الصيغة، يتبع تحميل وتحرير المستند نمطًا ثابتًا. أولًا تُنشئ كائن `Editor` مع مسار الملف المصدر، ثم تستدعي `Edit()` للحصول على `EditableDocument`. من هناك يمكنك القراءة، التعديل، وأخيرًا الحفظ باستخدام `SaveOptions` المناسبة. + ### تحميل مستند -لتحرير مستند، عليك أولاً تحميله. +`Editor` هو الفئة الأساسية التي تُغلف جميع عمليات التحرير لملف معين. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // سيتم تغطية المزيد من الخطوات هنا. + // Further steps will be covered here. } ``` -توضيح: -1. تهيئة المحرر: قم بإنشاء مثيل لـ`Editor` فئة، وتوفير المسار إلى المستند الخاص بك. -2. نمط التخلص: استخدم`using` بيان لضمان التخلص من الموارد بشكل صحيح. +``` + +**شرح:** +1. **تهيئة المحرر:** إنشاء كائن `Editor` مع تمرير المسار الكامل للملف المستهدف. +2. **نمط التخلص:** يضمن بيان `using` تحرير جميع الموارد غير المُدارة بسرعة. + ### استخراج المحتوى -بمجرد تحميل المستند، يمكنك استخراج محتواه لتحريره. +`EditableDocument.GetContent()` تُعيد النص الخام للمستند (أو HTML للمحررات القائمة على الويب)، ويمكنك عرضه أو معالجته. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -توضيح: -1. طريقة التحرير: اتصل على`Edit` طريقة الحصول على`EditableDocument`. -2. الحصول على المحتوى: استخدم`GetContent` لاسترداد محتوى المستند كسلسلة. -3. محتوى الإخراج: اطبع المحتوى على وحدة التحكم. +``` + +**شرح:** +1. **طريقة Edit:** تُعيد كائن `EditableDocument`. +2. **الحصول على المحتوى:** `GetContent()` تستخرج النص الخام للمستند (أو HTML للمحررات القائمة على الويب). +3. **إخراج المحتوى:** يُكتب المحتوى إلى الكونسول للتحقق. + ### حفظ التغييرات -بعد التحرير، احفظ التغييرات مرة أخرى في المستند. +`SaveOptions` تُخبر المحرر كيف وبأي صيغة يكتب المستند المُعدل مرة أخرى إلى التخزين. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // تعديل المحتوى هنا + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -توضيح: -1. طريقة التحرير: اتصل على`Edit` طريقة الحصول على`EditableDocument`. -2. تعديل المحتوى: قم بتعديل المحتوى حسب الحاجة (غير موضح في هذا المقتطف). -3. خيارات الحفظ: إنشاء`SaveOptions` تحديد التنسيق. -4. حفظ المستند: استخدم`Save` طريقة حفظ المستند المحرر. -## الخطوة 4: العمل مع أنواع المستندات المختلفة -يدعم GroupDocs.Editor أنواع المستندات المختلفة. وإليك كيفية العمل معهم: -### تحرير مستندات جداول البيانات +``` + +**شرح:** +1. **طريقة Edit:** استرجاع `EditableDocument` بعد التعديلات. +2. **تعديل المحتوى:** تطبيق التغييرات على السلسلة (غير موضح هنا). +3. **خيارات الحفظ:** تكوين `SaveOptions` بالصِيغة المطلوبة للإخراج. +4. **حفظ المستند:** حفظ الملف المُعدل إلى القرص. + +## كيفية العمل مع أنواع المستندات المختلفة؟ +يُجرد GroupDocs.Editor التعامل مع Word، Spreadsheet، وPresentation خلف نفس واجهة الـ API، مما يسهل الانتقال بين السياقات دون الحاجة لتعلم مجموعة جديدة من الفئات لكل عائلة مستندات. + +### تحرير مستندات الجداول +`SpreadsheetSaveOptions` تُحدد كيفية كتابة جدول، بما في ذلك الصيغة وإعدادات الضغط الاختيارية. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // تعديل المحتوى هنا + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -توضيح: -1. تهيئة المحرر: إنشاء`Editor` مثال لجدول البيانات. -2. طريقة التحرير: اتصل`Edit` للحصول على`EditableDocument`. -3. الحصول على المحتوى: استرداد المحتوى وطباعته. -4. تعديل المحتوى: قم بإجراء التغييرات اللازمة. -5. خيارات الحفظ: حدد خيارات الحفظ لجداول البيانات. -6. حفظ المستند: احفظ المستند المعدل. -### تحرير وثائق العرض +``` + +**شرح:** +1. **تهيئة المحرر:** تمرير مسار ملف جدول إلى مُنشئ `Editor`. +2. **طريقة Edit:** استرجاع `EditableDocument`. +3. **الحصول على المحتوى:** طباعة تمثيل CSV للجدول (أو HTML). +4. **تعديل المحتوى:** تطبيق أي تغييرات على مستوى الخلايا. +5. **خيارات الحفظ:** اختيار `SpreadsheetSaveOptions` المناسب. +6. **حفظ المستند:** كتابة الجدول المُحدَّث إلى التخزين. + +### تحرير مستندات العروض التقديمية +`PresentationSaveOptions` تتحكم في صيغة الإخراج لملفات الشرائح، مما يتيح لك الحفاظ على النوع الأصلي أو تغييره. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // تعديل المحتوى هنا + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -توضيح: -1. تهيئة المحرر: إنشاء`Editor` مثال للعرض التقديمي. -2. طريقة التحرير: اتصل`Edit` للحصول على`EditableDocument`. -3. الحصول على المحتوى: استرداد المحتوى وطباعته. -4. تعديل المحتوى: قم بإجراء التغييرات اللازمة. -5. خيارات الحفظ: حدد خيارات الحفظ للعروض التقديمية. -6. حفظ المستند: احفظ المستند المعدل. -## خاتمة -يوفر GroupDocs.Editor for .NET طريقة قوية ومرنة لتحرير تنسيقات المستندات المختلفة برمجيًا. باتباع هذا الدليل، يمكنك دمج وظائف تحرير المستندات بكفاءة في تطبيقات .NET الخاصة بك، مما يعزز قدراتها ويوفر قيمة أكبر للمستخدمين. -## الأسئلة الشائعة -### ما هو GroupDocs.Editor لـ .NET؟ -تعد GroupDocs.Editor for .NET مكتبة قوية تسمح للمطورين بتحرير تنسيقات المستندات المختلفة برمجيًا داخل تطبيقات .NET الخاصة بهم. -### كيف أبدأ باستخدام GroupDocs.Editor لـ .NET؟ -تحتاج إلى تنزيل المكتبة والحصول على ترخيص مؤقت وإعداد بيئة التطوير الخاصة بك بمساحات الأسماء الضرورية. -### ما هي تنسيقات المستندات المدعومة؟ -يدعم GroupDocs.Editor معالجة النصوص وجداول البيانات والعروض التقديمية والتنسيقات النصية وغيرها. -### هل يمكنني استخدام GroupDocs.Editor مجانًا؟ - يمكنك استخدام أ[تجربة مجانية](https://releases.groupdocs.com/) بميزات محدودة أو الحصول على[ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) للوصول الكامل. -### أين يمكنني العثور على المزيد من الموارد والدعم؟ - قم بزيارة[وثائق GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) للحصول على معلومات مفصلة، أو التحقق من[منتدى الدعم](https://forum.groupdocs.com/c/editor/20) للمساعدة. \ No newline at end of file +``` + +**شرح:** +1. **تهيئة المحرر:** تحميل ملف PowerPoint عبر `Editor`. +2. **طريقة Edit:** الحصول على `EditableDocument`. +3. **الحصول على المحتوى:** استخراج HTML الشرائح أو النص العادي. +4. **تعديل المحتوى:** تحديث العناوين، القوائم النقطية، أو الصور. +5. **خيارات الحفظ:** استخدام `PresentationSaveOptions` لتحديد صيغة الإخراج. +6. **حفظ المستند:** حفظ العرض التقديمي المُعدل. + +## المشكلات الشائعة والحلول +- **خطأ “الصيغة غير مدعومة”:** تأكد من أنك تستخدم أحدث نسخة من GroupDocs.Editor؛ فهي تُضيف دعمًا لصيغ Office الأحدث بانتظام. +- **استهلاك الذاكرة للملفات الكبيرة:** فعّل وضع البث عبر تعيين `EditorSettings.EnableStreaming = true` قبل تحميل المستند. +- **الترخيص غير مُطبق:** تأكد من وضع ملف الترخيص المؤقت في جذر التطبيق أو تحميله عبر `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## الأسئلة المتكررة + +**س: ما الفرق بين `DocumentFormatInfo` و `SaveOptions`؟** +ج: `DocumentFormatInfo` تُوفر بيانات تعريفية حول صيغ الملفات المدعومة، بينما `SaveOptions` تُحدد كيفية كتابة المستند إلى القرص (الصيغة، الضغط، إلخ). + +**س: هل يمكنني سرد صيغ لامتداد ملف مخصص؟** +ج: نعم—استخدم `DocumentFormatInfo.FromExtension("yourExt")`؛ إذا لم يُعترف بالامتداد، تُعيد الطريقة `null`. + +**س: هل يدعم GroupDocs.Editor الملفات المحمية بكلمة مرور؟** +ج: بالتأكيد. مرّر كلمة المرور إلى مُنشئ `Editor` عبر `EditorSettings` لفتح المستندات المشفرة. + +**س: كم عدد الصيغ التي يدعمها GroupDocs.Editor فعليًا؟** +ج: أكثر من **30 صيغة إدخال وإخراج**، تشمل Word و Excel و PowerPoint و HTML والنص العادي. + +**س: هل هناك طريقة لتقييد القائمة لتشمل فقط الصيغ القابلة للتحرير؟** +ج: استخدم `GetEditableWordProcessingFormats()` (أو ما يعادلها لـ Spreadsheet/Presentation) لاسترجاع الصيغ التي تسمح بقدرات تحرير كاملة. + +## موارد إضافية +- حمّل المكتبة من [صفحة إصدارات GroupDocs](https://releases.groupdocs.com/editor/net/). +- احصل على [ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) للوصول الكامل للميزات. +- جرّب المنتج عبر [نسخة تجريبية مجانية](https://releases.groupdocs.com/). +- استكشف أمثلة الاستخدام التفصيلية في [توثيق GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- احصل على المساعدة من المجتمع عبر [منتدى الدعم](https://forum.groupdocs.com/c/editor/20). + +## الخاتمة +باتباعك لهذا الدليل، أصبحت الآن تعرف **كيفية سرد صيغ المستندات المدعومة**، **تحديد صيغة ملف من امتداده**، و**تحرير المستندات** عبر صيغ Word، Spreadsheet، وPresentation باستخدام GroupDocs.Editor لـ .NET. أدمج هذه المقاطع في مشاريعك لبناء تطبيقات قوية تدرك الصيغ وتُسعد المستخدمين وتقلل الأخطاء أثناء التشغيل. + +--- + +**آخر تحديث:** 2026-06-06 +**تم الاختبار مع:** GroupDocs.Editor 23.9 لـ .NET +**المؤلف:** GroupDocs + +## الدروس ذات الصلة + +- [إتقان تحميل المستندات في .NET باستخدام GroupDocs.Editor: دليل شامل](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [إتقان تحرير المستندات في .NET باستخدام GroupDocs.Editor: دليل شامل](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [تحويل Word إلى HTML باستخدام GroupDocs.Editor .NET: دليل خطوة بخطوة](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/chinese/net/document-processing/work-document-formats/_index.md b/content/chinese/net/document-processing/work-document-formats/_index.md index 1a34767b..466cd52a 100644 --- a/content/chinese/net/document-processing/work-document-formats/_index.md +++ b/content/chinese/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,218 @@ --- -title: 使用文档格式 -linktitle: 使用文档格式 +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET 列出支持的文档格式并确定文件格式扩展名。提供代码示例的分步指南、快速答案和常见问题解答。 +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: 列出支持的文档格式 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 了解如何使用 GroupDocs.Editor for .NET 以编程方式编辑各种文档格式。带有无缝集成示例的分步指南。 -weight: 13 -url: /zh/net/document-processing/work-document-formats/ +title: 使用 GroupDocs.Editor .NET 列出支持的文档格式 type: docs +url: /zh/net/document-processing/work-document-formats/ +weight: 13 --- -# 使用文档格式 - -## 介绍 -欢迎阅读我们关于使用 GroupDocs.Editor for .NET 的深入指南!如果您是一名希望通过文档编辑功能增强应用程序的开发人员,那么您来对地方了。本文将引导您了解您需要了解的所有内容,从先决条件到实际示例,让您能够快速上手使用这个强大的库。 -## 先决条件 -在深入了解 GroupDocs.Editor for .NET 的示例和功能之前,您需要满足一些先决条件: -1. 对 .NET 的基本了解:熟悉 .NET Framework 或 .NET Core 至关重要。 -2. 开发环境:Visual Studio 或任何其他合适的.NET IDE。 -3. GroupDocs.Editor for .NET 库:从[GroupDocs 发布页面](https://releases.groupdocs.com/editor/net/). -4. 临时执照:获取[临时执照](https://purchase.groupdocs.com/temporary-license/)了解全部功能。 -## 导入命名空间 -要开始使用 GroupDocs.Editor for .NET,您需要将必要的命名空间导入到您的项目中。这将确保您可以访问库提供的所有类和方法。 + +# 列出支持的文档格式 + +欢迎阅读我们关于 **如何列出支持的文档格式** 的完整教程,使用适用于 .NET 的 GroupDocs.Editor。无论您是在构建以文档为中心的 Web 应用还是企业级桌面工具,准确了解可以编辑或转换的格式都是必不可少的。在本指南中,您将学习如何枚举格式、解析扩展名以及编辑文档——所有内容均配有清晰、易懂的说明和可直接运行的代码片段。 + +## 快速答案 +- **如何列出所有支持的格式?** 使用 `DocumentFormatInfo.GetSupportedWordProcessingFormats()`(或对应的 Presentation/Spreadsheet 方法)并遍历集合。 +- **我可以根据文件扩展名确定格式吗?** 可以——调用 `DocumentFormatInfo.FromExtension(".docx")`。 +- **GroupDocs.Editor 支持哪些文件类型?** 超过 30 种输入和输出格式,包括 DOCX、XLSX、PPTX、HTML 和纯文本。 +- **列出格式是否需要许可证?** 临时许可证可解锁完整 API;否则试用版只能使用有限功能。 +- **兼容哪些 .NET 版本?** .NET Framework 4.6+、.NET Core 3.1+、.NET 5/6/7。 + +## 什么是“列出支持的文档格式”? + +该短语指以编程方式获取 GroupDocs.Editor 能够打开、编辑和保存的文件类型集合。此操作可帮助您构建动态 UI 下拉列表或在处理前验证用户上传的文件,确保仅将兼容的文件传递给编辑器进行后续操作。 + +## 为什么要列出支持的文档格式? + +GroupDocs.Editor **支持 30 多种输入和输出格式**,并且能够在不将整个文档加载到内存的情况下处理高达 **2 GB** 的文件。了解确切的格式列表可防止运行时错误,提升用户体验,并使您能够强制执行诸如“仅允许可编辑的 Office 文档”等业务规则。这也有助于只向用户展示您应用真正支持的格式。 + +## 前置条件 + +在开始之前,请确保您已具备以下条件: + +1. **.NET 开发环境** – Visual Studio 2022 或任何支持 .NET 6+ 的 IDE。 +2. **GroupDocs.Editor for .NET 库** – 从 [GroupDocs 发布页面](https://releases.groupdocs.com/editor/net/) 下载。 +3. **临时许可证** – 获取 [临时许可证](https://purchase.groupdocs.com/temporary-license/) 以获得无限制访问。 +4. **基本的 C# 知识** – 熟悉命名空间、`using` 语句和控制台输出。 + +## 如何列出支持的文档格式? + +加载支持的格式集合并打印每种格式的名称和文件扩展名。这种两步模式适用于文字处理、电子表格和演示文稿。通过遍历集合,您可以动态填充 UI 元素(如下拉列表),确保用户只能选择编辑器实际能够处理的格式。 + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## 步骤 1:使用文档格式 -GroupDocs.Editor 支持多种文档格式。让我们来了解如何列出所有支持的文字处理和演示文稿格式。 ### 列出文字处理格式 +`Formats.WordProcessingFormats` 是一个枚举,描述编辑器识别的每种文字处理文件类型。`All` 属性返回这些格式对象的集合。 + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -解释: -1. 循环遍历格式:我们循环遍历所有可用的文字处理格式。 -2. 输出格式详细信息:对于每种格式,我们打印其名称和扩展名。 -### 列表演示格式 +``` + +**说明:** +1. **遍历格式:** 我们遍历所有可用的文字处理格式。 +2. **输出格式详情:** 对每种格式打印其友好名称和默认文件扩展名。 + +### 列出演示文稿格式 +`Formats.PresentationFormats` 对幻灯片文件的处理方式相同,通过 `All` 集合公开每种支持的演示文稿类型。 + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -解释: -1. 循环遍历格式:与文字处理格式类似,我们循环遍历所有演示格式。 -2. 输出格式详细信息:打印每种格式的名称和扩展名。 -## 步骤 2:解析扩展中的格式 -有时,您需要根据文件扩展名确定格式。GroupDocs.Editor 使这变得简单。 +``` + +**说明:** +1. **遍历格式:** 相同的遍历逻辑适用于演示文稿。 +2. **输出格式详情:** 每种格式的名称和扩展名都会显示。 + +## 如何确定文件格式扩展名? + +有时您只有文件名,需要推断相应的 `DocumentFormat`。GroupDocs.Editor 提供了一个简洁的静态帮助方法,将文件扩展名映射到内部格式表示,便于在加载到编辑器之前验证或转换文件。 + ### 解析电子表格格式 +`Formats.SpreadsheetFormats.FromExtension` 将文件扩展名字符串转换为相应的电子表格格式枚举值。 + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -解释: -1. 解析格式:我们使用`FromExtension`方法解析格式`.xlsm`扩大。 -2. 输出格式:打印解析格式的名称。 +``` + +**说明:** +1. **解析格式:** `FromExtension` 将 `.xlsm` 扩展名转换为内部的 `SpreadsheetFormat` 枚举。 +2. **输出格式:** 打印解析后的格式名称,以确认映射。 + ### 解析文本格式 +同样,`Formats.TextualFormats.FromExtension` 解析文本文件扩展名,如 HTML 或 TXT。 + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -解释: -1. 解析格式:`FromExtension`方法用于解析`html`扩大。 -2. 输出格式:打印解析的文本格式的名称。 -## 步骤 3:编辑文档 -现在我们已经了解了如何使用格式,让我们深入研究如何使用 GroupDocs.Editor 编辑文档。 +``` + +**说明:** +1. **解析格式:** `FromExtension` 方法将 `html` 扩展名解析为 `TextFormat`。 +2. **输出格式:** 显示文本格式的名称,对基于 Web 的编辑器很有用。 + +## 确定格式后如何编辑文档? + +确认格式后,加载和编辑文档遵循一致的模式。首先使用源文件路径创建 `Editor` 实例,然后调用 `Edit()` 获取 `EditableDocument`。随后您可以读取、修改,最后使用相应的 `SaveOptions` 保存内容。 + ### 加载文档 -要编辑文档,您首先需要加载它。 +`Editor` 是封装给定文件所有编辑操作的核心类。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - //这里将介绍进一步的步骤。 + // Further steps will be covered here. } ``` -解释: -1. 初始化编辑器:创建一个实例`Editor`类,提供文档的路径。 -2. 处置模式:使用`using`声明以确保资源得到妥善处置。 +``` + +**说明:** +1. **初始化 Editor:** 创建 `Editor` 实例,传入目标文件的完整路径。 +2. **释放模式:** `using` 语句确保及时释放所有非托管资源。 + ### 提取内容 -一旦文档加载完毕,您就可以提取其内容进行编辑。 +`EditableDocument.GetContent()` 返回文档的原始文本(或针对基于 Web 的编辑器的 HTML),您可以对其进行显示或操作。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +220,41 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -解释: -1. 编辑方法:调用`Edit`方法得到`EditableDocument`. -2. 获取内容:使用`GetContent`以字符串形式检索文档的内容。 -3. 输出内容:将内容打印到控制台。 +``` + +**说明:** +1. **Edit 方法:** `Edit()` 返回 `EditableDocument` 对象。 +2. **获取内容:** `GetContent()` 提取文档的原始文本(或针对基于 Web 的编辑器的 HTML)。 +3. **输出内容:** 将内容写入控制台以进行验证。 + ### 保存更改 -编辑后,将更改保存回文档。 +`SaveOptions` 指定编辑器如何以及以何种格式将编辑后的文档写回存储。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - //修改此处内容 + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -解释: -1. 编辑方法:调用`Edit`方法得到`EditableDocument`. -2. 修改内容:根据需要修改内容(此代码片段中未显示)。 -3. 保存选项:创建`SaveOptions`指定格式。 -4. 保存文档:使用`Save`方法保存编辑的文档。 -## 步骤 4:处理不同的文档类型 -GroupDocs.Editor 支持多种文档类型。以下是使用它们的方法: +``` + +**说明:** +1. **Edit 方法:** 在修改后重新获取 `EditableDocument`。 +2. **修改内容:** 对字符串进行更改(此处未展示)。 +3. **保存选项:** 使用所需的输出格式配置 `SaveOptions`。 +4. **保存文档:** 将编辑后的文件写回磁盘。 + +## 如何处理不同的文档类型? + +GroupDocs.Editor 将 Word、电子表格和演示文稿的处理抽象为相同的 API 接口,使得在不同文档类型之间切换变得轻松,无需为每个文档族学习一套新类。 + ### 编辑电子表格文档 +`SpreadsheetSaveOptions` 定义电子表格的写入方式,包括格式和可选的压缩设置。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +262,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //修改此处内容 + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -解释: -1. 初始化编辑器:创建一个`Editor`电子表格的实例。 -2. 编辑方式:致电`Edit`得到一个`EditableDocument`. -3. 获取内容:检索并打印内容。 -4. 修改内容:进行必要的更改。 -5. 保存选项:指定电子表格的保存选项。 -6. 保存文档:保存修改后的文档。 -### 编辑演示文档 +``` + +**说明:** +1. **初始化 Editor:** 将电子表格文件路径传递给 `Editor` 构造函数。 +2. **Edit 方法:** 获取 `EditableDocument`。 +3. **获取内容:** 打印电子表格的 CSV 表示(或 HTML)。 +4. **修改内容:** 应用所需的单元格级别更改。 +5. **保存选项:** 选择合适的 `SpreadsheetSaveOptions`。 +6. **保存文档:** 将更新后的电子表格写回存储。 + +### 编辑演示文稿文档 +`PresentationSaveOptions` 控制幻灯片文件的输出格式,允许您保持或更改原始文件类型。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +289,63 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //修改此处内容 + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -解释: -1. 初始化编辑器:创建一个`Editor`演示文稿的实例。 -2. 编辑方式:致电`Edit`得到一个`EditableDocument`. -3. 获取内容:检索并打印内容。 -4. 修改内容:进行必要的更改。 -5. 保存选项:指定演示文稿的保存选项。 -6. 保存文档:保存修改后的文档。 +``` + +**说明:** +1. **初始化 Editor:** 通过 `Editor` 加载 PowerPoint 文件。 +2. **Edit 方法:** 获取 `EditableDocument`。 +3. **获取内容:** 提取幻灯片的 HTML 或纯文本。 +4. **修改内容:** 更新标题、项目符号或图像。 +5. **保存选项:** 使用 `PresentationSaveOptions` 定义输出格式。 +6. **保存文档:** 将编辑后的演示文稿保存。 + +## 常见问题及解决方案 +- **“不支持的格式”错误:** 确认您使用的是最新的 GroupDocs.Editor 版本;它会定期添加对新 Office 格式的支持。 +- **大文件内存消耗:** 在加载文档前将 `EditorSettings.EnableStreaming = true` 设置为启用流式模式。 +- **许可证未应用:** 确保临时许可证文件放置在应用程序根目录,或通过 `License license = new License(); license.SetLicense("path/to/license.lic");` 加载。 + +## 常见问答 + +**问:`DocumentFormatInfo` 与 `SaveOptions` 有何区别?** +答:`DocumentFormatInfo` 提供关于支持的文件类型的元数据,而 `SaveOptions` 配置文档写回磁盘的方式(格式、压缩等)。 + +**问:我可以列出自定义文件扩展名的格式吗?** +答:可以——使用 `DocumentFormatInfo.FromExtension("yourExt")`;如果未识别该扩展名,方法返回 `null`。 + +**问:GroupDocs.Editor 是否支持受密码保护的文件?** +答:当然。通过 `EditorSettings` 将密码传递给 `Editor` 构造函数即可打开加密文档。 + +**问:GroupDocs.Editor 实际支持多少种格式?** +答:超过 **30 种输入和输出格式**,涵盖 Word、Excel、PowerPoint、HTML 和纯文本。 + +**问:有没有办法将列表限制为仅可编辑的格式?** +答:使用 `GetEditableWordProcessingFormats()`(或对应的 Spreadsheet/Presentation 方法)获取允许完整编辑功能的格式。 + +## 其他资源 +- 从 [GroupDocs 发布页面](https://releases.groupdocs.com/editor/net/) 下载库。 +- 获取 [临时许可证](https://purchase.groupdocs.com/temporary-license/) 以获得完整功能访问。 +- 使用 [免费试用](https://releases.groupdocs.com/) 体验产品。 +- 在 [GroupDocs.Editor 文档](https://tutorials.groupdocs.com/editor/net/) 中查阅详细使用示例。 +- 在 [支持论坛](https://forum.groupdocs.com/c/editor/20) 上获取社区帮助。 + ## 结论 -GroupDocs.Editor for .NET 提供了一种强大而灵活的方式,可以通过编程编辑各种文档格式。通过遵循本指南,您可以有效地将文档编辑功能集成到您的 .NET 应用程序中,增强其功能并为用户提供更大的价值。 -## 常见问题解答 -### 什么是 GroupDocs.Editor for .NET? -GroupDocs.Editor for .NET 是一个功能强大的库,允许开发人员在其 .NET 应用程序中以编程方式编辑各种文档格式。 -### 如何开始使用 GroupDocs.Editor for .NET? -您需要下载该库,获取临时许可证,并使用必要的命名空间设置您的开发环境。 -### 支持哪些文档格式? -GroupDocs.Editor 支持文字处理、电子表格、演示文稿和文本格式等。 -### 我可以免费使用 GroupDocs.Editor 吗? -您可以使用[免费试用](https://releases.groupdocs.com/)功能有限或获得[临时执照](https://purchase.groupdocs.com/temporary-license/)以获得完全访问权限。 -### 我可以在哪里找到更多资源和支持? -访问[GroupDocs.Editor 文档](https://tutorials.groupdocs.com/editor/net/)了解详细信息,或查看他们的[支持论坛](https://forum.groupdocs.com/c/editor/20)求助。 \ No newline at end of file + +通过本指南,您现在了解如何 **列出支持的文档格式**、**根据扩展名确定文件格式**,以及使用适用于 .NET 的 GroupDocs.Editor **编辑 Word、电子表格和演示文稿**。将这些代码片段集成到自己的项目中,构建强大且具备格式感知的应用程序,提升终端用户体验并降低运行时错误。 + +--- + +**最后更新:** 2026-06-06 +**测试环境:** GroupDocs.Editor 23.9 for .NET +**作者:** GroupDocs + +## 相关教程 + +- [精通 .NET 中的文档加载(使用 GroupDocs.Editor):全面指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [精通 .NET 中的文档编辑(使用 GroupDocs.Editor):全面指南](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [使用 GroupDocs.Editor .NET 将 Word 转换为 HTML:分步指南](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/czech/net/document-processing/work-document-formats/_index.md b/content/czech/net/document-processing/work-document-formats/_index.md index 54290edb..4f026142 100644 --- a/content/czech/net/document-processing/work-document-formats/_index.md +++ b/content/czech/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Práce s formáty dokumentů -linktitle: Práce s formáty dokumentů +date: 2026-06-06 +description: Zjistěte, jak vypsat podporované formáty dokumentů a určit příponu souboru + pomocí GroupDocs.Editor pro .NET. Step‑by‑step guide s code snippets, quick answers + a FAQs. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Seznam podporovaných formátů dokumentů +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Naučte se používat GroupDocs.Editor pro .NET k programové úpravě různých formátů dokumentů. Podrobný průvodce s příklady bezproblémové integrace. -weight: 13 -url: /cs/net/document-processing/work-document-formats/ +title: Seznam podporovaných formátů dokumentů s GroupDocs.Editor .NET type: docs +url: /cs/net/document-processing/work-document-formats/ +weight: 13 --- -# Práce s formáty dokumentů -## Úvod -Vítejte v našem podrobném průvodci používáním GroupDocs.Editoru pro .NET! Pokud jste vývojář, který chce vylepšit své aplikace o možnosti úprav dokumentů, jste na správném místě. Tento článek vás provede vším, co potřebujete vědět, od předpokladů až po praktické příklady, abyste mohli používat tuto výkonnou knihovnu. +# Seznam podporovaných formátů dokumentů + +Vítejte v našem komplexním tutoriálu o **jak vypsat podporované formáty dokumentů** s GroupDocs.Editor pro .NET. Ať už vytváříte webovou aplikaci zaměřenou na dokumenty nebo podnikové desktopové řešení, je nezbytné přesně vědět, které formáty můžete upravovat nebo konvertovat. V tomto průvodci se dozvíte, jak vyjmenovat formáty, parsovat přípony a upravovat dokumenty — vše s jasnými, uživatelsky přívětivými vysvětleními a připravenými ukázkovými kódy. + +## Rychlé odpovědi +- **Jak vypsat všechny podporované formáty?** Použijte `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (nebo ekvivalenty pro Presentation/Spreadsheet) a projděte kolekci. +- **Mohu určit formát z přípony souboru?** Ano — zavolejte `DocumentFormatInfo.FromExtension(".docx")`. +- **Jaké typy souborů GroupDocs.Editor podporuje?** Více než 30 vstupních a výstupních formátů, včetně DOCX, XLSX, PPTX, HTML a prostého textu. +- **Potřebuji licenci pro výpis formátů?** Dočasná licence odemkne celé API; jinak zkušební verze funguje s omezenými funkcemi. +- **Které verze .NET jsou kompatibilní?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Co znamená „vypsat podporované formáty dokumentů“? +Tento výraz odkazuje na programové získání kolekce typů souborů, které GroupDocs.Editor může otevřít, upravit a uložit. Tato operace vám umožní vytvořit dynamické rozbalovací nabídky UI nebo ověřit nahrané soubory uživatele před zpracováním, čímž zajistíte, že do editoru jsou předány pouze kompatibilní soubory. + +## Proč vypsat podporované formáty dokumentů? +GroupDocs.Editor **podporuje více než 30 vstupních a výstupních formátů** a dokáže zpracovat soubory až do **2 GB** bez načítání celého dokumentu do paměti. Znalost přesného seznamu zabraňuje chybám za běhu, zlepšuje uživatelskou zkušenost a umožňuje vynucovat obchodní pravidla, například „povolit jen editovatelné Office dokumenty“. Také vám pomůže zobrazit uživatelům pouze formáty, které vaše aplikace skutečně podporuje. + ## Předpoklady -Než se ponoříte do příkladů a funkcí GroupDocs.Editoru pro .NET, musíte mít splněno několik předpokladů: -1. Základní porozumění .NET: Znalost .NET Framework nebo .NET Core je nezbytná. -2. Vývojové prostředí: Visual Studio nebo jakékoli jiné vhodné .NET IDE. -3. GroupDocs.Editor for .NET Library: Stáhněte si knihovnu z[Stránka vydání GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Dočasná licence: Získejte a[dočasná licence](https://purchase.groupdocs.com/temporary-license/) pro plné funkce. -## Importovat jmenné prostory -Chcete-li začít s GroupDocs.Editor pro .NET, musíte do svého projektu importovat potřebné jmenné prostory. To zajistí, že budete mít přístup ke všem třídám a metodám, které knihovna poskytuje. +1. **.NET vývojové prostředí** — Visual Studio 2022 nebo jakékoli IDE podporující .NET 6+. +2. **Knihovna GroupDocs.Editor pro .NET** — stáhněte ji ze [stránky vydání GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Dočasná licence** — získejte [dočasnou licenci](https://purchase.groupdocs.com/temporary-license/) pro neomezený přístup. +4. **Základní znalost C#** — znalost jmenných prostorů, `using` příkazů a výstupu do konzole. + +## Jak vypsat podporované formáty dokumentů? +Načtěte kolekci podporovaných formátů a vytiskněte název a příponu každého formátu. Tento dvoustupňový vzor funguje pro dokumenty Word Processing, Spreadsheet a Presentation. Iterací kolekce můžete dynamicky naplnit UI prvky, jako jsou rozbalovací seznamy, a zajistit, že uživatelé mohou vybrat jen formáty, které editor skutečně zvládne. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## Krok 1: Práce s formáty dokumentů -GroupDocs.Editor podporuje širokou škálu formátů dokumentů. Pojďme prozkoumat, jak můžete uvést všechny podporované formáty pro zpracování textu a prezentace. -### Výpis formátů textového editoru +### Výpis formátů Word Processing +`Formats.WordProcessingFormats` je výčtový typ, který popisuje každý typ souboru Word‑processing rozpoznaný editorem. Vlastnost `All` vrací kolekci těchto objektů formátů. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Vysvětlení: -1. Procházet formáty: Procházíme všechny dostupné formáty textového editoru. -2. Podrobnosti výstupního formátu: U každého formátu vytiskneme jeho název a příponu. -### Výpis prezentačních formátů +``` + +**Vysvětlení:** +1. **Procházení formátů:** Procházíme všechny dostupné Word‑processing formáty. +2. **Výpis podrobností o formátu:** Pro každý formát vytiskneme jeho přátelský název a výchozí příponu souboru. + +### Výpis formátů prezentací +`Formats.PresentationFormats` funguje stejným způsobem pro soubory prezentací, a odhaluje každý podporovaný typ prezentace prostřednictvím kolekce `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Vysvětlení: -1. Procházet formáty: Podobně jako u formátů pro zpracování textu procházíme všechny formáty prezentace. -2. Podrobnosti o výstupním formátu: Vytiskněte název a příponu každého formátu. -## Krok 2: Analýza formátů z rozšíření -Někdy je potřeba určit formát na základě přípony souboru. GroupDocs.Editor to usnadňuje. -### Analýza tabulkových formátů +``` + +**Vysvětlení:** +1. **Procházení formátů:** Stejná logika procházení se použije i pro prezentace. +2. **Výpis podrobností o formátu:** Název a přípona jsou vytištěny pro každý formát. + +## Jak určit příponu formátu souboru? +Někdy máte jen název souboru a potřebujete odvodit odpovídající `DocumentFormat`. GroupDocs.Editor nabízí jednoduchý statický pomocník, který mapuje příponu souboru na interní reprezentaci formátu, což vám umožní ověřit nebo konvertovat soubory před jejich načtením do editoru. + +### Parsování formátů tabulek +`Formats.SpreadsheetFormats.FromExtension` převádí řetězec přípony souboru na odpovídající hodnotu výčtu formátu tabulky. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Vysvětlení: -1. Parse Format: Používáme`FromExtension` metoda pro analýzu formátu z`.xlsm` rozšíření. -2. Výstupní formát: Vytiskne název analyzovaného formátu. -### Analýza textových formátů +``` + +**Vysvětlení:** +1. **Parsování formátu:** `FromExtension` převádí příponu `.xlsm` na interní výčet `SpreadsheetFormat`. +2. **Výpis formátu:** Název parsovaného formátu je vytištěn, čímž potvrzuje mapování. + +### Parsování textových formátů +Podobně `Formats.TextualFormats.FromExtension` rozpozná textové přípony souborů, jako jsou HTML nebo TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Vysvětlení: -1. Formát analýzy: The`FromExtension` metoda se používá k analýze formátu z`html` rozšíření. -2. Výstupní formát: Vytiskne název analyzovaného textového formátu. -## Krok 3: Úprava dokumentů -Nyní, když jsme viděli, jak pracovat s formáty, pojďme se vrhnout na úpravy dokumentů pomocí GroupDocs.Editor. -### Načítání dokumentu -Chcete-li upravit dokument, musíte jej nejprve načíst. +``` + +**Vysvětlení:** +1. **Parsování formátu:** Metoda `FromExtension` rozpozná příponu `html` jako `TextFormat`. +2. **Výpis formátu:** Název textového formátu je zobrazen, což je užitečné pro webové editory. + +## Jak upravit dokumenty po určení formátů? +Jakmile znáte formát, načítání a úprava dokumentu následuje jednotný vzor. Nejprve vytvoříte instanci `Editor` s cestou k zdrojovému souboru, poté zavoláte `Edit()` pro získání `EditableDocument`. Odtud můžete číst, měnit a nakonec uložit obsah pomocí vhodných `SaveOptions`. + +### Načtení dokumentu +`Editor` je hlavní třída, která zapouzdřuje všechny operace úpravy pro daný soubor. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Další kroky budou popsány zde. + // Further steps will be covered here. } ``` -Vysvětlení: -1. Initialize Editor: Vytvořte instanci souboru`Editor` třídy, která poskytuje cestu k vašemu dokumentu. -2. Dispose Pattern: Použijte`using` prohlášení, aby bylo zajištěno správné nakládání se zdroji. +``` + +**Vysvětlení:** +1. **Inicializace Editoru:** Vytvořte instanci `Editor`, předáním úplné cesty k cílovému souboru. +2. **Vzor uvolnění:** Příkaz `using` zajišťuje, že všechny neřízené prostředky jsou rychle uvolněny. + ### Extrahování obsahu -Jakmile je dokument načten, můžete extrahovat jeho obsah pro úpravy. +`EditableDocument.GetContent()` vrací surový text dokumentu (nebo HTML pro webové editory), který můžete zobrazit nebo manipulovat. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Vysvětlení: -1. Metoda úpravy: Zavolejte na`Edit` způsob, jak získat`EditableDocument`. -2. Získat obsah: Použijte`GetContent` načíst obsah dokumentu jako řetězec. -3. Výstupní obsah: Vytiskněte obsah do konzoly. +``` + +**Vysvětlení:** +1. **Metoda Edit:** `Edit()` vrací objekt `EditableDocument`. +2. **Získání obsahu:** `GetContent()` extrahuje surový text dokumentu (nebo HTML pro webové editory). +3. **Výpis obsahu:** Obsah je vypsán do konzole pro ověření. + ### Ukládání změn -Po úpravách uložte změny zpět do dokumentu. +`SaveOptions` určuje editoru, jak a v jakém formátu má upravený dokument zapsat zpět do úložiště. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Zde upravte obsah + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Vysvětlení: -1. Metoda úpravy: Zavolejte na`Edit` způsob, jak získat`EditableDocument`. -2. Upravit obsah: Upravte obsah podle potřeby (nezobrazeno v tomto úryvku). -3. Možnosti uložení: Vytvořit`SaveOptions` určení formátu. -4. Uložit dokument: Použijte`Save` způsob uložení upraveného dokumentu. -## Krok 4: Práce s různými typy dokumentů -GroupDocs.Editor podporuje různé typy dokumentů. Zde je návod, jak s nimi pracovat: -### Úpravy tabulkových dokumentů +``` + +**Vysvětlení:** +1. **Metoda Edit:** Znovu získat `EditableDocument` po úpravách. +2. **Úprava obsahu:** Aplikujte své změny na řetězec (není zde ukázáno). +3. **Možnosti uložení:** Nakonfigurujte `SaveOptions` s požadovaným výstupním formátem. +4. **Uložení dokumentu:** Uložte upravený soubor zpět na disk. + +## Jak pracovat s různými typy dokumentů? +GroupDocs.Editor abstrahuje práci s Word, Spreadsheet a Presentation za stejným rozhraním API, což usnadňuje přepínání kontextů bez nutnosti učit se novou sadu tříd pro každou rodinu dokumentů. + +### Úprava tabulkových dokumentů +`SpreadsheetSaveOptions` definuje, jak je tabulka zapisována, včetně formátu a volitelných nastavení komprese. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Zde upravte obsah + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Vysvětlení: -1. Inicializovat editor: Vytvořte soubor`Editor` například pro tabulku. -2. Způsob úpravy: Volejte`Edit` získat`EditableDocument`. -3. Získat obsah: Načtěte a vytiskněte obsah. -4. Upravit obsah: Proveďte potřebné změny. -5. Možnosti uložení: Určete možnosti uložení pro tabulky. -6. Uložit dokument: Uložte upravený dokument. +``` + +**Vysvětlení:** +1. **Inicializace Editoru:** Předat cestu k souboru tabulky konstruktoru `Editor`. +2. **Metoda Edit:** Získat `EditableDocument`. +3. **Získání obsahu:** Vytisknout CSV reprezentaci tabulky (nebo HTML). +4. **Úprava obsahu:** Proveďte požadované změny na úrovni buněk. +5. **Možnosti uložení:** Vyberte vhodné `SpreadsheetSaveOptions`. +6. **Uložení dokumentu:** Zapište aktualizovanou tabulku zpět do úložiště. + ### Úprava prezentačních dokumentů +`PresentationSaveOptions` řídí výstupní formát pro sady snímků, což vám umožní zachovat nebo změnit původní typ souboru. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Zde upravte obsah + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Vysvětlení: -1. Inicializovat editor: Vytvořte soubor`Editor` třeba na prezentaci. -2. Způsob úpravy: Volejte`Edit` získat`EditableDocument`. -3. Získat obsah: Načtěte a vytiskněte obsah. -4. Upravit obsah: Proveďte potřebné změny. -5. Možnosti uložení: Určete možnosti uložení pro prezentace. -6. Uložit dokument: Uložte upravený dokument. +``` + +**Vysvětlení:** +1. **Inicializace Editoru:** Načtěte soubor PowerPoint pomocí `Editor`. +2. **Metoda Edit:** Získat `EditableDocument`. +3. **Získání obsahu:** Extrahovat HTML snímků nebo prostý text. +4. **Úprava obsahu:** Aktualizovat nadpisy, odrážky nebo obrázky. +5. **Možnosti uložení:** Použijte `PresentationSaveOptions` k definování výstupního formátu. +6. **Uložení dokumentu:** Uložit upravenou prezentaci. + +## Časté problémy a řešení +- **Chyba „Formát není podporován“:** Ověřte, že používáte nejnovější verzi GroupDocs.Editor; pravidelně přidává podporu pro novější formáty Office. +- **Vysoká spotřeba paměti u velkých souborů:** Aktivujte režim streamování nastavením `EditorSettings.EnableStreaming = true` před načtením dokumentu. +- **Licence nebyla použita:** Ujistěte se, že soubor dočasné licence je umístěn v kořenovém adresáři aplikace nebo načten pomocí `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Často kladené otázky + +**Q: Jaký je rozdíl mezi `DocumentFormatInfo` a `SaveOptions`?** +A: `DocumentFormatInfo` poskytuje metadata o podporovaných typech souborů, zatímco `SaveOptions` konfiguruje, jak je dokument zapsán zpět na disk (formát, komprese atd.). + +**Q: Mohu vypsat formáty pro vlastní příponu souboru?** +A: Ano — použijte `DocumentFormatInfo.FromExtension("yourExt")`; pokud přípona není rozpoznána, metoda vrátí `null`. + +**Q: Podporuje GroupDocs.Editor soubory chráněné heslem?** +A: Ano. Heslo předáte konstruktoru `Editor` prostřednictvím `EditorSettings`, aby se otevřely šifrované dokumenty. + +**Q: Kolik formátů GroupDocs.Editor skutečně podporuje?** +A: Více než **30 vstupních a výstupních formátů**, zahrnujících Word, Excel, PowerPoint, HTML a prostý text. + +**Q: Existuje způsob, jak omezit seznam jen na editovatelné formáty?** +A: Použijte `GetEditableWordProcessingFormats()` (nebo ekvivalenty pro Spreadsheet/Presentation) k získání formátů, které umožňují plnou editaci. + +## Další zdroje +- Stáhněte knihovnu ze [stránky vydání GroupDocs](https://releases.groupdocs.com/editor/net/). +- Získejte [dočasnou licenci](https://purchase.groupdocs.com/temporary-license/) pro plný přístup k funkcím. +- Vyzkoušejte produkt s [bezplatnou zkušební verzí](https://releases.groupdocs.com/). +- Prozkoumejte podrobné příklady použití v [dokumentaci GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Získejte pomoc od komunity na [fóru podpory](https://forum.groupdocs.com/c/editor/20). + ## Závěr -GroupDocs.Editor pro .NET poskytuje robustní a flexibilní způsob programové úpravy různých formátů dokumentů. Podle této příručky můžete efektivně integrovat funkce pro úpravy dokumentů do svých aplikací .NET, vylepšit jejich možnosti a poskytnout uživatelům větší hodnotu. -## FAQ -### Co je GroupDocs.Editor pro .NET? -GroupDocs.Editor for .NET je výkonná knihovna, která umožňuje vývojářům upravovat různé formáty dokumentů programově v rámci jejich aplikací .NET. -### Jak mohu začít s GroupDocs.Editor pro .NET? -Musíte si stáhnout knihovnu, získat dočasnou licenci a nastavit vývojové prostředí s potřebnými jmennými prostory. -### Jaké formáty dokumentů jsou podporovány? -GroupDocs.Editor podporuje mimo jiné textové, tabulkové, prezentační a textové formáty. -### Mohu používat GroupDocs.Editor zdarma? - Můžete použít a[zkušební verze zdarma](https://releases.groupdocs.com/) s omezenými funkcemi nebo získat a[dočasná licence](https://purchase.groupdocs.com/temporary-license/) pro plný přístup. -### Kde najdu další zdroje a podporu? - Navštivte[GroupDocs.Editor dokumentace](https://tutorials.groupdocs.com/editor/net/) pro podrobné informace, nebo se podívejte na jejich[Fórum podpory](https://forum.groupdocs.com/c/editor/20) pro pomoc. \ No newline at end of file +Po přečtení tohoto průvodce nyní víte, jak **vypsat podporované formáty dokumentů**, **určit formát souboru z jeho přípony** a **upravit dokumenty** napříč typy Word, Spreadsheet a Presentation pomocí GroupDocs.Editor pro .NET. Začleňte tyto úryvky do svých projektů a vytvořte robustní aplikace, které jsou si vědomy formátů, potěší koncové uživatele a sníží chyby za běhu. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Související tutoriály + +- [Mistrovství načítání dokumentů v .NET s GroupDocs.Editor: Kompletní průvodce](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Mistrovství úpravy dokumentů v .NET s GroupDocs.Editor: Kompletní průvodce](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Převod Wordu do HTML pomocí GroupDocs.Editor .NET: Průvodce krok za krokem](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/dutch/net/document-processing/work-document-formats/_index.md b/content/dutch/net/document-processing/work-document-formats/_index.md index 81040e84..2a95a1d3 100644 --- a/content/dutch/net/document-processing/work-document-formats/_index.md +++ b/content/dutch/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Werken met documentformaten -linktitle: Werken met documentformaten +date: 2026-06-06 +description: Leer hoe u ondersteunde documentformaten kunt weergeven en de bestandsextensie + kunt bepalen met GroupDocs.Editor voor .NET. Stapsgewijze gids met codefragmenten, + snelle antwoorden en veelgestelde vragen. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Lijst ondersteunde documentformaten +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Leer hoe u GroupDocs.Editor voor .NET kunt gebruiken om verschillende documentindelingen programmatisch te bewerken. Stap-voor-stap handleiding met voorbeelden voor naadloze integratie. -weight: 13 -url: /nl/net/document-processing/work-document-formats/ +title: Lijst ondersteunde documentformaten met GroupDocs.Editor .NET type: docs +url: /nl/net/document-processing/work-document-formats/ +weight: 13 --- -# Werken met documentformaten - -## Invoering -Welkom bij onze uitgebreide handleiding over het gebruik van GroupDocs.Editor voor .NET! Als u een ontwikkelaar bent en uw toepassingen wilt uitbreiden met documentbewerkingsmogelijkheden, dan bent u hier aan het juiste adres. In dit artikel vindt u alles wat u moet weten, van vereisten tot praktische voorbeelden, om u op weg te helpen met deze krachtige bibliotheek. -## Vereisten -Voordat u ingaat op de voorbeelden en functionaliteiten van GroupDocs.Editor voor .NET, zijn er een aantal vereisten waaraan u moet voldoen: -1. Basiskennis van .NET: Bekendheid met .NET Framework of .NET Core is essentieel. -2. Ontwikkelomgeving: Visual Studio of een andere geschikte .NET IDE. -3. GroupDocs.Editor voor .NET-bibliotheek: download de bibliotheek van de[GroupDocs-releasepagina](https://releases.groupdocs.com/editor/net/). -4. Tijdelijke licentie: verkrijg een[tijdelijke licentie](https://purchase.groupdocs.com/temporary-license/) voor volledige functies. -## Naamruimten importeren -Om aan de slag te gaan met GroupDocs.Editor voor .NET, moet u de benodigde naamruimten in uw project importeren. Hierdoor bent u ervan verzekerd dat u toegang heeft tot alle lessen en methoden die door de bibliotheek worden aangeboden. + +# Lijst ondersteunde documentformaten + +Welkom bij onze uitgebreide tutorial over **hoe ondersteunde documentformaten te lijst** met GroupDocs.Editor voor .NET. Of je nu een document‑gerichte webapp bouwt of een enterprise‑klasse desktoptool, het precies weten welke formaten je kunt bewerken of converteren is essentieel. In deze gids ontdek je hoe je formaten kunt opsommen, extensies kunt parseren en documenten kunt bewerken — allemaal met duidelijke, mensvriendelijke uitleg en kant‑klaar code‑fragmenten. + +## Snelle antwoorden +- **Hoe lijst ik alle ondersteunde formaten op?** Gebruik `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (of de Presentation/Spreadsheet-equivalenten) en doorloop de collectie. +- **Kan ik een formaat bepalen aan de hand van een bestandsextensie?** Ja — roep `DocumentFormatInfo.FromExtension(".docx")` aan. +- **Welke bestandstypen ondersteunt GroupDocs.Editor?** Meer dan 30 invoer‑ en uitvoerformaten, waaronder DOCX, XLSX, PPTX, HTML en platte tekst. +- **Heb ik een licentie nodig om formaten te lijst?** Een tijdelijke licentie ontgrendelt de volledige API; anders werkt een proefversie met beperkte functies. +- **Welke .NET‑versies zijn compatibel?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Wat betekent “lijst ondersteunde documentformaten”? +De uitdrukking verwijst naar het programmatisch ophalen van de collectie bestandstypen die GroupDocs.Editor kan openen, bewerken en opslaan. Deze bewerking stelt je in staat dynamische UI‑dropdowns te bouwen of gebruikersuploads te valideren vóór verwerking, zodat alleen compatibele bestanden naar de editor worden doorgegeven voor verdere manipulatie. + +## Waarom ondersteunde documentformaten lijst? +GroupDocs.Editor **ondersteunt meer dan 30 invoer‑ en uitvoerformaten** en kan bestanden tot **2 GB** verwerken zonder het volledige document in het geheugen te laden. Het kennen van de exacte lijst voorkomt runtime‑fouten, verbetert de gebruikerservaring en stelt je in staat bedrijfsregels af te dwingen, zoals “alleen bewerkbare Office‑documenten toestaan”. Het helpt ook om gebruikers alleen de formaten te tonen die je applicatie werkelijk ondersteunt. + +## Voorvereisten +Zorg ervoor dat je het volgende hebt voordat je begint: + +1. **.NET‑ontwikkelomgeving** – Visual Studio 2022 of een IDE die .NET 6+ ondersteunt. +2. **GroupDocs.Editor voor .NET‑bibliotheek** – download van de [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **Tijdelijke licentie** – verkrijg een [temporary license](https://purchase.groupdocs.com/temporary-license/) voor onbeperkte toegang. +4. **Basis C#‑kennis** – vertrouwdheid met namespaces, `using`‑statements en console‑output. + +## Hoe ondersteunde documentformaten lijst? +Laad de collectie ondersteunde formaten en druk de naam en bestandsextensie van elk formaat af. Dit twee‑stappenpatroon werkt voor Word‑verwerking, Spreadsheet‑ en Presentatiedocumenten. Door de collectie te itereren kun je dynamisch UI‑elementen zoals dropdowns vullen, zodat gebruikers alleen formaten kunnen selecteren die de editor daadwerkelijk kan verwerken. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## Stap 1: Werken met documentformaten -GroupDocs.Editor ondersteunt een breed scala aan documentformaten. Laten we eens kijken hoe u alle ondersteunde tekstverwerkings- en presentatieformaten kunt vermelden. -### Lijst met tekstverwerkingsformaten +### Lijst Word‑verwerkingsformaten +`Formats.WordProcessingFormats` is een enumeratie die elk door de editor herkend Word‑verwerkingsbestandstype beschrijft. De eigenschap `All` retourneert een collectie van deze formaatobjecten. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Uitleg: -1. Doorloopformaten: We doorlopen alle beschikbare tekstverwerkingsformaten. -2. Details van uitvoerformaat: voor elk formaat drukken we de naam en extensie af. -### Lijst met presentatieformaten +``` + +**Uitleg:** +1. **Doorloop formaten:** We itereren over alle beschikbare Word‑verwerkingsformaten. +2. **Uitvoer formaatdetails:** Voor elk formaat drukken we de vriendelijke naam en de standaard bestandsextensie af. + +### Lijst presentatiefomaten +`Formats.PresentationFormats` werkt op dezelfde manier voor slide‑deck‑bestanden, waarbij elk ondersteund presentatietype wordt blootgesteld via de `All`‑collectie. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Uitleg: -1. Doorloopformaten: Net als bij tekstverwerkingsformaten doorlopen we alle presentatieformaten. -2. Details van uitvoerformaat: druk de naam en extensie van elk formaat af. -## Stap 2: Formaten uit extensies parseren -Soms moet u het formaat bepalen op basis van een bestandsextensie. GroupDocs.Editor maakt dit eenvoudig. -### Spreadsheetformaten parseren +``` + +**Uitleg:** +1. **Doorloop formaten:** Dezelfde iteratielogica geldt voor presentaties. +2. **Uitvoer formaatdetails:** De naam en extensie worden voor elk formaat weergegeven. + +## Hoe bestandsformatextensie bepalen? +Soms heb je alleen een bestandsnaam en moet je het bijbehorende `DocumentFormat` afleiden. GroupDocs.Editor biedt een eenvoudige statische helper die een bestandsextensie naar de interne formaatrepresentatie mappt, zodat je bestanden kunt valideren of converteren voordat je ze in de editor laadt. + +### Spreadsheet‑formaten parseren +`Formats.SpreadsheetFormats.FromExtension` zet een bestandsextensie‑string om in de overeenkomende spreadsheet‑formaat‑enumwaarde. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Uitleg: -1. Parse-indeling: we gebruiken de`FromExtension` methode om het formaat te parseren uit het`.xlsm` verlenging. -2. Uitvoerformaat: druk de naam van het geparseerde formaat af. +``` + +**Uitleg:** +1. **Parseer formaat:** `FromExtension` zet de `.xlsm`‑extensie om in de interne `SpreadsheetFormat`‑enum. +2. **Uitvoer formaat:** De naam van het geparseerde formaat wordt afgedrukt, wat de mapping bevestigt. + ### Tekstuele formaten parseren +Evenzo lost `Formats.TextualFormats.FromExtension` tekstuele bestandsextensies op, zoals HTML of TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Uitleg: -1. Parseerformaat: The`FromExtension` methode wordt gebruikt om het formaat van de`html` verlenging. -2. Uitvoerformaat: Druk de naam van het geparseerde tekstformaat af. -## Stap 3: Documenten bewerken -Nu we hebben gezien hoe we met indelingen kunnen werken, gaan we dieper in op het bewerken van documenten met GroupDocs.Editor. +``` + +**Uitleg:** +1. **Parseer formaat:** De `FromExtension`‑methode lost de `html`‑extensie op naar een `TextFormat`. +2. **Uitvoer formaat:** De naam van het tekstuele formaat wordt weergegeven, nuttig voor web‑gebaseerde editors. + +## Hoe documenten bewerken na het identificeren van formaten? +Zodra je het formaat kent, volgt het laden en bewerken van een document een consistent patroon. Eerst maak je een `Editor`‑instance met het pad naar het bronbestand, vervolgens roep je `Edit()` aan om een `EditableDocument` te verkrijgen. Vanaf daar kun je de inhoud lezen, wijzigen en uiteindelijk opslaan met de juiste `SaveOptions`. + ### Een document laden -Om een document te bewerken, moet u het eerst laden. +`Editor` is de kernklasse die alle bewerkingsbewerkingen voor een gegeven bestand omvat. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Verdere stappen worden hier behandeld. + // Further steps will be covered here. } ``` -Uitleg: -1. Initialiseer Editor: Maak een exemplaar van het`Editor` class, met het pad naar uw document. -2. Afvoerpatroon: gebruik de`using` verklaring om ervoor te zorgen dat de hulpbronnen op de juiste wijze worden afgevoerd. +``` + +**Uitleg:** +1. **Initialiseer Editor:** Maak een `Editor`‑instance aan en geef het volledige pad van het doelbestand door. +2. **Dispose‑patroon:** De `using`‑statement garandeert dat alle niet‑beheerde resources onmiddellijk worden vrijgegeven. + ### Inhoud extraheren -Zodra het document is geladen, kunt u de inhoud eruit halen om deze te bewerken. +`EditableDocument.GetContent()` retourneert de ruwe tekst van het document (of HTML voor web‑gebaseerde editors), die je kunt weergeven of manipuleren. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Uitleg: -1. Bewerkingsmethode: Bel de`Edit` methode om een`EditableDocument`. -2. Inhoud verkrijgen: gebruiken`GetContent` om de inhoud van het document als een tekenreeks op te halen. -3. Uitvoerinhoud: druk de inhoud af naar de console. +``` + +**Uitleg:** +1. **Edit‑methode:** `Edit()` retourneert een `EditableDocument`‑object. +2. **Inhoud ophalen:** `GetContent()` haalt de ruwe tekst van het document op (of HTML voor web‑gebaseerde editors). +3. **Inhoud weergeven:** De inhoud wordt naar de console geschreven ter verificatie. + ### Wijzigingen opslaan -Na het bewerken slaat u uw wijzigingen weer op in het document. +`SaveOptions` vertelt de editor hoe en in welk formaat het bewerkte document terug naar de opslag moet worden geschreven. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Wijzig hier de inhoud + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Uitleg: -1. Bewerkingsmethode: Bel de`Edit` methode om een`EditableDocument`. -2. Inhoud wijzigen: Pas de inhoud indien nodig aan (niet weergegeven in dit fragment). -3. Opties voor opslaan: Maken`SaveOptions` het formaat opgeven. -4. Document opslaan: gebruik de`Save` methode om het bewerkte document op te slaan. -## Stap 4: Werken met verschillende documenttypen -GroupDocs.Editor ondersteunt verschillende documenttypen. Hier ziet u hoe u ermee kunt werken: -### Spreadsheetdocumenten bewerken +``` + +**Uitleg:** +1. **Edit‑methode:** Verkrijg opnieuw het `EditableDocument` na wijzigingen. +2. **Inhoud wijzigen:** Pas je wijzigingen toe op de string (hier niet getoond). +3. **Opslagopties:** Configureer `SaveOptions` met het gewenste uitvoerformaat. +4. **Document opslaan:** Sla het bewerkte bestand opnieuw op op schijf. + +## Hoe met verschillende documenttypen werken? +GroupDocs.Editor abstraheert Word-, Spreadsheet- en Presentation‑verwerking achter dezelfde API‑laag, waardoor het eenvoudig is van context te wisselen zonder een nieuwe set klassen voor elke documentfamilie te leren. + +### Spreadsheet‑documenten bewerken +`SpreadsheetSaveOptions` definieert hoe een spreadsheet wordt geschreven, inclusief formaat en optionele compressie‑instellingen. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Wijzig hier de inhoud + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Uitleg: -1. Initialiseer Editor: Maak een`Editor` bijvoorbeeld voor een spreadsheet. -2. Bewerkingsmethode: Bellen`Edit` om een`EditableDocument`. -3. Inhoud ophalen: haal de inhoud op en druk deze af. -4. Inhoud wijzigen: breng de nodige wijzigingen aan. -5. Opties voor opslaan: geef de opslagopties voor spreadsheets op. -6. Document opslaan: Sla het gewijzigde document op. -### Presentatiedocumenten bewerken +``` + +**Uitleg:** +1. **Initialiseer Editor:** Geef een spreadsheet‑bestandspad door aan de `Editor`‑constructor. +2. **Edit‑methode:** Haal een `EditableDocument` op. +3. **Inhoud ophalen:** Print de CSV‑representatie (of HTML) van de spreadsheet. +4. **Inhoud wijzigen:** Pas eventuele cel‑niveau wijzigingen toe die je nodig hebt. +5. **Opslagopties:** Kies de juiste `SpreadsheetSaveOptions`. +6. **Document opslaan:** Schrijf de bijgewerkte spreadsheet terug naar de opslag. + +### Presentatie‑documenten bewerken +`PresentationSaveOptions` regelt het uitvoerformaat voor slide‑decks, waardoor je het oorspronkelijke bestandstype kunt behouden of wijzigen. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Wijzig hier de inhoud + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Uitleg: -1. Initialiseer Editor: Maak een`Editor` bijvoorbeeld voor een presentatie. -2. Bewerkingsmethode: Bellen`Edit` om een`EditableDocument`. -3. Inhoud ophalen: haal de inhoud op en druk deze af. -4. Inhoud wijzigen: breng de nodige wijzigingen aan. -5. Opties voor opslaan: Geef opslagopties voor presentaties op. -6. Document opslaan: Sla het gewijzigde document op. -## Conclusie -GroupDocs.Editor voor .NET biedt een robuuste en flexibele manier om verschillende documentformaten programmatisch te bewerken. Door deze handleiding te volgen, kunt u documentbewerkingsfunctionaliteiten efficiënt integreren in uw .NET-applicaties, waardoor de mogelijkheden ervan worden vergroot en uw gebruikers meer waarde krijgen. +``` + +**Uitleg:** +1. **Initialiseer Editor:** Laad een PowerPoint‑bestand via `Editor`. +2. **Edit‑methode:** Verkrijg een `EditableDocument`. +3. **Inhoud ophalen:** Extraheer slide‑HTML of platte tekst. +4. **Inhoud wijzigen:** Werk titels, opsommingstekens of afbeeldingen bij. +5. **Opslagopties:** Gebruik `PresentationSaveOptions` om het uitvoerformaat te definiëren. +6. **Document opslaan:** Sla de bewerkte presentatie op. + +## Veelvoorkomende problemen en oplossingen +- **“Format not supported”‑fout:** Controleer of je de nieuwste GroupDocs.Editor‑versie gebruikt; deze voegt regelmatig ondersteuning toe voor nieuwere Office‑formaten. +- **Geheugengebruik bij grote bestanden:** Schakel streaming‑modus in door `EditorSettings.EnableStreaming = true` in te stellen vóór het laden van het document. +- **Licentie niet toegepast:** Zorg ervoor dat het tijdelijke licentiebestand in de toepassings‑root staat of geladen wordt via `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## Veelgestelde vragen -### Wat is GroupDocs.Editor voor .NET? -GroupDocs.Editor voor .NET is een krachtige bibliotheek waarmee ontwikkelaars verschillende documentformaten programmatisch kunnen bewerken binnen hun .NET-toepassingen. -### Hoe ga ik aan de slag met GroupDocs.Editor voor .NET? -U moet de bibliotheek downloaden, een tijdelijke licentie verkrijgen en uw ontwikkelomgeving instellen met de benodigde naamruimten. -### Welke documentformaten worden ondersteund? -GroupDocs.Editor ondersteunt onder andere de formaten Tekstverwerking, Spreadsheet, Presentatie en Tekst. -### Kan ik GroupDocs.Editor gratis gebruiken? - U kunt gebruik maken van een[gratis proefperiode](https://releases.groupdocs.com/) met beperkte functies of verkrijg een[tijdelijke licentie](https://purchase.groupdocs.com/temporary-license/) voor volledige toegang. -### Waar kan ik meer bronnen en ondersteuning vinden? - Bezoek de[GroupDocs.Editor-documentatie](https://tutorials.groupdocs.com/editor/net/) voor gedetailleerde informatie, of bekijk hun[Helpforum](https://forum.groupdocs.com/c/editor/20) voor hulp. \ No newline at end of file + +**Q: Wat is het verschil tussen `DocumentFormatInfo` en `SaveOptions`?** +A: `DocumentFormatInfo` biedt metadata over ondersteunde bestandstypen, terwijl `SaveOptions` configureert hoe een document terug naar schijf wordt geschreven (formaat, compressie, enz.). + +**Q: Kan ik formaten lijst voor een aangepaste bestandsextensie?** +A: Ja — gebruik `DocumentFormatInfo.FromExtension("yourExt")`; als de extensie niet wordt herkend, retourneert de methode `null`. + +**Q: Ondersteunt GroupDocs.Editor wachtwoord‑beveiligde bestanden?** +A: Absoluut. Geef het wachtwoord door aan de `Editor`‑constructor via `EditorSettings` om versleutelde documenten te openen. + +**Q: Hoeveel formaten ondersteunt GroupDocs.Editor daadwerkelijk?** +A: Meer dan **30 invoer‑ en uitvoerformaten**, variërend van Word, Excel, PowerPoint, HTML tot platte tekst. + +**Q: Is er een manier om de lijst te beperken tot alleen bewerkbare formaten?** +A: Gebruik `GetEditableWordProcessingFormats()` (of de Spreadsheet/Presentation‑equivalenten) om formaten op te halen die volledige bewerkingsmogelijkheden bieden. + +## Aanvullende bronnen +- Download de bibliotheek van de [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +- Verkrijg een [temporary license](https://purchase.groupdocs.com/temporary-license/) voor volledige functionaliteit. +- Probeer het product met een [free trial](https://releases.groupdocs.com/). +- Bekijk gedetailleerde gebruiksvoorbeelden in de [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- Krijg hulp van de community op het [support forum](https://forum.groupdocs.com/c/editor/20). + +## Conclusie +Door deze gids te volgen weet je nu hoe je **ondersteunde documentformaten kunt lijst**, **een bestandsformaat kunt bepalen aan de hand van de extensie**, en **documenten kunt bewerken** voor Word-, Spreadsheet- en Presentatietypen met GroupDocs.Editor voor .NET. Integreer deze fragmenten in je eigen projecten om robuuste, formaat‑bewuste applicaties te bouwen die eindgebruikers verrassen en runtime‑fouten verminderen. + +--- + +**Laatst bijgewerkt:** 2026-06-06 +**Getest met:** GroupDocs.Editor 23.9 for .NET +**Auteur:** GroupDocs + +## Gerelateerde tutorials + +- [Documentladen in .NET met GroupDocs.Editor beheersen: Een uitgebreide gids](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Documentbewerking in .NET met GroupDocs.Editor beheersen: Een uitgebreide gids](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Word naar HTML converteren met GroupDocs.Editor .NET: Een stapsgewijze gids](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/english/net/document-processing/work-document-formats/_index.md b/content/english/net/document-processing/work-document-formats/_index.md index e243f0db..27c0e343 100644 --- a/content/english/net/document-processing/work-document-formats/_index.md +++ b/content/english/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Work with Document Formats -linktitle: Work with Document Formats +title: List Supported Document Formats with GroupDocs.Editor .NET +linktitle: List Supported Document Formats second_title: GroupDocs.Editor .NET API -description: Learn how to use GroupDocs.Editor for .NET to edit various document formats programmatically. Step-by-step guide with examples for seamless integration. +description: Learn how to list supported document formats and determine file format extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, quick answers, and FAQs. weight: 13 url: /net/document-processing/work-document-formats/ type: docs +date: 2026-06-06 +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +schemas: +- type: TechArticle + headline: List Supported Document Formats with GroupDocs.Editor .NET + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + dateModified: '2026-06-06' + author: GroupDocs +- type: HowTo + name: List Supported Document Formats with GroupDocs.Editor .NET + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' +- type: FAQPage + questions: + - question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + - question: Can I list formats for a custom file extension? + answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + - question: Does GroupDocs.Editor support password‑protected files? + answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + - question: How many formats does GroupDocs.Editor actually support? + answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + - question: Is there a way to restrict the list to only editable formats? + answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. --- -# Work with Document Formats -## Introduction -Welcome to our in-depth guide on using GroupDocs.Editor for .NET! If you're a developer looking to enhance your applications with document editing capabilities, you've come to the right place. This article will walk you through everything you need to know, from prerequisites to practical examples, to get you up and running with this powerful library. +# List Supported Document Formats + +Welcome to our comprehensive tutorial on **how to list supported document formats** with GroupDocs.Editor for .NET. Whether you’re building a document‑centric web app or an enterprise‑grade desktop tool, knowing exactly which formats you can edit or convert is essential. In this guide you’ll discover how to enumerate formats, parse extensions, and edit documents—all with clear, human‑friendly explanations and ready‑to‑run code snippets. + +## Quick Answers +- **How do I list all supported formats?** Use `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (or the Presentation/Spreadsheet equivalents) and iterate the collection. +- **Can I determine a format from a file extension?** Yes—call `DocumentFormatInfo.FromExtension(".docx")`. +- **What file types does GroupDocs.Editor support?** Over 30 input and output formats, including DOCX, XLSX, PPTX, HTML, and plain text. +- **Do I need a license to list formats?** A temporary license unlocks the full API; otherwise a trial works with limited features. +- **Which .NET versions are compatible?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## What is “list supported document formats”? +The phrase refers to programmatically retrieving the collection of file types that GroupDocs.Editor can open, edit, and save. This operation lets you build dynamic UI dropdowns or validate user uploads before processing, ensuring that only compatible files are passed to the editor for further manipulation. + +## Why list supported document formats? +GroupDocs.Editor **supports 30+ input and output formats** and can handle files up to **2 GB** without loading the entire document into memory. Knowing the exact list prevents runtime errors, improves user experience, and enables you to enforce business rules such as “only allow editable Office documents.” It also helps you present users with only the formats your application truly supports. + ## Prerequisites -Before diving into the examples and functionalities of GroupDocs.Editor for .NET, there are a few prerequisites you need to have in place: -1. Basic Understanding of .NET: Familiarity with .NET Framework or .NET Core is essential. -2. Development Environment: Visual Studio or any other suitable .NET IDE. -3. GroupDocs.Editor for .NET Library: Download the library from the [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). -4. Temporary License: Obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) for full features. -## Import Namespaces -To get started with GroupDocs.Editor for .NET, you need to import the necessary namespaces into your project. This will ensure you have access to all the classes and methods provided by the library. +Before you start, make sure you have: + +1. **.NET development environment** – Visual Studio 2022 or any IDE that supports .NET 6+. +2. **GroupDocs.Editor for .NET library** – download from the [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) for unrestricted access. +4. **Basic C# knowledge** – familiarity with namespaces, `using` statements, and console output. + +## How to List Supported Document Formats? +Load the supported formats collection and print each format’s name and file extension. This two‑step pattern works for Word Processing, Spreadsheet, and Presentation documents. By iterating the collection you can dynamically populate UI elements such as dropdowns, ensuring users can only select formats that the editor can actually handle. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## Step 1: Working with Document Formats -GroupDocs.Editor supports a wide range of document formats. Let’s explore how you can list all supported Word Processing and Presentation formats. ### Listing Word Processing Formats +`Formats.WordProcessingFormats` is an enumeration that describes every Word‑processing file type recognized by the editor. The `All` property returns a collection of these format objects. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explanation: -1. Loop Through Formats: We loop through all available Word Processing formats. -2. Output Format Details: For each format, we print its name and extension. +``` + +**Explanation:** +1. **Loop Through Formats:** We iterate over all available Word‑processing formats. +2. **Output Format Details:** For each format we print its friendly name and default file extension. + ### Listing Presentation Formats +`Formats.PresentationFormats` works the same way for slide‑deck files, exposing each supported presentation type through the `All` collection. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explanation: -1. Loop Through Formats: Similar to Word Processing formats, we loop through all Presentation formats. -2. Output Format Details: Print the name and extension of each format. -## Step 2: Parsing Formats from Extensions -Sometimes, you need to determine the format based on a file extension. GroupDocs.Editor makes this easy. +``` + +**Explanation:** +1. **Loop Through Formats:** The same looping logic applies to presentations. +2. **Output Format Details:** The name and extension are displayed for each format. + +## How to Determine File Format Extension? +Sometimes you only have a file name and need to infer the corresponding `DocumentFormat`. GroupDocs.Editor offers a straightforward static helper that maps a file extension to its internal format representation, allowing you to validate or convert files before loading them into the editor. + ### Parsing Spreadsheet Formats +`Formats.SpreadsheetFormats.FromExtension` converts a file extension string into the matching spreadsheet format enum value. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Explanation: -1. Parse Format: We use the `FromExtension` method to parse the format from the `.xlsm` extension. -2. Output Format: Print the parsed format’s name. +``` + +**Explanation:** +1. **Parse Format:** `FromExtension` converts the `.xlsm` extension into its internal `SpreadsheetFormat` enum. +2. **Output Format:** The parsed format’s name is printed, confirming the mapping. + ### Parsing Textual Formats +Similarly, `Formats.TextualFormats.FromExtension` resolves textual file extensions such as HTML or TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Explanation: -1. Parse Format: The `FromExtension` method is used to parse the format from the `html` extension. -2. Output Format: Print the name of the parsed textual format. -## Step 3: Editing Documents -Now that we've seen how to work with formats, let's dive into editing documents using GroupDocs.Editor. +``` + +**Explanation:** +1. **Parse Format:** The `FromExtension` method resolves the `html` extension to a `TextFormat`. +2. **Output Format:** The name of the textual format is displayed, useful for web‑based editors. + +## How to Edit Documents After Identifying Formats? +Once you know the format, loading and editing a document follows a consistent pattern. First you create an `Editor` instance with the path to the source file, then call `Edit()` to obtain an `EditableDocument`. From there you can read, modify, and finally save the content using appropriate `SaveOptions`. + ### Loading a Document -To edit a document, you first need to load it. +`Editor` is the core class that encapsulates all editing operations for a given file. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { // Further steps will be covered here. } ``` -Explanation: -1. Initialize Editor: Create an instance of the `Editor` class, providing the path to your document. -2. Dispose Pattern: Use the `using` statement to ensure resources are properly disposed of. +``` + +**Explanation:** +1. **Initialize Editor:** Create an `Editor` instance, passing the full path of the target file. +2. **Dispose Pattern:** The `using` statement guarantees that all unmanaged resources are released promptly. + ### Extracting Content -Once the document is loaded, you can extract its content for editing. +`EditableDocument.GetContent()` returns the document’s raw text (or HTML for web‑based editors), which you can display or manipulate. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,12 +214,17 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Explanation: -1. Edit Method: Call the `Edit` method to get an `EditableDocument`. -2. Get Content: Use `GetContent` to retrieve the document’s content as a string. -3. Output Content: Print the content to the console. +``` + +**Explanation:** +1. **Edit Method:** `Edit()` returns an `EditableDocument` object. +2. **Get Content:** `GetContent()` extracts the document’s raw text (or HTML for web‑based editors). +3. **Output Content:** The content is written to the console for verification. + ### Saving Changes -After editing, save your changes back to the document. +`SaveOptions` tells the editor how and in which format to write the edited document back to storage. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -100,14 +233,21 @@ using (EditableDocument editableDocument = editor.Edit()) editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Explanation: -1. Edit Method: Call the `Edit` method to get an `EditableDocument`. -2. Modify Content: Modify the content as needed (not shown in this snippet). -3. Save Options: Create `SaveOptions` specifying the format. -4. Save Document: Use the `Save` method to save the edited document. -## Step 4: Working with Different Document Types -GroupDocs.Editor supports various document types. Here’s how to work with them: +``` + +**Explanation:** +1. **Edit Method:** Re‑obtain the `EditableDocument` after modifications. +2. **Modify Content:** Apply your changes to the string (not shown here). +3. **Save Options:** Configure `SaveOptions` with the desired output format. +4. **Save Document:** Persist the edited file back to disk. + +## How to Work with Different Document Types? +GroupDocs.Editor abstracts Word, Spreadsheet, and Presentation handling behind the same API surface, making it easy to switch contexts without learning a new set of classes for each document family. + ### Editing Spreadsheet Documents +`SpreadsheetSaveOptions` defines how a spreadsheet is written, including format and optional compression settings. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -121,14 +261,20 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) } } ``` -Explanation: -1. Initialize Editor: Create an `Editor` instance for a spreadsheet. -2. Edit Method: Call `Edit` to get an `EditableDocument`. -3. Get Content: Retrieve and print the content. -4. Modify Content: Make necessary changes. -5. Save Options: Specify save options for spreadsheets. -6. Save Document: Save the modified document. +``` + +**Explanation:** +1. **Initialize Editor:** Pass a spreadsheet file path to the `Editor` constructor. +2. **Edit Method:** Retrieve an `EditableDocument`. +3. **Get Content:** Print the spreadsheet’s CSV representation (or HTML). +4. **Modify Content:** Apply any cell‑level changes you need. +5. **Save Options:** Choose the appropriate `SpreadsheetSaveOptions`. +6. **Save Document:** Write the updated spreadsheet back to storage. + ### Editing Presentation Documents +`PresentationSaveOptions` controls the output format for slide decks, allowing you to preserve or change the original file type. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -142,23 +288,56 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) } } ``` -Explanation: -1. Initialize Editor: Create an `Editor` instance for a presentation. -2. Edit Method: Call `Edit` to get an `EditableDocument`. -3. Get Content: Retrieve and print the content. -4. Modify Content: Make necessary changes. -5. Save Options: Specify save options for presentations. -6. Save Document: Save the modified document. +``` + +**Explanation:** +1. **Initialize Editor:** Load a PowerPoint file via `Editor`. +2. **Edit Method:** Obtain an `EditableDocument`. +3. **Get Content:** Extract slide HTML or plain text. +4. **Modify Content:** Update titles, bullet points, or images. +5. **Save Options:** Use `PresentationSaveOptions` to define the output format. +6. **Save Document:** Persist the edited presentation. + +## Common Issues and Solutions +- **“Format not supported” error:** Verify you’re using the latest GroupDocs.Editor version; it adds support for newer Office formats regularly. +- **Large file memory consumption:** Enable streaming mode by setting `EditorSettings.EnableStreaming = true` before loading the document. +- **License not applied:** Ensure the temporary license file is placed in the application root or loaded via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Frequently Asked Questions + +**Q: What is the difference between `DocumentFormatInfo` and `SaveOptions`?** +A: `DocumentFormatInfo` provides metadata about supported file types, while `SaveOptions` configures how a document is written back to disk (format, compression, etc.). + +**Q: Can I list formats for a custom file extension?** +A: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension isn’t recognized, the method returns `null`. + +**Q: Does GroupDocs.Editor support password‑protected files?** +A: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` to open encrypted documents. + +**Q: How many formats does GroupDocs.Editor actually support?** +A: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, HTML, and plain text. + +**Q: Is there a way to restrict the list to only editable formats?** +A: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation equivalents) to retrieve formats that allow full edit capabilities. + +## Additional Resources +- Download the library from the [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +- Obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) for full feature access. +- Try the product with a [free trial](https://releases.groupdocs.com/). +- Explore detailed usage examples in the [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- Get help from the community on the [support forum](https://forum.groupdocs.com/c/editor/20). + ## Conclusion -GroupDocs.Editor for .NET provides a robust and flexible way to edit various document formats programmatically. By following this guide, you can efficiently integrate document editing functionalities into your .NET applications, enhancing their capabilities and providing greater value to your users. -## FAQ's -### What is GroupDocs.Editor for .NET? -GroupDocs.Editor for .NET is a powerful library that allows developers to edit various document formats programmatically within their .NET applications. -### How do I get started with GroupDocs.Editor for .NET? -You need to download the library, obtain a temporary license, and set up your development environment with the necessary namespaces. -### What document formats are supported? -GroupDocs.Editor supports Word Processing, Spreadsheet, Presentation, and Textual formats, among others. -### Can I use GroupDocs.Editor for free? -You can use a [free trial](https://releases.groupdocs.com/) with limited features or obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) for full access. -### Where can I find more resources and support? -Visit the [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/) for detailed information, or check out their [support forum](https://forum.groupdocs.com/c/editor/20) for help. +By following this guide you now know how to **list supported document formats**, **determine a file format from its extension**, and **edit documents** across Word, Spreadsheet, and Presentation types using GroupDocs.Editor for .NET. Incorporate these snippets into your own projects to build robust, format‑aware applications that delight end‑users and reduce runtime errors. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Related Tutorials + +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Master Document Editing in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Convert Word to HTML Using GroupDocs.Editor .NET: A Step‑By‑Step Guide](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) diff --git a/content/french/net/document-processing/work-document-formats/_index.md b/content/french/net/document-processing/work-document-formats/_index.md index 321e0cb3..c7fbf788 100644 --- a/content/french/net/document-processing/work-document-formats/_index.md +++ b/content/french/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Travailler avec des formats de documents -linktitle: Travailler avec des formats de documents -second_title: API GroupDocs.Editor .NET -description: Découvrez comment utiliser GroupDocs.Editor pour .NET pour modifier divers formats de documents par programmation. Guide étape par étape avec des exemples pour une intégration transparente. -weight: 13 -url: /fr/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Apprenez à répertorier les formats de documents pris en charge et à déterminer + l'extension du format de fichier à l'aide de GroupDocs.Editor pour .NET. Guide étape + par étape avec extraits de code, réponses rapides et FAQ. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Lister les formats de documents pris en charge +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Lister les formats de documents pris en charge avec GroupDocs.Editor .NET type: docs +url: /fr/net/document-processing/work-document-formats/ +weight: 13 --- -# Travailler avec des formats de documents - -## Introduction -Bienvenue dans notre guide détaillé sur l'utilisation de GroupDocs.Editor pour .NET ! Si vous êtes un développeur cherchant à améliorer vos applications avec des fonctionnalités d'édition de documents, vous êtes au bon endroit. Cet article vous expliquera tout ce que vous devez savoir, des prérequis aux exemples pratiques, pour vous permettre d'être opérationnel avec cette puissante bibliothèque. -## Conditions préalables -Avant de plonger dans les exemples et les fonctionnalités de GroupDocs.Editor pour .NET, vous devez mettre en place quelques prérequis : -1. Compréhension de base de .NET : une connaissance de .NET Framework ou de .NET Core est essentielle. -2. Environnement de développement : Visual Studio ou tout autre IDE .NET approprié. -3. GroupDocs.Editor for .NET Library : téléchargez la bibliothèque à partir du[Page des versions de GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Permis temporaire : obtenez un[permis temporaire](https://purchase.groupdocs.com/temporary-license/) pour toutes les fonctionnalités. -## Importer des espaces de noms -Pour démarrer avec GroupDocs.Editor pour .NET, vous devez importer les espaces de noms nécessaires dans votre projet. Cela garantira que vous avez accès à toutes les classes et méthodes fournies par la bibliothèque. + +# Liste des formats de documents pris en charge + +Bienvenue dans notre tutoriel complet sur **comment répertorier les formats de documents pris en charge** avec GroupDocs.Editor pour .NET. Que vous construisiez une application web centrée sur les documents ou un outil de bureau de niveau entreprise, connaître exactement les formats que vous pouvez éditer ou convertir est essentiel. Dans ce guide, vous découvrirez comment énumérer les formats, analyser les extensions et modifier des documents — le tout avec des explications claires et conviviales ainsi que des extraits de code prêts à l’exécution. + +## Réponses rapides +- **Comment lister tous les formats pris en charge ?** Utilisez `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (ou les équivalents Presentation/Spreadsheet) et itérez la collection. +- **Puis-je déterminer un format à partir d’une extension de fichier ?** Oui — appelez `DocumentFormatInfo.FromExtension(".docx")`. +- **Quels types de fichiers GroupDocs.Editor prend‑en charge ?** Plus de 30 formats d’entrée et de sortie, y compris DOCX, XLSX, PPTX, HTML et texte brut. +- **Ai‑je besoin d’une licence pour lister les formats ?** Une licence temporaire débloque l’API complète ; sinon, un essai fonctionne avec des fonctionnalités limitées. +- **Quelles versions de .NET sont compatibles ?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Qu’est‑ce que « répertorier les formats de documents pris en charge » ? +Cette expression désigne la récupération programmatique de la collection de types de fichiers que GroupDocs.Editor peut ouvrir, modifier et enregistrer. Cette opération vous permet de créer des listes déroulantes d’interface utilisateur dynamiques ou de valider les téléchargements d’utilisateurs avant le traitement, en veillant à ce que seules les fichiers compatibles soient transmis à l’éditeur pour une manipulation ultérieure. + +## Pourquoi répertorier les formats de documents pris en charge ? +GroupDocs.Editor **prend en charge plus de 30 formats d’entrée et de sortie** et peut gérer des fichiers jusqu’à **2 Go** sans charger le document complet en mémoire. Connaître la liste exacte évite les erreurs d’exécution, améliore l’expérience utilisateur et vous permet d’appliquer des règles métier telles que « autoriser uniquement les documents Office modifiables ». Cela vous aide également à ne présenter aux utilisateurs que les formats réellement supportés par votre application. + +## Prérequis +1. **Environnement de développement .NET** – Visual Studio 2022 ou tout IDE supportant .NET 6+. +2. **Bibliothèque GroupDocs.Editor pour .NET** – téléchargez depuis la [page des releases GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Licence temporaire** – obtenez une [licence temporaire](https://purchase.groupdocs.com/temporary-license/) pour un accès complet. +4. **Connaissances de base en C#** – familiarité avec les espaces de noms, les instructions `using` et la sortie console. + +## Comment répertorier les formats de documents pris en charge ? +Chargez la collection des formats pris en charge et affichez le nom et l’extension de chaque format. Ce modèle en deux étapes fonctionne pour les documents de traitement de texte, les feuilles de calcul et les présentations. En itérant la collection, vous pouvez remplir dynamiquement des éléments d’interface tels que des listes déroulantes, garantissant que les utilisateurs ne puissent sélectionner que les formats réellement gérés par l’éditeur. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Répertorier les formats de traitement de texte +`Formats.WordProcessingFormats` est une énumération qui décrit chaque type de fichier de traitement de texte reconnu par l’éditeur. La propriété `All` renvoie une collection de ces objets de format. -## Étape 1 : Travailler avec des formats de documents -GroupDocs.Editor prend en charge un large éventail de formats de documents. Voyons comment répertorier tous les formats de traitement de texte et de présentation pris en charge. -### Liste des formats de traitement de texte +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explication: -1. Formats en boucle : nous parcourons tous les formats de traitement de texte disponibles. -2. Détails du format de sortie : pour chaque format, nous imprimons son nom et son extension. -### Formats de présentation des listes +``` + +**Explication :** +1. **Boucler sur les formats :** Nous itérons sur tous les formats de traitement de texte disponibles. +2. **Afficher les détails du format :** Pour chaque format, nous affichons son nom convivial et son extension de fichier par défaut. + +### Répertorier les formats de présentation +`Formats.PresentationFormats` fonctionne de la même manière pour les fichiers de présentations, exposant chaque type de présentation pris en charge via la collection `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explication: -1. Formats en boucle : comme pour les formats de traitement de texte, nous parcourons tous les formats de présentation. -2. Détails du format de sortie : imprimez le nom et l'extension de chaque format. -## Étape 2 : analyse des formats à partir des extensions -Parfois, vous devez déterminer le format en fonction d'une extension de fichier. GroupDocs.Editor rend cela facile. +``` + +**Explication :** +1. **Boucler sur les formats :** La même logique de boucle s’applique aux présentations. +2. **Afficher les détails du format :** Le nom et l’extension sont affichés pour chaque format. + +## Comment déterminer l’extension d’un format de fichier ? +Parfois, vous ne disposez que du nom d’un fichier et devez en déduire le `DocumentFormat` correspondant. GroupDocs.Editor propose un assistant statique simple qui associe une extension de fichier à sa représentation interne de format, vous permettant de valider ou de convertir les fichiers avant de les charger dans l’éditeur. + ### Analyse des formats de feuilles de calcul +`Formats.SpreadsheetFormats.FromExtension` convertit une chaîne d’extension de fichier en la valeur d’énumération du format de feuille de calcul correspondant. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Explication: -1. Format d'analyse : nous utilisons le`FromExtension` méthode pour analyser le format à partir du`.xlsm` extension. -2. Format de sortie : imprime le nom du format analysé. +``` + +**Explication :** +1. **Analyser le format :** `FromExtension` convertit l’extension `.xlsm` en son énumération interne `SpreadsheetFormat`. +2. **Afficher le format :** Le nom du format analysé est affiché, confirmant le mappage. + ### Analyse des formats textuels +De même, `Formats.TextualFormats.FromExtension` résout les extensions de fichiers textuels comme HTML ou TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Explication: -1. Format d'analyse : le`FromExtension` La méthode est utilisée pour analyser le format à partir du`html` extension. -2. Format de sortie : imprime le nom du format textuel analysé. -## Étape 3 : Modification de documents -Maintenant que nous avons vu comment travailler avec les formats, passons à l'édition de documents à l'aide de GroupDocs.Editor. -### Chargement d'un document -Pour modifier un document, vous devez d'abord le charger. +``` + +**Explication :** +1. **Analyser le format :** La méthode `FromExtension` résout l’extension `html` en un `TextFormat`. +2. **Afficher le format :** Le nom du format textuel est affiché, utile pour les éditeurs web. + +## Comment modifier des documents après avoir identifié les formats ? +Une fois le format connu, le chargement et la modification d’un document suivent un schéma cohérent. Vous créez d’abord une instance `Editor` avec le chemin du fichier source, puis appelez `Edit()` pour obtenir un `EditableDocument`. À partir de là, vous pouvez lire, modifier et enfin enregistrer le contenu en utilisant les `SaveOptions` appropriés. + +### Chargement d’un document +`Editor` est la classe principale qui encapsule toutes les opérations d’édition pour un fichier donné. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // D’autres étapes seront couvertes ici. + // Further steps will be covered here. } ``` -Explication: -1. Initialiser l'éditeur : créez une instance de l'éditeur`Editor` classe, fournissant le chemin d’accès à votre document. -2. Modèle de suppression : utilisez le`using` déclaration pour garantir que les ressources sont correctement utilisées. -### Extraction de contenu -Une fois le document chargé, vous pouvez extraire son contenu pour le modifier. +``` + +**Explication :** +1. **Initialiser l’éditeur :** Créez une instance `Editor` en passant le chemin complet du fichier cible. +2. **Modèle de libération :** L’instruction `using` garantit que toutes les ressources non gérées sont libérées rapidement. + +### Extraction du contenu +`EditableDocument.GetContent()` renvoie le texte brut du document (ou le HTML pour les éditeurs web), que vous pouvez afficher ou manipuler. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Explication: -1. Méthode d'édition : appelez le`Edit` méthode pour obtenir un`EditableDocument`. -2. Obtenir du contenu : utiliser`GetContent` pour récupérer le contenu du document sous forme de chaîne. -3. Contenu de sortie : imprimez le contenu sur la console. -### Enregistrer les modifications -Après l'édition, enregistrez vos modifications dans le document. +``` + +**Explication :** +1. **Méthode Edit :** `Edit()` renvoie un objet `EditableDocument`. +2. **Obtenir le contenu :** `GetContent()` extrait le texte brut du document (ou le HTML pour les éditeurs web). +3. **Afficher le contenu :** Le contenu est écrit dans la console pour vérification. + +### Enregistrement des modifications +`SaveOptions` indique à l’éditeur comment et dans quel format écrire le document modifié dans le stockage. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Modifier le contenu ici + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Explication: -1. Méthode d'édition : appelez le`Edit` méthode pour obtenir un`EditableDocument`. -2. Modifier le contenu : modifiez le contenu selon vos besoins (non affiché dans cet extrait). -3. Options d'enregistrement : Créer`SaveOptions` en précisant le format. -4. Enregistrer le document : utilisez le`Save` méthode pour enregistrer le document modifié. -## Étape 4 : Travailler avec différents types de documents -GroupDocs.Editor prend en charge différents types de documents. Voici comment travailler avec eux : +``` + +**Explication :** +1. **Méthode Edit :** Récupérez à nouveau le `EditableDocument` après les modifications. +2. **Modifier le contenu :** Appliquez vos changements à la chaîne (non montré ici). +3. **Options d’enregistrement :** Configurez `SaveOptions` avec le format de sortie souhaité. +4. **Enregistrer le document :** Sauvegardez le fichier modifié sur le disque. + +## Comment travailler avec différents types de documents ? +GroupDocs.Editor abstrait la gestion de Word, Spreadsheet et Presentation derrière la même surface d’API, facilitant le changement de contexte sans devoir apprendre un nouvel ensemble de classes pour chaque famille de documents. + ### Modification de documents de feuille de calcul +`SpreadsheetSaveOptions` définit comment une feuille de calcul est écrite, incluant le format et les paramètres de compression optionnels. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifier le contenu ici + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Explication: -1. Initialiser l'éditeur : créer un`Editor` exemple pour une feuille de calcul. -2. Méthode d'édition : Appeler`Edit` pour obtenir un`EditableDocument`. -3. Obtenir du contenu : récupérez et imprimez le contenu. -4. Modifier le contenu : apportez les modifications nécessaires. -5. Options d'enregistrement : spécifiez les options d'enregistrement pour les feuilles de calcul. -6. Enregistrer le document : enregistrez le document modifié. +``` + +**Explication :** +1. **Initialiser l’éditeur :** Passez le chemin d’un fichier de feuille de calcul au constructeur `Editor`. +2. **Méthode Edit :** Récupérez un `EditableDocument`. +3. **Obtenir le contenu :** Affichez la représentation CSV de la feuille de calcul (ou HTML). +4. **Modifier le contenu :** Appliquez les modifications au niveau des cellules nécessaires. +5. **Options d’enregistrement :** Choisissez les `SpreadsheetSaveOptions` appropriées. +6. **Enregistrer le document :** Écrivez la feuille de calcul mise à jour dans le stockage. + ### Modification de documents de présentation +`PresentationSaveOptions` contrôle le format de sortie des présentations, vous permettant de conserver ou de changer le type de fichier original. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifier le contenu ici + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Explication: -1. Initialiser l'éditeur : créer un`Editor` par exemple pour une présentation. -2. Méthode d'édition : Appeler`Edit` pour obtenir un`EditableDocument`. -3. Obtenir du contenu : récupérez et imprimez le contenu. -4. Modifier le contenu : apportez les modifications nécessaires. -5. Options d'enregistrement : spécifiez les options d'enregistrement pour les présentations. -6. Enregistrer le document : enregistrez le document modifié. +``` + +**Explication :** +1. **Initialiser l’éditeur :** Chargez un fichier PowerPoint via `Editor`. +2. **Méthode Edit :** Obtenez un `EditableDocument`. +3. **Obtenir le contenu :** Extrayez le HTML des diapositives ou le texte brut. +4. **Modifier le contenu :** Mettez à jour les titres, puces ou images. +5. **Options d’enregistrement :** Utilisez `PresentationSaveOptions` pour définir le format de sortie. +6. **Enregistrer le document :** Sauvegardez la présentation modifiée. + +## Problèmes courants et solutions +- **Erreur « Format non pris en charge » :** Vérifiez que vous utilisez la dernière version de GroupDocs.Editor ; elle ajoute régulièrement la prise en charge de nouveaux formats Office. +- **Consommation mémoire pour les gros fichiers :** Activez le mode streaming en définissant `EditorSettings.EnableStreaming = true` avant de charger le document. +- **Licence non appliquée :** Assurez‑vous que le fichier de licence temporaire est placé à la racine de l’application ou chargé via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Questions fréquemment posées + +**Q : Quelle est la différence entre `DocumentFormatInfo` et `SaveOptions` ?** +R : `DocumentFormatInfo` fournit des métadonnées sur les types de fichiers pris en charge, tandis que `SaveOptions` configure la façon dont un document est enregistré sur le disque (format, compression, etc.). + +**Q : Puis‑je répertorier les formats pour une extension de fichier personnalisée ?** +R : Oui — utilisez `DocumentFormatInfo.FromExtension("yourExt")` ; si l’extension n’est pas reconnue, la méthode renvoie `null`. + +**Q : GroupDocs.Editor prend‑il en charge les fichiers protégés par mot de passe ?** +R : Absolument. Transmettez le mot de passe au constructeur `Editor` via `EditorSettings` pour ouvrir les documents chiffrés. + +**Q : Combien de formats GroupDocs.Editor prend‑il réellement en charge ?** +R : Plus de **30 formats d’entrée et de sortie**, couvrant Word, Excel, PowerPoint, HTML et texte brut. + +**Q : Existe‑t‑il un moyen de restreindre la liste aux seuls formats éditables ?** +R : Utilisez `GetEditableWordProcessingFormats()` (ou les équivalents Spreadsheet/Presentation) pour récupérer les formats qui permettent des capacités d’édition complètes. + +## Ressources supplémentaires +- Téléchargez la bibliothèque depuis la [page des releases GroupDocs](https://releases.groupdocs.com/editor/net/). +- Obtenez une [licence temporaire](https://purchase.groupdocs.com/temporary-license/) pour un accès complet aux fonctionnalités. +- Essayez le produit avec un [essai gratuit](https://releases.groupdocs.com/). +- Explorez des exemples d’utilisation détaillés dans la [documentation GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Obtenez de l’aide de la communauté sur le [forum de support](https://forum.groupdocs.com/c/editor/20). + ## Conclusion -GroupDocs.Editor pour .NET fournit un moyen robuste et flexible de modifier divers formats de documents par programme. En suivant ce guide, vous pouvez intégrer efficacement les fonctionnalités d'édition de documents dans vos applications .NET, améliorant ainsi leurs capacités et offrant une plus grande valeur à vos utilisateurs. -## FAQ -### Qu’est-ce que GroupDocs.Editor pour .NET ? -GroupDocs.Editor for .NET est une bibliothèque puissante qui permet aux développeurs de modifier divers formats de documents par programmation au sein de leurs applications .NET. -### Comment démarrer avec GroupDocs.Editor pour .NET ? -Vous devez télécharger la bibliothèque, obtenir une licence temporaire et configurer votre environnement de développement avec les espaces de noms nécessaires. -### Quels formats de documents sont pris en charge ? -GroupDocs.Editor prend en charge, entre autres, les formats de traitement de texte, de feuille de calcul, de présentation et de texte. -### Puis-je utiliser GroupDocs.Editor gratuitement ? - Vous pouvez utiliser un[essai gratuit](https://releases.groupdocs.com/) avec des fonctionnalités limitées ou obtenir un[permis temporaire](https://purchase.groupdocs.com/temporary-license/) pour un accès complet. -### Où puis-je trouver plus de ressources et d’assistance ? - Visiter le[Documentation GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) pour des informations détaillées, ou consultez leur[forum d'entraide](https://forum.groupdocs.com/c/editor/20) pour aider. \ No newline at end of file +En suivant ce guide, vous savez maintenant comment **répertorier les formats de documents pris en charge**, **déterminer le format d’un fichier à partir de son extension**, et **modifier des documents** pour les types Word, Spreadsheet et Presentation en utilisant GroupDocs.Editor pour .NET. Intégrez ces extraits dans vos propres projets pour créer des applications robustes et conscientes des formats, qui raviront les utilisateurs finaux et réduiront les erreurs d’exécution. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Tutoriels associés + +- [Maîtriser le chargement de documents en .NET avec GroupDocs.Editor : Guide complet](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Maîtriser l’édition de documents en .NET avec GroupDocs.Editor : Guide complet](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Convertir Word en HTML avec GroupDocs.Editor .NET : Guide étape par étape](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/german/net/document-processing/work-document-formats/_index.md b/content/german/net/document-processing/work-document-formats/_index.md index 4eb93de9..f2926ccd 100644 --- a/content/german/net/document-processing/work-document-formats/_index.md +++ b/content/german/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Arbeiten mit Dokumentformaten -linktitle: Arbeiten mit Dokumentformaten +date: 2026-06-06 +description: Erfahren Sie, wie Sie unterstützte Dokumentformate auflisten und die + Dateiformaterweiterung mit GroupDocs.Editor für .NET bestimmen. Schritt‑für‑Schritt‑Anleitung + mit Code‑Beispielen, schnellen Antworten und FAQs. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Unterstützte Dokumentformate auflisten +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Erfahren Sie, wie Sie mit GroupDocs.Editor für .NET verschiedene Dokumentformate programmgesteuert bearbeiten. Schritt-für-Schritt-Anleitung mit Beispielen für eine nahtlose Integration. -weight: 13 -url: /de/net/document-processing/work-document-formats/ +title: Unterstützte Dokumentformate auflisten mit GroupDocs.Editor .NET type: docs +url: /de/net/document-processing/work-document-formats/ +weight: 13 --- -# Arbeiten mit Dokumentformaten -## Einführung -Willkommen zu unserem ausführlichen Leitfaden zur Verwendung von GroupDocs.Editor für .NET! Wenn Sie Entwickler sind und Ihre Anwendungen mit Dokumentbearbeitungsfunktionen erweitern möchten, sind Sie hier richtig. Dieser Artikel führt Sie durch alles, was Sie wissen müssen, von Voraussetzungen bis hin zu praktischen Beispielen, damit Sie diese leistungsstarke Bibliothek sofort nutzen können. +# Liste unterstützter Dokumentformate + +Willkommen zu unserem umfassenden Tutorial, wie man **unterstützte Dokumentformate** mit GroupDocs.Editor für .NET auflistet. Egal, ob Sie eine dokumenten‑zentrierte Web‑App oder ein Enterprise‑Desktop‑Tool bauen, es ist entscheidend zu wissen, welche Formate Sie bearbeiten oder konvertieren können. In diesem Leitfaden erfahren Sie, wie Sie Formate enumerieren, Erweiterungen parsen und Dokumente bearbeiten – alles mit klaren, benutzerfreundlichen Erklärungen und sofort ausführbaren Code‑Snippets. + +## Schnelle Antworten +- **Wie liste ich alle unterstützten Formate auf?** Verwenden Sie `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (bzw. die entsprechenden Methoden für Präsentationen/Tabellen) und iterieren Sie über die Sammlung. +- **Kann ich ein Format anhand einer Dateierweiterung bestimmen?** Ja – rufen Sie `DocumentFormatInfo.FromExtension(".docx")` auf. +- **Welche Dateitypen unterstützt GroupDocs.Editor?** Mehr als 30 Eingabe‑ und Ausgabeformate, darunter DOCX, XLSX, PPTX, HTML und Nur‑Text. +- **Benötige ich eine Lizenz, um Formate aufzulisten?** Eine temporäre Lizenz schaltet die komplette API frei; andernfalls funktioniert eine Testversion mit eingeschränkten Funktionen. +- **Welche .NET‑Versionen sind kompatibel?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Was bedeutet „unterstützte Dokumentformate auflisten“? +Der Ausdruck bezieht sich darauf, programmgesteuert die Sammlung von Dateitypen abzurufen, die GroupDocs.Editor öffnen, bearbeiten und speichern kann. Dieser Vorgang ermöglicht es Ihnen, dynamische UI‑Dropdowns zu erstellen oder Benutzer‑Uploads vor der Verarbeitung zu validieren, sodass nur kompatible Dateien an den Editor übergeben werden. + +## Warum unterstützte Dokumentformate auflisten? +GroupDocs.Editor **unterstützt über 30 Eingabe‑ und Ausgabeformate** und kann Dateien bis zu **2 GB** verarbeiten, ohne das gesamte Dokument in den Speicher zu laden. Das genaue Wissen um die unterstützten Formate verhindert Laufzeitfehler, verbessert die Benutzererfahrung und erlaubt Ihnen, Geschäftsregeln wie „nur editierbare Office‑Dokumente zulassen“ durchzusetzen. Zudem können Sie Benutzern nur die Formate anzeigen, die Ihre Anwendung tatsächlich unterstützt. + ## Voraussetzungen -Bevor Sie sich in die Beispiele und Funktionen von GroupDocs.Editor für .NET vertiefen, müssen einige Voraussetzungen erfüllt sein: -1. Grundlegende Kenntnisse von .NET: Vertrautheit mit .NET Framework oder .NET Core ist unbedingt erforderlich. -2. Entwicklungsumgebung: Visual Studio oder eine andere geeignete .NET IDE. -3. GroupDocs.Editor für .NET-Bibliothek: Laden Sie die Bibliothek herunter von der[GroupDocs-Veröffentlichungsseite](https://releases.groupdocs.com/editor/net/). -4. Temporäre Lizenz: Erhalten Sie eine[vorläufige Lizenz](https://purchase.groupdocs.com/temporary-license/) für den vollen Funktionsumfang. -## Namespaces importieren -Um mit GroupDocs.Editor für .NET zu beginnen, müssen Sie die erforderlichen Namespaces in Ihr Projekt importieren. Dadurch wird sichergestellt, dass Sie Zugriff auf alle von der Bibliothek bereitgestellten Klassen und Methoden haben. +Bevor Sie beginnen, stellen Sie sicher, dass Sie Folgendes haben: + +1. **.NET‑Entwicklungsumgebung** – Visual Studio 2022 oder jede IDE, die .NET 6+ unterstützt. +2. **GroupDocs.Editor für .NET‑Bibliothek** – herunterladen von der [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **Temporäre Lizenz** – erhalten Sie eine [temporary license](https://purchase.groupdocs.com/temporary-license/) für uneingeschränkten Zugriff. +4. **Grundkenntnisse in C#** – Vertrautheit mit Namespaces, `using`‑Anweisungen und Konsolenausgabe. + +## Wie listet man unterstützte Dokumentformate auf? +Laden Sie die Sammlung der unterstützten Formate und geben Sie für jedes Format den Namen und die Dateierweiterung aus. Dieses zweistufige Muster funktioniert für Word‑Processing, Tabellen‑ und Präsentationsdokumente. Durch das Durchlaufen der Sammlung können Sie UI‑Elemente wie Dropdowns dynamisch befüllen, sodass Benutzer nur Formate auswählen können, die der Editor tatsächlich handhaben kann. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Auflisten von Word‑Processing‑Formaten +`Formats.WordProcessingFormats` ist eine Aufzählung, die jeden vom Editor erkannten Word‑Processing‑Dateityp beschreibt. Die Eigenschaft `All` liefert eine Sammlung dieser Formatobjekte. -## Schritt 1: Arbeiten mit Dokumentformaten -GroupDocs.Editor unterstützt eine Vielzahl von Dokumentformaten. Sehen wir uns an, wie Sie alle unterstützten Textverarbeitungs- und Präsentationsformate auflisten können. -### Auflisten von Textverarbeitungsformaten +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Erläuterung: -1. Formate durchlaufen: Wir durchlaufen alle verfügbaren Textverarbeitungsformate. -2. Details zum Ausgabeformat: Für jedes Format drucken wir seinen Namen und seine Erweiterung. -### Auflistung der Präsentationsformate +``` + +**Erklärung:** +1. **Durchlaufen der Formate:** Wir iterieren über alle verfügbaren Word‑Processing‑Formate. +2. **Ausgabe der Formatinformationen:** Für jedes Format geben wir den benutzerfreundlichen Namen und die Standard‑Dateierweiterung aus. + +### Auflisten von Präsentationsformaten +`Formats.PresentationFormats` funktioniert auf dieselbe Weise für Folien‑Dateien und stellt jeden unterstützten Präsentationstyp über die Sammlung `All` bereit. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Erläuterung: -1. Durch Formate schleifen: Ähnlich wie bei den Textverarbeitungsformaten durchlaufen wir alle Präsentationsformate. -2. Details zum Ausgabeformat: Drucken Sie den Namen und die Erweiterung jedes Formats. -## Schritt 2: Formate aus Erweiterungen analysieren -Manchmal müssen Sie das Format anhand einer Dateierweiterung bestimmen. GroupDocs.Editor macht dies einfach. -### Analysieren von Tabellenkalkulationsformaten +``` + +**Erklärung:** +1. **Durchlaufen der Formate:** Die gleiche Schleifenlogik gilt für Präsentationen. +2. **Ausgabe der Formatinformationen:** Name und Erweiterung werden für jedes Format angezeigt. + +## Wie bestimmt man die Dateiformat‑Erweiterung? +Manchmal haben Sie nur einen Dateinamen und müssen das zugehörige `DocumentFormat` ableiten. GroupDocs.Editor bietet einen einfachen statischen Helfer, der eine Dateierweiterung ihrer internen Format‑Repräsentation zuordnet, sodass Sie Dateien vor dem Laden in den Editor validieren oder konvertieren können. + +### Parsen von Tabellenformaten +`Formats.SpreadsheetFormats.FromExtension` wandelt einen Dateierweiterungs‑String in den passenden Tabellen‑Format‑Enum‑Wert um. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Erläuterung: -1. Parse-Format: Wir verwenden das`FromExtension` Methode zum Parsen des Formats aus dem`.xlsm` Verlängerung. -2. Ausgabeformat: Drucken Sie den Namen des analysierten Formats. -### Textformate analysieren +``` + +**Erklärung:** +1. **Format parsen:** `FromExtension` konvertiert die Erweiterung `.xlsm` in das interne `SpreadsheetFormat`‑Enum. +2. **Ausgabe des Formats:** Der Name des geparsten Formats wird ausgegeben, um die Zuordnung zu bestätigen. + +### Parsen von Textformaten +Analog dazu löst `Formats.TextualFormats.FromExtension` textbasierte Dateierweiterungen wie HTML oder TXT auf. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Erläuterung: -1. Parse-Format: Das`FromExtension` Methode wird verwendet, um das Format aus dem`html` Verlängerung. -2. Ausgabeformat: Drucken Sie den Namen des analysierten Textformats. -## Schritt 3: Dokumente bearbeiten -Nachdem wir nun gesehen haben, wie man mit Formaten arbeitet, wollen wir uns mit der Bearbeitung von Dokumenten mit GroupDocs.Editor befassen. +``` + +**Erklärung:** +1. **Format parsen:** Die Methode `FromExtension` ordnet die Erweiterung `html` einem `TextFormat` zu. +2. **Ausgabe des Formats:** Der Name des Textformats wird angezeigt, was für web‑basierte Editoren nützlich ist. + +## Wie bearbeitet man Dokumente nach der Formatbestimmung? +Sobald Sie das Format kennen, folgt das Laden und Bearbeiten eines Dokuments einem konsistenten Muster. Zuerst erstellen Sie eine `Editor`‑Instanz mit dem Pfad zur Quelldatei, dann rufen Sie `Edit()` auf, um ein `EditableDocument` zu erhalten. Von dort aus können Sie den Inhalt lesen, ändern und schließlich mit passenden `SaveOptions` speichern. + ### Laden eines Dokuments -Um ein Dokument zu bearbeiten, müssen Sie es zuerst laden. +`Editor` ist die Kernklasse, die alle Bearbeitungsoperationen für eine gegebene Datei kapselt. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Die weiteren Schritte werden hier beschrieben. + // Further steps will be covered here. } ``` -Erläuterung: -1. Editor initialisieren: Erstellen Sie eine Instanz des`Editor` Klasse, die den Pfad zu Ihrem Dokument bereitstellt. -2. Dispose-Muster: Verwenden Sie das`using` Erklärung, um sicherzustellen, dass die Ressourcen ordnungsgemäß entsorgt werden. -### Extrahieren von Inhalten -Sobald das Dokument geladen ist, können Sie seinen Inhalt zum Bearbeiten extrahieren. +``` + +**Erklärung:** +1. **Editor initialisieren:** Erstellen Sie eine `Editor`‑Instanz und übergeben Sie den vollständigen Pfad der Zieldatei. +2. **Dispose‑Muster:** Die `using`‑Anweisung stellt sicher, dass alle nicht verwalteten Ressourcen sofort freigegeben werden. + +### Extrahieren von Inhalt +`EditableDocument.GetContent()` liefert den Rohtext des Dokuments (oder HTML für web‑basierte Editoren), den Sie anzeigen oder manipulieren können. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Erläuterung: -1. Methode bearbeiten: Rufen Sie die`Edit` Methode zum Erhalten einer`EditableDocument`. -2. Inhalte abrufen: Verwenden Sie`GetContent` um den Inhalt des Dokuments als Zeichenfolge abzurufen. -3. Inhalt ausgeben: Drucken Sie den Inhalt auf der Konsole. +``` + +**Erklärung:** +1. **Edit‑Methode:** `Edit()` gibt ein `EditableDocument`‑Objekt zurück. +2. **Inhalt holen:** `GetContent()` extrahiert den Rohtext des Dokuments (oder HTML für web‑basierte Editoren). +3. **Inhalt ausgeben:** Der Inhalt wird zur Überprüfung in die Konsole geschrieben. + ### Änderungen speichern -Speichern Sie Ihre Änderungen nach der Bearbeitung wieder im Dokument. +`SaveOptions` gibt dem Editor vor, wie und in welchem Format das bearbeitete Dokument zurück in den Speicher geschrieben wird. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Inhalt hier ändern + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Erläuterung: -1. Methode bearbeiten: Rufen Sie die`Edit` Methode zum Erhalten einer`EditableDocument`. -2. Inhalt ändern: Ändern Sie den Inhalt nach Bedarf (wird in diesem Snippet nicht angezeigt). -3. Speicheroptionen: Erstellen`SaveOptions` Angabe des Formats. -4. Dokument speichern: Verwenden Sie die`Save` Methode zum Speichern des bearbeiteten Dokuments. -## Schritt 4: Arbeiten mit verschiedenen Dokumenttypen -GroupDocs.Editor unterstützt verschiedene Dokumenttypen. So arbeiten Sie mit ihnen: -### Bearbeiten von Tabellenkalkulationsdokumenten +``` + +**Erklärung:** +1. **Edit‑Methode erneut aufrufen:** Holen Sie das `EditableDocument` nach den Änderungen erneut. +2. **Inhalt ändern:** Nehmen Sie Ihre Änderungen am String vor (hier nicht gezeigt). +3. **Speicheroptionen:** Konfigurieren Sie `SaveOptions` mit dem gewünschten Ausgabeformat. +4. **Dokument speichern:** Persistieren Sie die bearbeitete Datei wieder auf dem Datenträger. + +## Wie arbeitet man mit verschiedenen Dokumenttypen? +GroupDocs.Editor abstrahiert die Behandlung von Word, Tabellen und Präsentationen hinter derselben API‑Oberfläche, sodass Sie den Kontext wechseln können, ohne für jede Dokumentfamilie neue Klassen lernen zu müssen. + +### Bearbeiten von Tabellendokumenten +`SpreadsheetSaveOptions` definiert, wie eine Tabelle geschrieben wird, einschließlich Format und optionaler Komprimierungseinstellungen. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Inhalt hier ändern + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Erläuterung: -1. Editor initialisieren: Erstellen Sie einen`Editor` Instanz für eine Tabellenkalkulation. -2. Bearbeitungsmethode: Aufruf`Edit` um eine`EditableDocument`. -3. Inhalt abrufen: Inhalt abrufen und drucken. -4. Inhalt ändern: Nehmen Sie die erforderlichen Änderungen vor. -5. Speicheroptionen: Geben Sie Speicheroptionen für Tabellen an. -6. Dokument speichern: Speichert das geänderte Dokument. +``` + +**Erklärung:** +1. **Editor initialisieren:** Pfad zu einer Tabellendatei an den `Editor`‑Konstruktor übergeben. +2. **Edit‑Methode:** Ein `EditableDocument` abrufen. +3. **Inhalt holen:** Die CSV‑Darstellung (oder HTML) der Tabelle ausgeben. +4. **Inhalt ändern:** Zell‑Level‑Änderungen vornehmen. +5. **Speicheroptionen:** Die passenden `SpreadsheetSaveOptions` auswählen. +6. **Dokument speichern:** Die aktualisierte Tabelle zurück in den Speicher schreiben. + ### Bearbeiten von Präsentationsdokumenten +`PresentationSaveOptions` steuert das Ausgabeformat für Folien‑Decks und ermöglicht es Ihnen, den ursprünglichen Dateityp beizubehalten oder zu ändern. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Inhalt hier ändern + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Erläuterung: -1. Editor initialisieren: Erstellen Sie einen`Editor` Instanz für eine Präsentation. -2. Bearbeitungsmethode: Aufruf`Edit` um eine`EditableDocument`. -3. Inhalt abrufen: Inhalt abrufen und drucken. -4. Inhalt ändern: Nehmen Sie die erforderlichen Änderungen vor. -5. Speicheroptionen: Geben Sie Speicheroptionen für Präsentationen an. -6. Dokument speichern: Speichert das geänderte Dokument. -## Abschluss -GroupDocs.Editor für .NET bietet eine robuste und flexible Möglichkeit, verschiedene Dokumentformate programmgesteuert zu bearbeiten. Wenn Sie dieser Anleitung folgen, können Sie Dokumentbearbeitungsfunktionen effizient in Ihre .NET-Anwendungen integrieren, deren Fähigkeiten verbessern und Ihren Benutzern einen höheren Mehrwert bieten. +``` + +**Erklärung:** +1. **Editor initialisieren:** Laden Sie eine PowerPoint‑Datei über `Editor`. +2. **Edit‑Methode:** Ein `EditableDocument` erhalten. +3. **Inhalt holen:** Folien‑HTML oder Nur‑Text extrahieren. +4. **Inhalt ändern:** Titel, Aufzählungen oder Bilder aktualisieren. +5. **Speicheroptionen:** `PresentationSaveOptions` verwenden, um das Ausgabeformat festzulegen. +6. **Dokument speichern:** Die bearbeitete Präsentation persistieren. + +## Häufige Probleme und Lösungen +- **„Format not supported“-Fehler:** Stellen Sie sicher, dass Sie die neueste Version von GroupDocs.Editor verwenden; sie fügt regelmäßig Unterstützung für neuere Office‑Formate hinzu. +- **Hoher Speicherverbrauch bei großen Dateien:** Aktivieren Sie den Streaming‑Modus, indem Sie `EditorSettings.EnableStreaming = true` setzen, bevor Sie das Dokument laden. +- **Lizenz nicht angewendet:** Vergewissern Sie sich, dass die temporäre Lizenzdatei im Anwendungsverzeichnis liegt oder über `License license = new License(); license.SetLicense("path/to/license.lic");` geladen wird. + ## Häufig gestellte Fragen -### Was ist GroupDocs.Editor für .NET? -GroupDocs.Editor für .NET ist eine leistungsstarke Bibliothek, die es Entwicklern ermöglicht, verschiedene Dokumentformate programmgesteuert in ihren .NET-Anwendungen zu bearbeiten. -### Wie beginne ich mit GroupDocs.Editor für .NET? -Sie müssen die Bibliothek herunterladen, eine temporäre Lizenz erwerben und Ihre Entwicklungsumgebung mit den erforderlichen Namespaces einrichten. -### Welche Dokumentformate werden unterstützt? -GroupDocs.Editor unterstützt unter anderem Textverarbeitungs-, Tabellenkalkulations-, Präsentations- und Textformate. -### Kann ich GroupDocs.Editor kostenlos nutzen? - Sie können ein[Kostenlose Testphase](https://releases.groupdocs.com/) mit eingeschränkten Funktionen oder erhalten Sie eine[vorläufige Lizenz](https://purchase.groupdocs.com/temporary-license/) für vollen Zugriff. -### Wo finde ich weitere Ressourcen und Unterstützung? - Besuche den[GroupDocs.Editor-Dokumentation](https://tutorials.groupdocs.com/editor/net/) für detaillierte Informationen oder besuchen Sie deren[Hilfeforum](https://forum.groupdocs.com/c/editor/20) für Hilfe. \ No newline at end of file + +**F: Was ist der Unterschied zwischen `DocumentFormatInfo` und `SaveOptions`?** +A: `DocumentFormatInfo` liefert Metadaten zu unterstützten Dateitypen, während `SaveOptions` konfiguriert, wie ein Dokument zurück auf die Festplatte geschrieben wird (Format, Kompression usw.). + +**F: Kann ich Formate für eine benutzerdefinierte Dateierweiterung auflisten?** +A: Ja – verwenden Sie `DocumentFormatInfo.FromExtension("yourExt")`; wird die Erweiterung nicht erkannt, liefert die Methode `null`. + +**F: Unterstützt GroupDocs.Editor passwortgeschützte Dateien?** +A: Absolut. Übergeben Sie das Passwort im `Editor`‑Konstruktor über `EditorSettings`, um verschlüsselte Dokumente zu öffnen. + +**F: Wie viele Formate unterstützt GroupDocs.Editor tatsächlich?** +A: Über **30 Eingabe‑ und Ausgabeformate**, darunter Word, Excel, PowerPoint, HTML und Nur‑Text. + +**F: Gibt es eine Möglichkeit, die Liste auf nur editierbare Formate zu beschränken?** +A: Verwenden Sie `GetEditableWordProcessingFormats()` (bzw. die entsprechenden Methoden für Tabellen/Präsentationen), um Formate abzurufen, die volle Bearbeitungsfunktionen erlauben. + +## Zusätzliche Ressourcen +- Laden Sie die Bibliothek von der [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) herunter. +- Holen Sie sich eine [temporary license](https://purchase.groupdocs.com/temporary-license/) für den vollen Funktionsumfang. +- Testen Sie das Produkt mit einer [free trial](https://releases.groupdocs.com/). +- Erkunden Sie detaillierte Anwendungsbeispiele in der [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- Holen Sie sich Hilfe von der Community im [support forum](https://forum.groupdocs.com/c/editor/20). + +## Fazit +Indem Sie diesem Leitfaden folgen, wissen Sie jetzt, wie Sie **unterstützte Dokumentformate auflisten**, **ein Dateiformat anhand seiner Erweiterung bestimmen** und **Dokumente** für Word, Tabellen und Präsentationen mit GroupDocs.Editor für .NET bearbeiten können. Integrieren Sie diese Snippets in Ihre eigenen Projekte, um robuste, format‑bewusste Anwendungen zu bauen, die End‑User begeistern und Laufzeitfehler reduzieren. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Verwandte Tutorials + +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Master Document Editing in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Convert Word to HTML Using GroupDocs.Editor .NET: A Step‑By‑Step Guide](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/greek/net/document-processing/work-document-formats/_index.md b/content/greek/net/document-processing/work-document-formats/_index.md index e505ed60..ab7fc0fb 100644 --- a/content/greek/net/document-processing/work-document-formats/_index.md +++ b/content/greek/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Εργασία με μορφές εγγράφων -linktitle: Εργασία με μορφές εγγράφων +date: 2026-06-06 +description: Μάθετε πώς να εμφανίζετε τις υποστηριζόμενες μορφές εγγράφων και να καθορίζετε + την επέκταση του αρχείου χρησιμοποιώντας το GroupDocs.Editor για .NET. Οδηγός βήμα‑βήμα + με αποσπάσματα κώδικα, σύντομες απαντήσεις και Συχνές Ερωτήσεις. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Λίστα υποστηριζόμενων μορφών εγγράφων +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Μάθετε πώς να χρησιμοποιείτε το GroupDocs.Editor για .NET για την επεξεργασία διαφόρων μορφών εγγράφων μέσω προγραμματισμού. Οδηγός βήμα προς βήμα με παραδείγματα για απρόσκοπτη ενσωμάτωση. -weight: 13 -url: /el/net/document-processing/work-document-formats/ +title: Λίστα υποστηριζόμενων μορφών εγγράφων με GroupDocs.Editor .NET type: docs +url: /el/net/document-processing/work-document-formats/ +weight: 13 --- -# Εργασία με μορφές εγγράφων -## Εισαγωγή -Καλώς ήρθατε στον αναλυτικό οδηγό μας σχετικά με τη χρήση του GroupDocs.Editor για .NET! Εάν είστε προγραμματιστής που θέλει να βελτιώσει τις εφαρμογές σας με δυνατότητες επεξεργασίας εγγράφων, έχετε έρθει στο σωστό μέρος. Αυτό το άρθρο θα σας καθοδηγήσει σε όλα όσα πρέπει να ξέρετε, από προϋποθέσεις έως πρακτικά παραδείγματα, για να ξεκινήσετε τη λειτουργία σας με αυτήν την ισχυρή βιβλιοθήκη. +# Λίστα Υποστηριζόμενων Μορφών Εγγράφων + +Καλώς ήρθατε στο ολοκληρωμένο μας **πώς να καταγράψετε τις υποστηριζόμενες μορφές εγγράφων** με το GroupDocs.Editor για .NET. Είτε δημιουργείτε μια web εφαρμογή που εστιάζει στα έγγραφα είτε ένα εργαλείο επιπέδου επιχείρησης για επιτραπέζιους υπολογιστές, η γνώση των ακριβών μορφών που μπορείτε να επεξεργαστείτε ή να μετατρέψετε είναι ουσιώδης. Σε αυτόν τον οδηγό θα ανακαλύψετε πώς να απαριθμήσετε τις μορφές, να αναλύσετε τις επεκτάσεις και να επεξεργαστείτε έγγραφα—όλα με σαφείς, φιλικές προς τον άνθρωπο εξηγήσεις και έτοιμα για εκτέλεση αποσπάσματα κώδικα. + +## Γρήγορες Απαντήσεις +- **Πώς μπορώ να καταγράψω όλες τις υποστηριζόμενες μορφές;** Χρησιμοποιήστε `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (ή τα ισοδύναμα για Παρουσιάσεις/Υπολογιστικά φύλλα) και επαναλάβετε τη συλλογή. +- **Μπορώ να προσδιορίσω μια μορφή από μια επέκταση αρχείου;** Ναι—καλέστε `DocumentFormatInfo.FromExtension(".docx")`. +- **Τι τύπους αρχείων υποστηρίζει το GroupDocs.Editor;** Πάνω από 30 μορφές εισόδου και εξόδου, συμπεριλαμβανομένων των DOCX, XLSX, PPTX, HTML και απλού κειμένου. +- **Χρειάζομαι άδεια για να καταγράψω τις μορφές;** Μια προσωρινή άδεια ξεκλειδώνει το πλήρες API· διαφορετικά, η δοκιμαστική έκδοση λειτουργεί με περιορισμένες δυνατότητες. +- **Ποιες εκδόσεις .NET είναι συμβατές;** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Τι είναι η “καταγραφή υποστηριζόμενων μορφών εγγράφων”; +Η φράση αναφέρεται στην προγραμματιστική ανάκτηση της συλλογής τύπων αρχείων που το GroupDocs.Editor μπορεί να ανοίξει, να επεξεργαστεί και να αποθηκεύσει. Αυτή η λειτουργία σας επιτρέπει να δημιουργήσετε δυναμικά αναπτυσσόμενα μενού UI ή να επικυρώσετε τις μεταφορτώσεις χρηστών πριν από την επεξεργασία, διασφαλίζοντας ότι μόνο συμβατά αρχεία περνούν στον επεξεργαστή για περαιτέρω επεξεργασία. + +## Γιατί να καταγράψετε τις υποστηριζόμενες μορφές εγγράφων; +Το GroupDocs.Editor **υποστηρίζει πάνω από 30 μορφές εισόδου και εξόδου** και μπορεί να χειριστεί αρχεία έως **2 GB** χωρίς να φορτώνει ολόκληρο το έγγραφο στη μνήμη. Η γνώση της ακριβούς λίστας αποτρέπει σφάλματα χρόνου εκτέλεσης, βελτιώνει την εμπειρία του χρήστη και σας επιτρέπει να επιβάλετε επιχειρηματικούς κανόνες όπως “να επιτρέπονται μόνο επεξεργάσιμα έγγραφα Office”. Επίσης, βοηθά να παρουσιάζετε στους χρήστες μόνο τις μορφές που η εφαρμογή σας υποστηρίζει πραγματικά. + ## Προαπαιτούμενα -Πριν βουτήξετε στα παραδείγματα και τις λειτουργίες του GroupDocs.Editor για .NET, υπάρχουν μερικές προϋποθέσεις που πρέπει να έχετε: -1. Βασική κατανόηση του .NET: Η εξοικείωση με το .NET Framework ή το .NET Core είναι απαραίτητη. -2. Περιβάλλον Ανάπτυξης: Visual Studio ή οποιοδήποτε άλλο κατάλληλο .NET IDE. -3. GroupDocs.Editor για .NET Library: Κάντε λήψη της βιβλιοθήκης από το[Σελίδα εκδόσεων GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Προσωρινή Άδεια: Λήψη α[προσωρινή άδεια](https://purchase.groupdocs.com/temporary-license/) για πλήρη χαρακτηριστικά. -## Εισαγωγή χώρων ονομάτων -Για να ξεκινήσετε με το GroupDocs.Editor για .NET, πρέπει να εισαγάγετε τους απαραίτητους χώρους ονομάτων στο έργο σας. Αυτό θα διασφαλίσει ότι έχετε πρόσβαση σε όλες τις κλάσεις και τις μεθόδους που παρέχονται από τη βιβλιοθήκη. +1. **Περιβάλλον ανάπτυξης .NET** – Visual Studio 2022 ή οποιοδήποτε IDE που υποστηρίζει .NET 6+. +2. **Βιβλιοθήκη GroupDocs.Editor για .NET** – κατεβάστε από τη [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **Προσωρινή άδεια** – αποκτήστε μια [temporary license](https://purchase.groupdocs.com/temporary-license/) για απεριόριστη πρόσβαση. +4. **Βασικές γνώσεις C#** – εξοικείωση με namespaces, δηλώσεις `using` και έξοδο κονσόλας. + +## Πώς να Καταγράψετε τις Υποστηριζόμενες Μορφές Εγγράφων; +Φορτώστε τη συλλογή των υποστηριζόμενων μορφών και εκτυπώστε το όνομα και την επέκταση κάθε μορφής. Αυτό το μοτίβο δύο βημάτων λειτουργεί για έγγραφα Word Processing, Spreadsheet και Presentation. Επαναλαμβάνοντας τη συλλογή μπορείτε να γεμίσετε δυναμικά στοιχεία UI όπως αναπτυσσόμενα μενού, διασφαλίζοντας ότι οι χρήστες μπορούν να επιλέξουν μόνο μορφές που ο επεξεργαστής μπορεί πραγματικά να διαχειριστεί. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Καταγραφή Μορφών Επεξεργασίας Κειμένου +`Formats.WordProcessingFormats` είναι μια απαρίθμηση που περιγράφει κάθε τύπο αρχείου Word‑processing που αναγνωρίζεται από τον επεξεργαστή. Η ιδιότητα `All` επιστρέφει μια συλλογή από αυτά τα αντικείμενα μορφής. -## Βήμα 1: Εργασία με μορφές εγγράφων -Το GroupDocs.Editor υποστηρίζει ένα ευρύ φάσμα μορφών εγγράφων. Ας εξερευνήσουμε πώς μπορείτε να απαριθμήσετε όλες τις υποστηριζόμενες μορφές επεξεργασίας κειμένου και παρουσίασης. -### Καταχώριση μορφών επεξεργασίας κειμένου +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Εξήγηση: -1. Loop Through Formats: Κάνουμε βρόχο σε όλες τις διαθέσιμες μορφές επεξεργασίας κειμένου. -2. Λεπτομέρειες μορφής εξόδου: Για κάθε μορφή, εκτυπώνουμε το όνομα και την επέκτασή της. -### Μορφές παρουσίασης καταχώρισης +``` + +**Εξήγηση:** +1. **Βρόχος Μέσω Μορφών:** Επαναλαμβάνουμε όλες τις διαθέσιμες μορφές Word‑processing. +2. **Έξοδος Λεπτομερειών Μορφής:** Για κάθε μορφή εκτυπώνουμε το φιλικό της όνομα και την προεπιλεγμένη επέκταση αρχείου. + +### Καταγραφή Μορφών Παρουσίασης +`Formats.PresentationFormats` λειτουργεί με τον ίδιο τρόπο για αρχεία διαφανειών, εκθέτοντας κάθε υποστηριζόμενο τύπο παρουσίασης μέσω της συλλογής `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Εξήγηση: -1. Loop Through Formats: Παρόμοια με τις μορφές επεξεργασίας κειμένου, πραγματοποιούμε βρόχο σε όλες τις μορφές παρουσίασης. -2. Λεπτομέρειες μορφής εξόδου: Εκτυπώστε το όνομα και την επέκταση κάθε μορφής. -## Βήμα 2: Ανάλυση μορφών από επεκτάσεις -Μερικές φορές, πρέπει να προσδιορίσετε τη μορφή με βάση μια επέκταση αρχείου. Το GroupDocs.Editor το καθιστά εύκολο. -### Ανάλυση μορφών υπολογιστικών φύλλων +``` + +**Εξήγηση:** +1. **Βρόχος Μέσω Μορφών:** Η ίδια λογική επαναλαμβάνεται για τις παρουσιάσεις. +2. **Έξοδος Λεπτομερειών Μορφής:** Το όνομα και η επέκταση εμφανίζονται για κάθε μορφή. + +## Πώς να Προσδιορίσετε την Επέκταση Μορφής Αρχείου; +Μερικές φορές έχετε μόνο ένα όνομα αρχείου και χρειάζεται να εξακριβώσετε την αντίστοιχη `DocumentFormat`. Το GroupDocs.Editor προσφέρει ένα απλό στατικό βοηθητικό εργαλείο που αντιστοιχίζει μια επέκταση αρχείου στην εσωτερική αναπαράσταση μορφής, επιτρέποντάς σας να επικυρώσετε ή να μετατρέψετε αρχεία πριν τα φορτώσετε στον επεξεργαστή. + +### Ανάλυση Μορφών Υπολογιστικών Φύλλων +`Formats.SpreadsheetFormats.FromExtension` μετατρέπει μια συμβολοσειρά επέκτασης αρχείου στην αντίστοιχη τιμή του enum μορφής υπολογιστικού φύλλου. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Εξήγηση: -1. Μορφή ανάλυσης: Χρησιμοποιούμε το`FromExtension` μέθοδος ανάλυσης της μορφής από το`.xlsm` επέκταση. -2. Μορφή εξόδου: Εκτυπώστε το όνομα της αναλυμένης μορφής. -### Ανάλυση κειμενικών μορφών +``` + +**Εξήγηση:** +1. **Ανάλυση Μορφής:** `FromExtension` μετατρέπει την επέκταση `.xlsm` στην εσωτερική τιμή `SpreadsheetFormat`. +2. **Έξοδος Μορφής:** Το όνομα της αναλυμένης μορφής εκτυπώνεται, επιβεβαιώνοντας τη χαρτογράφηση. + +### Ανάλυση Κειμενικών Μορφών +Ανάλογα, το `Formats.TextualFormats.FromExtension` επιλύει κειμενικές επεκτάσεις αρχείων όπως HTML ή TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Εξήγηση: -1. Μορφή ανάλυσης: Το`FromExtension` μέθοδος χρησιμοποιείται για την ανάλυση της μορφής από το`html` επέκταση. -2. Μορφή εξόδου: Εκτυπώστε το όνομα της αναλυμένης μορφής κειμένου. -## Βήμα 3: Επεξεργασία εγγράφων -Τώρα που είδαμε πώς να δουλεύουμε με μορφές, ας βουτήξουμε στην επεξεργασία εγγράφων χρησιμοποιώντας το GroupDocs.Editor. -### Φόρτωση εγγράφου -Για να επεξεργαστείτε ένα έγγραφο, πρέπει πρώτα να το φορτώσετε. +``` + +**Εξήγηση:** +1. **Ανάλυση Μορφής:** Η μέθοδος `FromExtension` επιλύει την επέκταση `html` σε `TextFormat`. +2. **Έξοδος Μορφής:** Το όνομα της κειμενικής μορφής εμφανίζεται, χρήσιμο για επεξεργαστές web. + +## Πώς να Επεξεργαστείτε Έγγραφα Μετά τον Προσδιορισμό των Μορφών; +Μόλις γνωρίζετε τη μορφή, η φόρτωση και η επεξεργασία ενός εγγράφου ακολουθεί ένα συνεπές μοτίβο. Πρώτα δημιουργείτε μια παρουσία `Editor` με τη διαδρομή του αρχείου προέλευσης, στη συνέχεια καλείτε το `Edit()` για να λάβετε ένα `EditableDocument`. Από εκεί μπορείτε να διαβάσετε, να τροποποιήσετε και τελικά να αποθηκεύσετε το περιεχόμενο χρησιμοποιώντας τις κατάλληλες `SaveOptions`. + +### Φόρτωση Εγγράφου +`Editor` είναι η κεντρική κλάση που περιλαμβάνει όλες τις λειτουργίες επεξεργασίας για ένα δεδομένο αρχείο. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Περαιτέρω βήματα θα καλυφθούν εδώ. + // Further steps will be covered here. } ``` -Εξήγηση: -1. Initialize Editor: Δημιουργήστε μια παρουσία του`Editor` τάξη, παρέχοντας τη διαδρομή προς το έγγραφό σας. -2. Μοτίβο απόρριψης: Χρησιμοποιήστε το`using` δήλωση για τη διασφάλιση της σωστής διάθεσης των πόρων. +``` + +**Εξήγηση:** +1. **Αρχικοποίηση Editor:** Δημιουργήστε μια παρουσία `Editor`, περνώντας τη πλήρη διαδρομή του αρχείου στόχου. +2. **Μοτίβο Dispose:** Η δήλωση `using` εγγυάται ότι όλοι οι μη διαχειριζόμενοι πόροι απελευθερώνονται άμεσα. + ### Εξαγωγή Περιεχομένου -Μόλις φορτωθεί το έγγραφο, μπορείτε να εξαγάγετε το περιεχόμενό του για επεξεργασία. +`EditableDocument.GetContent()` επιστρέφει το ακατέργαστο κείμενο του εγγράφου (ή HTML για επεξεργαστές web), το οποίο μπορείτε να εμφανίσετε ή να το χειριστείτε. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Εξήγηση: -1. Μέθοδος επεξεργασίας: Καλέστε το`Edit` μέθοδος για να αποκτήσετε ένα`EditableDocument`. -2. Λήψη περιεχομένου: Χρήση`GetContent` για να ανακτήσετε το περιεχόμενο του εγγράφου ως συμβολοσειρά. -3. Περιεχόμενο εξόδου: Εκτυπώστε το περιεχόμενο στην κονσόλα. -### Αποθήκευση αλλαγών -Μετά την επεξεργασία, αποθηκεύστε τις αλλαγές σας πίσω στο έγγραφο. +``` + +**Εξήγηση:** +1. **Μέθοδος Edit:** `Edit()` επιστρέφει ένα αντικείμενο `EditableDocument`. +2. **Λήψη Περιεχομένου:** `GetContent()` εξάγει το ακατέργαστο κείμενο (ή HTML για web‑based editors). +3. **Έξοδος Περιεχομένου:** Το περιεχόμενο γράφεται στην κονσόλα για επαλήθευση. + +### Αποθήκευση Αλλαγών +`SaveOptions` καθορίζει στον επεξεργαστή πώς και σε ποια μορφή θα γράψει το επεξεργασμένο έγγραφο πίσω στην αποθήκευση. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Τροποποιήστε το περιεχόμενο εδώ + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Εξήγηση: -1. Μέθοδος επεξεργασίας: Καλέστε το`Edit` μέθοδος για να αποκτήσετε ένα`EditableDocument`. -2. Τροποποίηση περιεχομένου: Τροποποιήστε το περιεχόμενο όπως απαιτείται (δεν εμφανίζεται σε αυτό το απόσπασμα). -3. Αποθήκευση επιλογών: Δημιουργία`SaveOptions` προσδιορίζοντας τη μορφή. -4. Αποθήκευση εγγράφου: Χρησιμοποιήστε το`Save` μέθοδος αποθήκευσης του επεξεργασμένου εγγράφου. -## Βήμα 4: Εργασία με διαφορετικούς τύπους εγγράφων -Το GroupDocs.Editor υποστηρίζει διάφορους τύπους εγγράφων. Δείτε πώς να εργαστείτε μαζί τους: -### Επεξεργασία εγγράφων υπολογιστικού φύλλου +``` + +**Εξήγηση:** +1. **Μέθοδος Edit:** Επαναλαμβάνουμε την απόκτηση του `EditableDocument` μετά τις τροποποιήσεις. +2. **Τροποποίηση Περιεχομένου:** Εφαρμόζετε τις αλλαγές σας στη συμβολοσειρά (δεν εμφανίζεται εδώ). +3. **Επιλογές Αποθήκευσης:** Διαμορφώνετε το `SaveOptions` με τη ζητούμενη μορφή εξόδου. +4. **Αποθήκευση Εγγράφου:** Το επεξεργασμένο αρχείο αποθηκεύεται ξανά στο δίσκο. + +## Πώς να Εργαστείτε με Διαφορετικούς Τύπους Εγγράφων; +Το GroupDocs.Editor αφαιρεί την πολυπλοκότητα της διαχείρισης Word, Spreadsheet και Presentation πίσω από την ίδια επιφάνεια API, καθιστώντας εύκολο το μεταβαίνοντας μεταξύ των τύπων χωρίς να χρειάζεται να μάθετε ένα νέο σύνολο κλάσεων για κάθε οικογένεια εγγράφων. + +### Επεξεργασία Εγγράφων Υπολογιστικών Φύλλων +`SpreadsheetSaveOptions` ορίζει πώς γράφεται ένα υπολογιστικό φύλλο, συμπεριλαμβανομένης της μορφής και των προαιρετικών ρυθμίσεων συμπίεσης. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Τροποποιήστε το περιεχόμενο εδώ + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Εξήγηση: -1. Initialize Editor: Δημιουργήστε ένα`Editor` παράδειγμα για υπολογιστικό φύλλο. -2. Μέθοδος επεξεργασίας: Κλήση`Edit` να πάρει ένα`EditableDocument`. -3. Λήψη περιεχομένου: Ανάκτηση και εκτύπωση του περιεχομένου. -4. Τροποποίηση περιεχομένου: Κάντε τις απαραίτητες αλλαγές. -5. Επιλογές αποθήκευσης: Καθορίστε τις επιλογές αποθήκευσης για υπολογιστικά φύλλα. -6. Αποθήκευση εγγράφου: Αποθηκεύστε το τροποποιημένο έγγραφο. +``` + +**Εξήγηση:** +1. **Αρχικοποίηση Editor:** Περνάτε τη διαδρομή ενός αρχείου υπολογιστικού φύλλου στον κατασκευαστή `Editor`. +2. **Μέθοδος Edit:** Λαμβάνετε ένα `EditableDocument`. +3. **Λήψη Περιεχομένου:** Εκτυπώνετε την αναπαράσταση CSV του φύλλου (ή HTML). +4. **Τροποποίηση Περιεχομένου:** Εφαρμόζετε τυχόν αλλαγές σε επίπεδο κελιών. +5. **Επιλογές Αποθήκευσης:** Επιλέγετε το κατάλληλο `SpreadsheetSaveOptions`. +6. **Αποθήκευση Εγγράφου:** Γράφετε το ενημερωμένο φύλλο πίσω στην αποθήκευση. + ### Επεξεργασία Εγγράφων Παρουσίασης +`PresentationSaveOptions` ελέγχει τη μορφή εξόδου για τις διαφάνειες, επιτρέποντάς σας να διατηρήσετε ή να αλλάξετε τον αρχικό τύπο αρχείου. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Τροποποιήστε το περιεχόμενο εδώ + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Εξήγηση: -1. Initialize Editor: Δημιουργήστε ένα`Editor` παράδειγμα για μια παρουσίαση. -2. Μέθοδος επεξεργασίας: Κλήση`Edit` να πάρει ένα`EditableDocument`. -3. Λήψη περιεχομένου: Ανάκτηση και εκτύπωση του περιεχομένου. -4. Τροποποίηση περιεχομένου: Κάντε τις απαραίτητες αλλαγές. -5. Επιλογές αποθήκευσης: Καθορίστε τις επιλογές αποθήκευσης για παρουσιάσεις. -6. Αποθήκευση εγγράφου: Αποθηκεύστε το τροποποιημένο έγγραφο. -## συμπέρασμα -Το GroupDocs.Editor για .NET παρέχει έναν ισχυρό και ευέλικτο τρόπο για να επεξεργαστείτε διάφορες μορφές εγγράφων μέσω προγραμματισμού. Ακολουθώντας αυτόν τον οδηγό, μπορείτε να ενσωματώσετε αποτελεσματικά τις λειτουργίες επεξεργασίας εγγράφων στις εφαρμογές σας .NET, βελτιώνοντας τις δυνατότητές τους και παρέχοντας μεγαλύτερη αξία στους χρήστες σας. -## Συχνές ερωτήσεις -### Τι είναι το GroupDocs.Editor για .NET; -Το GroupDocs.Editor για .NET είναι μια ισχυρή βιβλιοθήκη που επιτρέπει στους προγραμματιστές να επεξεργάζονται διάφορες μορφές εγγράφων μέσω προγραμματισμού στις εφαρμογές τους .NET. -### Πώς μπορώ να ξεκινήσω με το GroupDocs.Editor για .NET; -Πρέπει να κάνετε λήψη της βιβλιοθήκης, να αποκτήσετε μια προσωρινή άδεια και να ρυθμίσετε το περιβάλλον ανάπτυξης με τους απαραίτητους χώρους ονομάτων. -### Ποιες μορφές εγγράφων υποστηρίζονται; -Το GroupDocs.Editor υποστηρίζει μορφές επεξεργασίας κειμένου, υπολογιστικών φύλλων, παρουσίασης και κειμένου, μεταξύ άλλων. -### Μπορώ να χρησιμοποιήσω το GroupDocs.Editor δωρεάν; - Μπορείτε να χρησιμοποιήσετε α[δωρεάν δοκιμή](https://releases.groupdocs.com/) με περιορισμένα χαρακτηριστικά ή αποκτήστε α[προσωρινή άδεια](https://purchase.groupdocs.com/temporary-license/) για πλήρη πρόσβαση. -### Πού μπορώ να βρω περισσότερους πόρους και υποστήριξη; - Επισκέψου το[Τεκμηρίωση GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) για λεπτομερείς πληροφορίες ή ελέγξτε τους[φόρουμ υποστήριξης](https://forum.groupdocs.com/c/editor/20) για βοήθεια. \ No newline at end of file +``` + +**Εξήγηση:** +1. **Αρχικοποίηση Editor:** Φορτώνετε ένα αρχείο PowerPoint μέσω του `Editor`. +2. **Μέθοδος Edit:** Λαμβάνετε ένα `EditableDocument`. +3. **Λήψη Περιεχομένου:** Εξάγετε το HTML ή το απλό κείμενο των διαφανειών. +4. **Τροποποίηση Περιεχομένου:** Ενημερώνετε τίτλους, κουκίδες ή εικόνες. +5. **Επιλογές Αποθήκευσης:** Χρησιμοποιείτε το `PresentationSaveOptions` για να ορίσετε τη μορφή εξόδου. +6. **Αποθήκευση Εγγράφου:** Αποθηκεύετε την επεξεργασμένη παρουσίαση. + +## Κοινά Προβλήματα και Λύσεις +- **Σφάλμα “Format not supported”**: Επαληθεύστε ότι χρησιμοποιείτε την πιο πρόσφατη έκδοση του GroupDocs.Editor· προσθέτει υποστήριξη για νεότερες μορφές Office τακτικά. +- **Κατανάλωση μνήμης σε μεγάλα αρχεία**: Ενεργοποιήστε τη λειτουργία streaming ορίζοντας `EditorSettings.EnableStreaming = true` πριν τη φόρτωση του εγγράφου. +- **Άδεια δεν εφαρμόστηκε**: Βεβαιωθείτε ότι το αρχείο προσωρινής άδειας βρίσκεται στη ρίζα της εφαρμογής ή φορτώνεται μέσω `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Συχνές Ερωτήσεις + +**Ε: Ποια είναι η διαφορά μεταξύ `DocumentFormatInfo` και `SaveOptions`;** +Α: `DocumentFormatInfo` παρέχει μεταδεδομένα σχετικά με τις υποστηριζόμενες μορφές αρχείων, ενώ το `SaveOptions` διαμορφώνει τον τρόπο με τον οποίο ένα έγγραφο γράφεται ξανά στο δίσκο (μορφή, συμπίεση κ.λπ.). + +**Ε: Μπορώ να καταγράψω μορφές για μια προσαρμοσμένη επέκταση αρχείου;** +Α: Ναι—χρησιμοποιήστε `DocumentFormatInfo.FromExtension("yourExt")`; εάν η επέκταση δεν αναγνωρίζεται, η μέθοδος επιστρέφει `null`. + +**Ε: Το GroupDocs.Editor υποστηρίζει αρχεία με προστασία κωδικού;** +Α: Απόλυτα. Περνάτε τον κωδικό στο κατασκευαστή `Editor` μέσω του `EditorSettings` για να ανοίξετε κρυπτογραφημένα έγγραφα. + +**Ε: Πόσες μορφές υποστηρίζει πραγματικά το GroupDocs.Editor;** +Α: Πάνω από **30 μορφές εισόδου και εξόδου**, καλύπτοντας Word, Excel, PowerPoint, HTML και απλό κείμενο. + +**Ε: Υπάρχει τρόπος να περιορίσετε τη λίστα μόνο σε επεξεργάσιμες μορφές;** +Α: Χρησιμοποιήστε το `GetEditableWordProcessingFormats()` (ή τα ισοδύναμα για Spreadsheet/Presentation) για να λάβετε τις μορφές που επιτρέπουν πλήρη δυνατότητα επεξεργασίας. + +## Πρόσθετοι Πόροι +- Κατεβάστε τη βιβλιοθήκη από τη [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +- Αποκτήστε μια [temporary license](https://purchase.groupdocs.com/temporary-license/) για πλήρη πρόσβαση στις δυνατότητες. +- Δοκιμάστε το προϊόν με μια [free trial](https://releases.groupdocs.com/). +- Εξερευνήστε λεπτομερή παραδείγματα χρήσης στην [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- Λάβετε βοήθεια από την κοινότητα στο [support forum](https://forum.groupdocs.com/c/editor/20). + +## Συμπέρασμα +Ακολουθώντας αυτόν τον οδηγό, τώρα γνωρίζετε πώς να **καταγράψετε τις υποστηριζόμενες μορφές εγγράφων**, **προσδιορίσετε τη μορφή ενός αρχείου από την επέκτασή του**, και **επεξεργαστείτε έγγραφα** σε τύπους Word, Spreadsheet και Presentation χρησιμοποιώντας το GroupDocs.Editor για .NET. Ενσωματώστε αυτά τα αποσπάσματα στα δικά σας έργα για να δημιουργήσετε ισχυρές, μορφο‑συνειδητές εφαρμογές που ευχαριστούν τους τελικούς χρήστες και μειώνουν τα σφάλματα χρόνου εκτέλεσης. + +**Τελευταία Ενημέρωση:** 2026-06-06 +**Δοκιμάστηκε Με:** GroupDocs.Editor 23.9 for .NET +**Συγγραφέας:** GroupDocs + +## Σχετικά Μαθήματα + +- [Απόκτηση Εξοικείωσης με Φόρτωση Εγγράφων σε .NET με το GroupDocs.Editor: Ένας Ολοκληρωμένος Οδηγός](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Απόκτηση Εξοικείωσης με Επεξεργασία Εγγράφων σε .NET με το GroupDocs.Editor: Ένας Ολοκληρωμένος Οδηγός](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Μετατροπή Word σε HTML Χρησιμοποιώντας το GroupDocs.Editor .NET: Ένας Οδηγός Βήμα‑Βήμα](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/hindi/net/document-processing/work-document-formats/_index.md b/content/hindi/net/document-processing/work-document-formats/_index.md index 4f333aff..b1f425dd 100644 --- a/content/hindi/net/document-processing/work-document-formats/_index.md +++ b/content/hindi/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: दस्तावेज़ प्रारूपों के साथ कार्य करें -linktitle: दस्तावेज़ प्रारूपों के साथ कार्य करें -second_title: GroupDocs.Editor .NET एपीआई -description: .NET के लिए GroupDocs.Editor का उपयोग करके विभिन्न दस्तावेज़ स्वरूपों को प्रोग्रामेटिक रूप से संपादित करना सीखें। सहज एकीकरण के लिए उदाहरणों के साथ चरण-दर-चरण मार्गदर्शिका। -weight: 13 -url: /hi/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET का उपयोग करके समर्थित दस्तावेज़ फ़ॉर्मेट की + सूची बनाना और फ़ाइल फ़ॉर्मेट एक्सटेंशन निर्धारित करना सीखें। Step‑by‑step guide, + code snippets, quick answers, और FAQs के साथ। +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: समर्थित दस्तावेज़ फ़ॉर्मेट की सूची +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: GroupDocs.Editor .NET के साथ समर्थित दस्तावेज़ फ़ॉर्मेट की सूची बनाएं type: docs +url: /hi/net/document-processing/work-document-formats/ +weight: 13 --- -# दस्तावेज़ प्रारूपों के साथ कार्य करें - -## परिचय -.NET के लिए GroupDocs.Editor का उपयोग करने के बारे में हमारी गहन मार्गदर्शिका में आपका स्वागत है! यदि आप एक डेवलपर हैं और अपने एप्लिकेशन को दस्तावेज़ संपादन क्षमताओं के साथ बेहतर बनाना चाहते हैं, तो आप सही जगह पर आए हैं। यह लेख आपको इस शक्तिशाली लाइब्रेरी के साथ काम करने के लिए आवश्यक सभी चीज़ों से परिचित कराएगा, जिसमें पूर्वापेक्षाओं से लेकर व्यावहारिक उदाहरण तक शामिल हैं। -## आवश्यक शर्तें -.NET के लिए GroupDocs.Editor के उदाहरणों और कार्यात्मकताओं में गोता लगाने से पहले, आपके पास कुछ पूर्व-आवश्यकताएँ होनी चाहिए: -1. .NET की बुनियादी समझ: .NET फ्रेमवर्क या .NET कोर से परिचित होना आवश्यक है। -2. विकास वातावरण: विजुअल स्टूडियो या कोई अन्य उपयुक्त .NET IDE. -3. .NET लाइब्रेरी के लिए GroupDocs.Editor: लाइब्रेरी को यहाँ से डाउनलोड करें[ग्रुपडॉक्स ने पेज जारी किया](https://releases.groupdocs.com/editor/net/). -4. अस्थायी लाइसेंस: प्राप्त करें[अस्थायी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) पूर्ण सुविधाओं के लिए. -## नामस्थान आयात करें -.NET के लिए GroupDocs.Editor के साथ आरंभ करने के लिए, आपको अपने प्रोजेक्ट में आवश्यक नामस्थान आयात करने होंगे। इससे यह सुनिश्चित होगा कि आपके पास लाइब्रेरी द्वारा प्रदान की गई सभी कक्षाओं और विधियों तक पहुँच है। + +# समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची + +GroupDocs.Editor for .NET के साथ **समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची कैसे बनाएं** पर हमारे व्यापक ट्यूटोरियल में आपका स्वागत है। चाहे आप एक दस्तावेज़‑केंद्रित वेब ऐप बना रहे हों या एंटरप्राइज़‑ग्रेड डेस्कटॉप टूल, यह जानना कि आप कौन‑से फ़ॉर्मेट्स को संपादित या परिवर्तित कर सकते हैं, अत्यंत आवश्यक है। इस गाइड में आप फ़ॉर्मेट्स की सूची बनाना, एक्सटेंशन पार्स करना, और दस्तावेज़ संपादित करना सीखेंगे—सभी स्पष्ट, उपयोगकर्ता‑मित्र व्याख्याओं और तुरंत चलाने योग्य कोड स्निपेट्स के साथ। + +## त्वरित उत्तर +- **मैं सभी समर्थित फ़ॉर्मेट्स की सूची कैसे बनाऊँ?** `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (या Presentation/Spreadsheet समकक्ष) का उपयोग करें और संग्रह पर इटररेट करें। +- **क्या मैं फ़ाइल एक्सटेंशन से फ़ॉर्मेट निर्धारित कर सकता हूँ?** हाँ—`DocumentFormatInfo.FromExtension(".docx")` को कॉल करें। +- **GroupDocs.Editor किन फ़ाइल प्रकारों का समर्थन करता है?** 30 से अधिक इनपुट और आउटपुट फ़ॉर्मेट्स, जिसमें DOCX, XLSX, PPTX, HTML, और प्लेन टेक्स्ट शामिल हैं। +- **फ़ॉर्मेट्स की सूची बनाने के लिए क्या मुझे लाइसेंस चाहिए?** एक टेम्पररी लाइसेंस पूर्ण API अनलॉक करता है; अन्यथा ट्रायल सीमित सुविधाओं के साथ काम करता है। +- **कौन‑से .NET संस्करण संगत हैं?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## “समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची” क्या है? +यह वाक्यांश प्रोग्रामेटिक रूप से उन फ़ाइल प्रकारों के संग्रह को प्राप्त करने को दर्शाता है जिन्हें GroupDocs.Editor खोल, संपादित और सहेज सकता है। यह ऑपरेशन आपको डायनामिक UI ड्रॉपडाउन बनाने या प्रोसेसिंग से पहले उपयोगकर्ता अपलोड्स को वैलिडेट करने की अनुमति देता है, जिससे केवल संगत फ़ाइलें ही आगे के संचालन के लिए एडिटर को पास की जाती हैं। + +## समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची क्यों बनानी चाहिए? +GroupDocs.Editor **30+ इनपुट और आउटपुट फ़ॉर्मेट्स का समर्थन करता है** और पूरी दस्तावेज़ को मेमोरी में लोड किए बिना **2 GB** तक की फ़ाइलें संभाल सकता है। सटीक सूची को जानने से रन‑टाइम त्रुटियों से बचा जा सकता है, उपयोगकर्ता अनुभव सुधरता है, और आप “केवल संपादन योग्य Office दस्तावेज़ों की अनुमति दें” जैसे व्यावसायिक नियम लागू कर सकते हैं। यह आपको उपयोगकर्ताओं को केवल वही फ़ॉर्मेट्स दिखाने में मदद करता है जो आपका एप्लिकेशन वास्तव में समर्थन करता है। + +## पूर्वापेक्षाएँ +1. **.NET विकास पर्यावरण** – Visual Studio 2022 या कोई भी IDE जो .NET 6+ को सपोर्ट करता हो। +2. **GroupDocs.Editor for .NET लाइब्रेरी** – [GroupDocs रिलीज़ पेज](https://releases.groupdocs.com/editor/net/) से डाउनलोड करें। +3. **टेम्पररी लाइसेंस** – अनरिस्ट्रिक्टेड एक्सेस के लिए एक [टेम्पररी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) प्राप्त करें। +4. **बेसिक C# ज्ञान** – नेमस्पेसेस, `using` स्टेटमेंट्स, और कंसोल आउटपुट की परिचितता। + +## समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची कैसे बनाएं? +समर्थित फ़ॉर्मेट्स संग्रह को लोड करें और प्रत्येक फ़ॉर्मेट का नाम और फ़ाइल एक्सटेंशन प्रिंट करें। यह दो‑स्टेप पैटर्न Word Processing, Spreadsheet, और Presentation दस्तावेज़ों के लिए काम करता है। संग्रह को इटररेट करके आप UI तत्वों जैसे ड्रॉपडाउन को डायनामिक रूप से भर सकते हैं, जिससे उपयोगकर्ता केवल वही फ़ॉर्मेट्स चुन सकें जिन्हें एडिटर वास्तव में संभाल सकता है। + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Word Processing फ़ॉर्मेट्स की सूची बनाना +`Formats.WordProcessingFormats` एक एन्यूमरेशन है जो एडिटर द्वारा पहचाने गए प्रत्येक Word‑processing फ़ाइल प्रकार का वर्णन करता है। `All` प्रॉपर्टी इन फ़ॉर्मेट ऑब्जेक्ट्स का संग्रह लौटाती है। -## चरण 1: दस्तावेज़ प्रारूपों के साथ कार्य करना -GroupDocs.Editor कई तरह के दस्तावेज़ प्रारूपों का समर्थन करता है। आइए देखें कि आप सभी समर्थित वर्ड प्रोसेसिंग और प्रेजेंटेशन प्रारूपों को कैसे सूचीबद्ध कर सकते हैं। -### वर्ड प्रोसेसिंग प्रारूपों की सूची बनाना +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -स्पष्टीकरण: -1. प्रारूपों के माध्यम से लूप करें: हम सभी उपलब्ध वर्ड प्रोसेसिंग प्रारूपों के माध्यम से लूप करते हैं। -2. आउटपुट प्रारूप विवरण: प्रत्येक प्रारूप के लिए, हम उसका नाम और एक्सटेंशन प्रिंट करते हैं। -### लिस्टिंग प्रस्तुति प्रारूप +``` + +**Explanation:** +1. **Loop Through Formats:** We iterate over all available Word‑processing formats. +2. **Output Format Details:** For each format we print its friendly name and default file extension. + +### Presentation फ़ॉर्मेट्स की सूची बनाना +`Formats.PresentationFormats` स्लाइड‑डेक फ़ाइलों के लिए भी समान रूप से काम करता है, `All` संग्रह के माध्यम से प्रत्येक समर्थित प्रेजेंटेशन टाइप को उजागर करता है। + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -स्पष्टीकरण: -1. लूप थ्रू फॉर्मेट: वर्ड प्रोसेसिंग फॉर्मेट के समान, हम सभी प्रेजेंटेशन फॉर्मेट के माध्यम से लूप करते हैं। -2. आउटपुट प्रारूप विवरण: प्रत्येक प्रारूप का नाम और एक्सटेंशन प्रिंट करें। -## चरण 2: एक्सटेंशन से प्रारूपों को पार्स करना -कभी-कभी, आपको फ़ाइल एक्सटेंशन के आधार पर प्रारूप निर्धारित करने की आवश्यकता होती है। GroupDocs.Editor इसे आसान बनाता है। -### स्प्रेडशीट प्रारूपों का पार्सिंग +``` + +**Explanation:** +1. **Loop Through Formats:** The same looping logic applies to presentations. +2. **Output Format Details:** The name and extension are displayed for each format. + +## फ़ाइल फ़ॉर्मेट एक्सटेंशन कैसे निर्धारित करें? +कभी‑कभी आपके पास केवल फ़ाइल नाम होता है और आपको संबंधित `DocumentFormat` का अनुमान लगाना पड़ता है। GroupDocs.Editor एक सरल स्टैटिक हेल्पर प्रदान करता है जो फ़ाइल एक्सटेंशन को उसके आंतरिक फ़ॉर्मेट प्रतिनिधित्व से मैप करता है, जिससे आप फ़ाइलों को एडिटर में लोड करने से पहले वैलिडेट या कनवर्ट कर सकते हैं। + +### Spreadsheet फ़ॉर्मेट्स का पार्सिंग +`Formats.SpreadsheetFormats.FromExtension` फ़ाइल एक्सटेंशन स्ट्रिंग को मिलते‑जुलते स्प्रेडशीट फ़ॉर्मेट एन्‍यूम वैल्यू में बदलता है। + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -स्पष्टीकरण: -1. पार्स प्रारूप: हम उपयोग करते हैं`FromExtension` प्रारूप को पार्स करने की विधि`.xlsm` विस्तार। -2. आउटपुट प्रारूप: पार्स किए गए प्रारूप का नाम प्रिंट करें. -### पाठ्य प्रारूपों का पार्सिंग +``` + +**Explanation:** +1. **Parse Format:** `FromExtension` converts the `.xlsm` extension into its internal `SpreadsheetFormat` enum. +2. **Output Format:** The parsed format’s name is printed, confirming the mapping. + +### Textual फ़ॉर्मेट्स का पार्सिंग +इसी प्रकार, `Formats.TextualFormats.FromExtension` HTML या TXT जैसे टेक्स्टुअल फ़ाइल एक्सटेंशन को हल करता है। + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -स्पष्टीकरण: -1. पार्स प्रारूप:`FromExtension` विधि का उपयोग प्रारूप को पार्स करने के लिए किया जाता है`html` विस्तार। -2. आउटपुट प्रारूप: पार्स किए गए पाठ्य प्रारूप का नाम प्रिंट करें। -## चरण 3: दस्तावेज़ों का संपादन -अब जब हमने देखा है कि प्रारूपों के साथ कैसे काम करना है, तो आइए GroupDocs.Editor का उपयोग करके दस्तावेज़ों को संपादित करना शुरू करें। +``` + +**Explanation:** +1. **Parse Format:** The `FromExtension` method resolves the `html` extension to a `TextFormat`. +2. **Output Format:** The name of the textual format is displayed, useful for web‑based editors. + +## फ़ॉर्मेट्स की पहचान करने के बाद दस्तावेज़ कैसे संपादित करें? +एक बार फ़ॉर्मेट पता चल जाने पर, दस्तावेज़ को लोड और संपादित करना एक सुसंगत पैटर्न का पालन करता है। पहले आप स्रोत फ़ाइल के पाथ के साथ एक `Editor` इंस्टेंस बनाते हैं, फिर `Edit()` को कॉल करके एक `EditableDocument` प्राप्त करते हैं। उसके बाद आप सामग्री को पढ़ सकते हैं, संशोधित कर सकते हैं, और अंत में उपयुक्त `SaveOptions` का उपयोग करके सहेज सकते हैं। + ### दस्तावेज़ लोड करना -किसी दस्तावेज़ को संपादित करने के लिए, आपको पहले उसे लोड करना होगा। +`Editor` वह कोर क्लास है जो किसी फ़ाइल के सभी संपादन ऑपरेशन्स को समेटे रहता है। + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // आगे के चरणों को यहां कवर किया जाएगा। + // Further steps will be covered here. } ``` -स्पष्टीकरण: -1. संपादक आरंभ करें: का एक उदाहरण बनाएँ`Editor` क्लास, आपके दस्तावेज़ का पथ प्रदान करता है. -2. डिस्पोज़ पैटर्न: का उपयोग करें`using` यह सुनिश्चित करने के लिए कि संसाधनों का उचित तरीके से निपटान किया जाए, वक्तव्य जारी किया गया। +``` + +**Explanation:** +1. **Initialize Editor:** Create an `Editor` instance, passing the full path of the target file. +2. **Dispose Pattern:** The `using` statement guarantees that all unmanaged resources are released promptly. + ### सामग्री निकालना -एक बार दस्तावेज़ लोड हो जाने पर, आप संपादन के लिए इसकी सामग्री निकाल सकते हैं। +`EditableDocument.GetContent()` दस्तावेज़ का कच्चा टेक्स्ट (या वेब‑आधारित एडिटर्स के लिए HTML) लौटाता है, जिसे आप प्रदर्शित या संशोधित कर सकते हैं। + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -स्पष्टीकरण: -1. संपादन विधि: कॉल करें`Edit` पाने की विधि`EditableDocument`. -2. सामग्री प्राप्त करें: उपयोग करें`GetContent` दस्तावेज़ की सामग्री को स्ट्रिंग के रूप में पुनः प्राप्त करने के लिए. -3. आउटपुट सामग्री: सामग्री को कंसोल पर प्रिंट करें। -### बचत परिवर्तन -संपादन के बाद, अपने परिवर्तनों को दस्तावेज़ में वापस सहेजें. +``` + +**Explanation:** +1. **Edit Method:** `Edit()` returns an `EditableDocument` object. +2. **Get Content:** `GetContent()` extracts the document’s raw text (or HTML for web‑based editors). +3. **Output Content:** The content is written to the console for verification. + +### परिवर्तनों को सहेजना +`SaveOptions` एडिटर को बताता है कि संपादित दस्तावेज़ को किस प्रकार और किस फ़ॉर्मेट में स्टोरेज में वापस लिखना है। + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // सामग्री यहाँ संशोधित करें + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -स्पष्टीकरण: -1. संपादन विधि: कॉल करें`Edit` पाने की विधि`EditableDocument`. -2. सामग्री संशोधित करें: आवश्यकतानुसार सामग्री संशोधित करें (इस स्निपेट में नहीं दिखाया गया है). -3. सहेजें विकल्प: बनाएँ`SaveOptions` प्रारूप निर्दिष्ट करना. -4. दस्तावेज़ सहेजें: का उपयोग करें`Save` संपादित दस्तावेज़ को सहेजने की विधि. -## चरण 4: विभिन्न दस्तावेज़ प्रकारों के साथ कार्य करना -GroupDocs.Editor विभिन्न दस्तावेज़ प्रकारों का समर्थन करता है। उनके साथ काम करने का तरीका यहां बताया गया है: -### स्प्रेडशीट दस्तावेज़ों का संपादन +``` + +**Explanation:** +1. **Edit Method:** Re‑obtain the `EditableDocument` after modifications. +2. **Modify Content:** Apply your changes to the string (not shown here). +3. **Save Options:** Configure `SaveOptions` with the desired output format. +4. **Save Document:** Persist the edited file back to disk. + +## विभिन्न दस्तावेज़ प्रकारों के साथ कैसे काम करें? +GroupDocs.Editor Word, Spreadsheet, और Presentation हैंडलिंग को एक ही API सतह के पीछे एब्स्ट्रैक्ट करता है, जिससे प्रत्येक दस्तावेज़ परिवार के लिए नई क्लासेस सीखने की आवश्यकता के बिना संदर्भ बदलना आसान हो जाता है। + +### Spreadsheet दस्तावेज़ों को संपादित करना +`SpreadsheetSaveOptions` यह निर्धारित करता है कि स्प्रेडशीट कैसे लिखी जाती है, जिसमें फ़ॉर्मेट और वैकल्पिक कंप्रेशन सेटिंग्स शामिल हैं। + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // सामग्री यहाँ संशोधित करें + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -स्पष्टीकरण: -1. संपादक आरंभ करें: एक बनाएँ`Editor` एक स्प्रेडशीट के लिए उदाहरण. -2. संपादन विधि: कॉल`Edit` पाने के लिए`EditableDocument`. -3. सामग्री प्राप्त करें: सामग्री को पुनः प्राप्त करें और प्रिंट करें। -4. सामग्री संशोधित करें: आवश्यक परिवर्तन करें. -5. सहेजें विकल्प: स्प्रेडशीट के लिए सहेजें विकल्प निर्दिष्ट करें. -6. दस्तावेज़ सहेजें: संशोधित दस्तावेज़ सहेजें. -### प्रस्तुति दस्तावेज़ों का संपादन +``` + +**Explanation:** +1. **Initialize Editor:** Pass a spreadsheet file path to the `Editor` constructor. +2. **Edit Method:** Retrieve an `EditableDocument`. +3. **Get Content:** Print the spreadsheet’s CSV representation (or HTML). +4. **Modify Content:** Apply any cell‑level changes you need. +5. **Save Options:** Choose the appropriate `SpreadsheetSaveOptions`. +6. **Save Document:** Write the updated spreadsheet back to storage. + +### Presentation दस्तावेज़ों को संपादित करना +`PresentationSaveOptions` स्लाइड डेक के आउटपुट फ़ॉर्मेट को नियंत्रित करता है, जिससे आप मूल फ़ाइल प्रकार को बनाए रख सकते हैं या बदल सकते हैं। + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // सामग्री यहाँ संशोधित करें + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -स्पष्टीकरण: -1. संपादक आरंभ करें: एक बनाएँ`Editor` एक प्रस्तुति के लिए उदाहरण. -2. संपादन विधि: कॉल`Edit` पाने के लिए`EditableDocument`. -3. सामग्री प्राप्त करें: सामग्री को पुनः प्राप्त करें और प्रिंट करें। -4. सामग्री संशोधित करें: आवश्यक परिवर्तन करें. -5. सहेजें विकल्प: प्रस्तुतियों के लिए सहेजें विकल्प निर्दिष्ट करें। -6. दस्तावेज़ सहेजें: संशोधित दस्तावेज़ सहेजें. -## निष्कर्ष -GroupDocs.Editor for .NET विभिन्न दस्तावेज़ स्वरूपों को प्रोग्रामेटिक रूप से संपादित करने का एक मज़बूत और लचीला तरीका प्रदान करता है। इस गाइड का पालन करके, आप अपने .NET अनुप्रयोगों में दस्तावेज़ संपादन कार्यक्षमताओं को कुशलतापूर्वक एकीकृत कर सकते हैं, उनकी क्षमताओं को बढ़ा सकते हैं और अपने उपयोगकर्ताओं को अधिक मूल्य प्रदान कर सकते हैं। +``` + +**Explanation:** +1. **Initialize Editor:** Load a PowerPoint file via `Editor`. +2. **Edit Method:** Obtain an `EditableDocument`. +3. **Get Content:** Extract slide HTML or plain text. +4. **Modify Content:** Update titles, bullet points, or images. +5. **Save Options:** Use `PresentationSaveOptions` to define the output format. +6. **Save Document:** Persist the edited presentation. + +## सामान्य समस्याएँ और समाधान +- **“Format not supported” त्रुटि:** सुनिश्चित करें कि आप नवीनतम GroupDocs.Editor संस्करण का उपयोग कर रहे हैं; यह नियमित रूप से नए Office फ़ॉर्मेट्स के समर्थन को जोड़ता है। +- **बड़ी फ़ाइल मेमोरी खपत:** दस्तावेज़ लोड करने से पहले `EditorSettings.EnableStreaming = true` सेट करके स्ट्रीमिंग मोड सक्षम करें। +- **लाइसेंस लागू नहीं हुआ:** सुनिश्चित करें कि टेम्पररी लाइसेंस फ़ाइल एप्लिकेशन रूट में रखी गई है या `License license = new License(); license.SetLicense("path/to/license.lic");` के माध्यम से लोड की गई है। + ## अक्सर पूछे जाने वाले प्रश्न -### .NET के लिए GroupDocs.Editor क्या है? -GroupDocs.Editor for .NET एक शक्तिशाली लाइब्रेरी है जो डेवलपर्स को अपने .NET अनुप्रयोगों के भीतर प्रोग्रामेटिक रूप से विभिन्न दस्तावेज़ प्रारूपों को संपादित करने की अनुमति देती है। -### मैं .NET के लिए GroupDocs.Editor के साथ कैसे आरंभ करूं? -आपको लाइब्रेरी डाउनलोड करनी होगी, अस्थायी लाइसेंस प्राप्त करना होगा, तथा आवश्यक नेमस्पेस के साथ अपना विकास वातावरण स्थापित करना होगा। -### कौन से दस्तावेज़ प्रारूप समर्थित हैं? -GroupDocs.Editor वर्ड प्रोसेसिंग, स्प्रेडशीट, प्रेजेंटेशन और टेक्स्टुअल प्रारूपों का समर्थन करता है। -### क्या मैं GroupDocs.Editor का निःशुल्क उपयोग कर सकता हूँ? - आप एक का उपयोग कर सकते हैं[मुफ्त परीक्षण](https://releases.groupdocs.com/) सीमित सुविधाओं के साथ या प्राप्त करें[अस्थायी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) पूर्ण पहुँच के लिए. -### मुझे और अधिक संसाधन और सहायता कहां मिल सकती है? - दौरा करना[GroupDocs.Editor दस्तावेज़ीकरण](https://tutorials.groupdocs.com/editor/net/) विस्तृत जानकारी के लिए, या उनकी जाँच करें[सहयता मंच](https://forum.groupdocs.com/c/editor/20) मदद के लिए। \ No newline at end of file + +**Q: `DocumentFormatInfo` और `SaveOptions` में क्या अंतर है?** +A: `DocumentFormatInfo` समर्थित फ़ाइल प्रकारों के बारे में मेटाडेटा प्रदान करता है, जबकि `SaveOptions` यह कॉन्फ़िगर करता है कि दस्तावेज़ डिस्क पर कैसे लिखा जाए (फ़ॉर्मेट, कंप्रेशन, आदि)। + +**Q: क्या मैं कस्टम फ़ाइल एक्सटेंशन के लिए फ़ॉर्मेट्स की सूची बना सकता हूँ?** +A: हाँ—`DocumentFormatInfo.FromExtension("yourExt")` का उपयोग करें; यदि एक्सटेंशन पहचाना नहीं जाता, तो मेथड `null` लौटाता है। + +**Q: क्या GroupDocs.Editor पासवर्ड‑सुरक्षित फ़ाइलों का समर्थन करता है?** +A: बिल्कुल। एन्क्रिप्टेड दस्तावेज़ खोलने के लिए पासवर्ड को `EditorSettings` के माध्यम से `Editor` कंस्ट्रक्टर में पास करें। + +**Q: GroupDocs.Editor वास्तव में कितने फ़ॉर्मेट्स का समर्थन करता है?** +A: **30 से अधिक इनपुट और आउटपुट फ़ॉर्मेट्स**, जो Word, Excel, PowerPoint, HTML, और प्लेन टेक्स्ट को कवर करते हैं। + +**Q: क्या सूची को केवल संपादन योग्य फ़ॉर्मेट्स तक सीमित करने का कोई तरीका है?** +A: `GetEditableWordProcessingFormats()` (या Spreadsheet/Presentation समकक्ष) का उपयोग करके उन फ़ॉर्मेट्स को प्राप्त करें जो पूर्ण संपादन क्षमताएँ प्रदान करते हैं। + +## अतिरिक्त संसाधन +- लाइब्रेरी डाउनलोड करें [GroupDocs रिलीज़ पेज](https://releases.groupdocs.com/editor/net/) से। +- पूर्ण फीचर एक्सेस के लिए एक [टेम्पररी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) प्राप्त करें। +- उत्पाद को एक [फ्री ट्रायल](https://releases.groupdocs.com/) के साथ आज़माएँ। +- विस्तृत उपयोग उदाहरण देखें [GroupDocs.Editor दस्तावेज़ीकरण](https://tutorials.groupdocs.com/editor/net/) में। +- समुदाय से मदद प्राप्त करें [सपोर्ट फ़ोरम](https://forum.groupdocs.com/c/editor/20) पर। + +## निष्कर्ष +इस गाइड का पालन करके अब आप जानते हैं कि **समर्थित दस्तावेज़ फ़ॉर्मेट्स की सूची कैसे बनाएं**, **फ़ाइल एक्सटेंशन से फ़ॉर्मेट कैसे निर्धारित करें**, और **दस्तावेज़ कैसे संपादित करें** Word, Spreadsheet, और Presentation प्रकारों में GroupDocs.Editor for .NET का उपयोग करके। इन स्निपेट्स को अपने प्रोजेक्ट्स में शामिल करें ताकि आप मजबूत, फ़ॉर्मेट‑सचेत एप्लिकेशन बना सकें जो अंतिम उपयोगकर्ताओं को खुश करें और रन‑टाइम त्रुटियों को कम करें। + +**अंतिम अपडेट:** 2026-06-06 +**परीक्षित संस्करण:** GroupDocs.Editor 23.9 for .NET +**लेखक:** GroupDocs + +## संबंधित ट्यूटोरियल्स + +- [GroupDocs.Editor के साथ .NET में दस्तावेज़ लोडिंग में महारत: एक व्यापक गाइड](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [GroupDocs.Editor के साथ .NET में दस्तावेज़ संपादन में महारत: एक व्यापक गाइड](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [GroupDocs.Editor .NET का उपयोग करके Word को HTML में बदलना: चरण‑दर‑चरण गाइड](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/hongkong/net/document-processing/work-document-formats/_index.md b/content/hongkong/net/document-processing/work-document-formats/_index.md index fe4066f2..2033c278 100644 --- a/content/hongkong/net/document-processing/work-document-formats/_index.md +++ b/content/hongkong/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,210 @@ --- -title: 使用文件格式 -linktitle: 使用文件格式 +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET 列出支援的文件格式並判斷檔案格式副檔名。提供逐步指南、程式碼範例、快速解答與常見問題。 +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: 列出支援的文件格式 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 了解如何使用 GroupDocs.Editor for .NET 以程式設計方式編輯各種文件格式。具有無縫整合範例的分步指南。 -weight: 13 -url: /zh-hant/net/document-processing/work-document-formats/ +title: 使用 GroupDocs.Editor .NET 列出支援的文件格式 type: docs +url: /zh-hant/net/document-processing/work-document-formats/ +weight: 13 --- -# 使用文件格式 - -## 介紹 -歡迎閱讀我們關於使用 GroupDocs.Editor for .NET 的深入指南!如果您是開發人員,希望透過文件編輯功能來增強應用程序,那麼您來對地方了。本文將引導您了解從先決條件到實際範例所需了解的所有內容,以便您啟動並執行這個強大的程式庫。 -## 先決條件 -在深入了解適用於 .NET 的 GroupDocs.Editor 的範例和功能之前,您需要滿足一些先決條件: -1. 對 .NET 的基本了解:熟悉 .NET Framework 或 .NET Core 至關重要。 -2. 開發環境:Visual Studio 或任何其他合適的.NET IDE。 -3. GroupDocs.Editor for .NET Library:從以下位置下載該程式庫:[GroupDocs 發布頁面](https://releases.groupdocs.com/editor/net/). -4. 臨時許可證:取得[臨時執照](https://purchase.groupdocs.com/temporary-license/)以獲得完整的功能。 -## 導入命名空間 -若要開始使用適用於 .NET 的 GroupDocs.Editor,您需要將必要的命名空間匯入到您的專案中。這將確保您可以存取該庫提供的所有類別和方法。 + +# 列出支援的文件格式 + +歡迎閱讀我們關於 **如何列出支援的文件格式** 的完整教學,使用 GroupDocs.Editor for .NET。無論您是構建以文件為中心的網頁應用程式,還是企業級桌面工具,精確了解可以編輯或轉換的格式都是必須的。在本指南中,您將學會如何列舉格式、解析副檔名,並編輯文件——全部以清晰、易於理解的說明和可直接執行的程式碼片段呈現。 + +## 快速回答 +- **如何列出所有支援的格式?** 使用 `DocumentFormatInfo.GetSupportedWordProcessingFormats()`(或 Presentation/Spreadsheet 等效方法)並遍歷集合。 +- **我可以從檔案副檔名判斷格式嗎?** 可以——呼叫 `DocumentFormatInfo.FromExtension(".docx")`。 +- **GroupDocs.Editor 支援哪些檔案類型?** 超過 30 種輸入與輸出格式,包括 DOCX、XLSX、PPTX、HTML 以及純文字。 +- **列出格式需要授權嗎?** 臨時授權可解鎖完整 API;否則試用版僅提供有限功能。 +- **相容的 .NET 版本有哪些?** .NET Framework 4.6+、.NET Core 3.1+、.NET 5/6/7。 + +## 什麼是「列出支援的文件格式」? +此詞語指以程式方式取得 GroupDocs.Editor 能開啟、編輯與儲存的檔案類型集合。此操作可讓您建立動態 UI 下拉選單或在處理前驗證使用者上傳的檔案,確保僅將相容的檔案傳遞給編輯器進行後續操作。 + +## 為什麼要列出支援的文件格式? +GroupDocs.Editor **支援超過 30 種輸入與輸出格式**,且可處理高達 **2 GB** 的檔案,而無需將整個文件載入記憶體。了解確切的格式清單可防止執行時錯誤、提升使用者體驗,並讓您能實施如「僅允許可編輯的 Office 文件」等業務規則。它同時協助您只向使用者顯示應用程式實際支援的格式。 + +## 前置條件 +1. **.NET 開發環境** – Visual Studio 2022 或任何支援 .NET 6+ 的 IDE。 +2. **GroupDocs.Editor for .NET 程式庫** – 從 [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) 下載。 +3. **臨時授權** – 取得 [temporary license](https://purchase.groupdocs.com/temporary-license/) 以獲得完整存取權限。 +4. **基本 C# 知識** – 熟悉命名空間、`using` 陳述式與主控台輸出。 + +## 如何列出支援的文件格式? +載入支援的格式集合,並印出每個格式的名稱與副檔名。此兩步驟模式適用於文字處理、試算表與簡報文件。透過遍歷集合,您可以動態填充 UI 元件(如下拉選單),確保使用者只能選取編輯器實際能處理的格式。 + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## 第 1 步:使用文件格式 -GroupDocs.Editor 支援多種文件格式。讓我們探討如何列出所有支援的文字處理和簡報格式。 ### 列出文字處理格式 +`Formats.WordProcessingFormats` 是一個列舉,描述編輯器所識別的每種文字處理檔案類型。`All` 屬性會回傳這些格式物件的集合。 + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -解釋: -1. 循環遍歷格式:我們循環遍歷所有可用的文字處理格式。 -2. 輸出格式詳細資訊:對於每種格式,我們列印其名稱和副檔名。 -### 列表呈現格式 +``` + +**說明:** +1. **遍歷格式:** 我們遍歷所有可用的文字處理格式。 +2. **輸出格式細節:** 對每個格式,我們印出其友好名稱與預設副檔名。 + +### 列出簡報格式 +`Formats.PresentationFormats` 以相同方式處理投影片檔案,透過 `All` 集合揭示每種支援的簡報類型。 + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -解釋: -1. 循環遍歷格式:與文字處理格式類似,我們循環遍歷所有簡報格式。 -2. 輸出格式詳細資訊:列印每種格式的名稱和副檔名。 -## 步驟 2:解析副檔名的格式 -有時,您需要根據檔案副檔名確定格式。 GroupDocs.Editor 讓這一切變得簡單。 -### 解析電子表格格式 +``` + +**說明:** +1. **遍歷格式:** 相同的遍歷邏輯適用於簡報。 +2. **輸出格式細節:** 每個格式的名稱與副檔名皆會顯示。 + +## 如何判斷檔案格式副檔名? +有時您只有檔名,需要推斷相應的 `DocumentFormat`。GroupDocs.Editor 提供簡單的靜態輔助方法,將檔案副檔名映射到內部格式表示,讓您在載入編輯器前驗證或轉換檔案。 + +### 解析試算表格式 +`Formats.SpreadsheetFormats.FromExtension` 會將檔案副檔名字串轉換為相對應的試算表格式列舉值。 + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -解釋: -1. 解析格式:我們使用`FromExtension`方法來解析格式`.xlsm`擴大。 -2. 輸出格式:列印解析格式的名稱。 +``` + +**說明:** +1. **解析格式:** `FromExtension` 將 `.xlsm` 副檔名轉換為其內部的 `SpreadsheetFormat` 列舉。 +2. **輸出格式:** 印出解析後的格式名稱,以確認映射正確。 + ### 解析文字格式 +同樣地,`Formats.TextualFormats.FromExtension` 解析文字檔案的副檔名,例如 HTML 或 TXT。 + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -解釋: -1. 解析格式:`FromExtension`方法用於解析格式`html`擴大。 -2. 輸出格式:列印解析的文字格式的名稱。 -## 第 3 步:編輯文檔 -現在我們已經了解如何使用格式,接下來讓我們深入了解如何使用 GroupDocs.Editor 編輯文件。 -### 載入文檔 -要編輯文檔,您首先需要載入它。 +``` + +**說明:** +1. **解析格式:** `FromExtension` 方法將 `html` 副檔名解析為 `TextFormat`。 +2. **輸出格式:** 顯示文字格式的名稱,對於基於網頁的編輯器很有用。 + +## 確認格式後如何編輯文件? +一旦知道格式,載入與編輯文件遵循一致的模式。首先以來源檔案路徑建立 `Editor` 實例,然後呼叫 `Edit()` 取得 `EditableDocument`。接著您可以讀取、修改,最後使用相應的 `SaveOptions` 儲存內容。 + +### 載入文件 +`Editor` 是封裝特定檔案所有編輯操作的核心類別。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - //此處將介紹進一步的步驟。 + // Further steps will be covered here. } ``` -解釋: -1. 初始化編輯器:建立一個實例`Editor`類,提供文檔的路徑。 -2. 處置模式:使用`using`聲明以確保資源得到妥善處置。 -### 擷取內容 -載入文件後,您可以提取其內容進行編輯。 +``` + +**說明:** +1. **初始化 Editor:** 建立 `Editor` 實例,傳入目標檔案的完整路徑。 +2. **釋放模式:** `using` 陳述式確保所有非受控資源即時釋放。 + +### 取得內容 +`EditableDocument.GetContent()` 會回傳文件的原始文字(或對於基於網頁的編輯器則為 HTML),您可以顯示或操作它。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +212,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -解釋: -1. 編輯方法:調用`Edit`方法得到一個`EditableDocument`. -2. 取得內容:使用`GetContent`以字串形式檢索文件內容。 -3. 輸出內容:將內容列印到控制台。 +``` + +**說明:** +1. **Edit 方法:** `Edit()` 回傳 `EditableDocument` 物件。 +2. **取得內容:** `GetContent()` 取得文件的原始文字(或對於基於網頁的編輯器則為 HTML)。 +3. **輸出內容:** 將內容寫入主控台以供驗證。 + ### 儲存變更 -編輯後,將變更儲存回文件。 +`SaveOptions` 告訴編輯器如何以及以何種格式將編輯後的文件寫回儲存。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - //在這裡修改內容 + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -解釋: -1. 編輯方法:調用`Edit`方法得到一個`EditableDocument`. -2. 修改內容:根據需要修改內容(此程式碼片段中未顯示)。 -3. 儲存選項:建立`SaveOptions`指定格式。 -4. 儲存文件:使用`Save`方法儲存編輯後的文檔。 -## 步驟 4:處理不同的文件類型 -GroupDocs.Editor 支援各種文件類型。以下是如何與他們合作: -### 編輯電子表格文檔 +``` + +**說明:** +1. **Edit 方法:** 在修改後重新取得 `EditableDocument`。 +2. **修改內容:** 對字串套用變更(此處未示範)。 +3. **儲存選項:** 使用所需的輸出格式設定 `SaveOptions`。 +4. **儲存文件:** 將編輯後的檔案寫回磁碟。 + +## 如何處理不同類型的文件? +GroupDocs.Editor 把 Word、試算表與簡報的處理抽象為相同的 API 介面,讓您無需為每種文件族群學習新類別,即可輕鬆切換使用情境。 + +### 編輯試算表文件 +`SpreadsheetSaveOptions` 定義試算表的寫入方式,包括格式與可選的壓縮設定。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +253,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //在這裡修改內容 + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -解釋: -1. 初始化編輯器:建立一個`Editor`電子表格的實例。 -2. 編輯方式:調用`Edit`得到一個`EditableDocument`. -3. 取得內容:檢索並列印內容。 -4. 修改內容:進行必要的更改。 -5. 儲存選項:指定電子表格的儲存選項。 -6. 儲存文件:儲存修改後的文件。 -### 編輯示範文檔 +``` + +**說明:** +1. **初始化 Editor:** 將試算表檔案路徑傳入 `Editor` 建構函式。 +2. **Edit 方法:** 取得 `EditableDocument`。 +3. **取得內容:** 印出試算表的 CSV 表示(或 HTML)。 +4. **修改內容:** 套用您需要的儲存格層級變更。 +5. **儲存選項:** 選擇適當的 `SpreadsheetSaveOptions`。 +6. **儲存文件:** 將更新後的試算表寫回儲存。 + +### 編輯簡報文件 +`PresentationSaveOptions` 控制投影片的輸出格式,讓您可以保留或變更原始檔案類型。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +280,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //在這裡修改內容 + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -解釋: -1. 初始化編輯器:建立一個`Editor`簡報的實例。 -2. 編輯方式:調用`Edit`得到一個`EditableDocument`. -3. 取得內容:檢索並列印內容。 -4. 修改內容:進行必要的更改。 -5. 儲存選項:指定簡報的儲存選項。 -6. 儲存文件:儲存修改後的文件。 +``` + +**說明:** +1. **初始化 Editor:** 透過 `Editor` 載入 PowerPoint 檔案。 +2. **Edit 方法:** 取得 `EditableDocument`。 +3. **取得內容:** 抽取投影片的 HTML 或純文字。 +4. **修改內容:** 更新標題、項目符號或圖片。 +5. **儲存選項:** 使用 `PresentationSaveOptions` 定義輸出格式。 +6. **儲存文件:** 將編輯後的簡報儲存。 + +## 常見問題與解決方案 +- **「不支援的格式」錯誤:** 確認您使用的是最新的 GroupDocs.Editor 版本;它會定期加入對新 Office 格式的支援。 +- **大型檔案記憶體消耗:** 在載入文件前將 `EditorSettings.EnableStreaming = true` 以啟用串流模式。 +- **授權未套用:** 確認臨時授權檔案放置於應用程式根目錄,或透過 `License license = new License(); license.SetLicense("path/to/license.lic");` 載入。 + +## 常見問答 + +**Q: `DocumentFormatInfo` 與 `SaveOptions` 有何差異?** +A: `DocumentFormatInfo` 提供支援檔案類型的中繼資料,而 `SaveOptions` 設定文件寫回磁碟的方式(格式、壓縮等)。 + +**Q: 我可以列出自訂副檔名的格式嗎?** +A: 可以——使用 `DocumentFormatInfo.FromExtension("yourExt")`;若副檔名未被識別,該方法會回傳 `null`。 + +**Q: GroupDocs.Editor 支援受密碼保護的檔案嗎?** +A: 當然支援。透過 `EditorSettings` 將密碼傳入 `Editor` 建構函式,即可開啟加密文件。 + +**Q: GroupDocs.Editor 實際支援多少種格式?** +A: 超過 **30 種輸入與輸出格式**,涵蓋 Word、Excel、PowerPoint、HTML 與純文字。 + +**Q: 有沒有方法將清單限制為僅可編輯的格式?** +A: 使用 `GetEditableWordProcessingFormats()`(或 Spreadsheet/Presentation 等效方法)取得允許完整編輯功能的格式。 + +## 其他資源 +- 從 [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) 下載程式庫。 +- 取得 [temporary license](https://purchase.groupdocs.com/temporary-license/) 以獲得完整功能存取。 +- 透過 [free trial](https://releases.groupdocs.com/) 試用產品。 +- 在 [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/) 中探索詳細使用範例。 +- 在 [support forum](https://forum.groupdocs.com/c/editor/20) 上向社群尋求協助。 + ## 結論 -GroupDocs.Editor for .NET 提供了一種強大且靈活的方法來以程式設計方式編輯各種文件格式。透過遵循本指南,您可以有效地將文件編輯功能整合到 .NET 應用程式中,增強其功能並為使用者提供更大的價值。 -## 常見問題解答 -### 什麼是 .NET 的 GroupDocs.Editor? -GroupDocs.Editor for .NET 是一個功能強大的程式庫,可讓開發人員在其 .NET 應用程式中以程式設計方式編輯各種文件格式。 -### 如何開始使用適用於 .NET 的 GroupDocs.Editor? -您需要下載庫,以取得臨時許可證,並使用必要的命名空間設定開發環境。 -### 支援哪些文件格式? -GroupDocs.Editor 支援文字處理、電子表格、簡報和文字格式等。 -### 我可以免費使用 GroupDocs.Editor 嗎? -您可以使用[免費試用](https://releases.groupdocs.com/)功能有限或獲得[臨時執照](https://purchase.groupdocs.com/temporary-license/)以獲得完全存取權限。 -### 我可以在哪裡找到更多資源和支援? -參觀[GroupDocs.Editor 文檔](https://tutorials.groupdocs.com/editor/net/)欲了解詳細信息,或查看他們的[支援論壇](https://forum.groupdocs.com/c/editor/20)求助。 \ No newline at end of file +透過本指南,您現在已了解如何 **列出支援的文件格式**、**從副檔名判斷檔案格式**,以及使用 GroupDocs.Editor for .NET **編輯 Word、試算表與簡報類型的文件**。將這些程式碼片段整合至您的專案,以打造具備格式感知的穩健應用程式,提升終端使用者體驗並減少執行時錯誤。 + +--- + +**最後更新:** 2026-06-06 +**測試環境:** GroupDocs.Editor 23.9 for .NET +**作者:** GroupDocs + +## 相關教學 + +- [精通 .NET 中的文件載入(使用 GroupDocs.Editor):完整指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [精通 .NET 中的文件編輯(使用 GroupDocs.Editor):完整指南](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [使用 GroupDocs.Editor .NET 將 Word 轉換為 HTML:一步步指南](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/hungarian/net/document-processing/work-document-formats/_index.md b/content/hungarian/net/document-processing/work-document-formats/_index.md index e609b404..c1f48178 100644 --- a/content/hungarian/net/document-processing/work-document-formats/_index.md +++ b/content/hungarian/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Dolgozzon dokumentumformátumokkal -linktitle: Dolgozzon dokumentumformátumokkal +date: 2026-06-06 +description: Ismerje meg, hogyan lehet felsorolni a támogatott dokumentumformátumokat + és meghatározni a fájlformátum kiterjesztését a GroupDocs.Editor for .NET használatával. + Step‑by‑step guide with code snippets, quick answers, and FAQs. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Támogatott dokumentumformátumok listázása +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Ismerje meg, hogyan használhatja a GroupDocs.Editor for .NET-et különféle dokumentumformátumok programozott szerkesztéséhez. Lépésről lépésre útmutató példákkal a zökkenőmentes integráció érdekében. -weight: 13 -url: /hu/net/document-processing/work-document-formats/ +title: Támogatott dokumentumformátumok listázása a GroupDocs.Editor .NET segítségével type: docs +url: /hu/net/document-processing/work-document-formats/ +weight: 13 --- -# Dolgozzon dokumentumformátumokkal -## Bevezetés -Üdvözöljük a GroupDocs.Editor for .NET használatáról szóló részletes útmutatónkban! Ha Ön fejlesztő, aki dokumentumszerkesztési lehetőségekkel szeretné bővíteni alkalmazásait, akkor jó helyen jár. Ez a cikk végigvezeti Önt mindenen, amit tudnia kell, az előfeltételektől a gyakorlati példákig, hogy elinduljon ezzel a hatékony könyvtárral. +# Támogatott dokumentumformátumok listája + +Üdvözöljük átfogó oktatóanyagainkban, amely **hogyan listázzuk a támogatott dokumentumformátumokat** a GroupDocs.Editor for .NET segítségével. Akár dokumentum‑központú webalkalmazást, akár vállalati szintű asztali eszközt épít, elengedhetetlen, hogy pontosan tudja, mely formátumokat szerkesztheti vagy konvertálhatja. Ebben az útmutatóban megtudja, hogyan sorolja fel a formátumokat, hogyan dolgozza fel a kiterjesztéseket, és hogyan szerkesszen dokumentumokat – mindezt világos, emberi nyelven megfogalmazott magyarázatokkal és azonnal futtatható kódrészletekkel. + +## Gyors válaszok +- **Hogyan listázhatom az összes támogatott formátumot?** Használja a `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (vagy a Presentation/Spreadsheet megfelelőket) és iterálja a gyűjteményt. +- **Meg tudom határozni a formátumot egy fájl kiterjesztésből?** Igen—hívja a `DocumentFormatInfo.FromExtension(".docx")`-t. +- **Milyen fájltípusokat támogat a GroupDocs.Editor?** Több mint 30 bemeneti és kimeneti formátum, beleértve a DOCX, XLSX, PPTX, HTML és egyszerű szöveg formátumokat. +- **Szükségem van licencre a formátumok listázásához?** Egy ideiglenes licenc feloldja a teljes API-t; egyébként a próbaverzió korlátozott funkciókkal működik. +- **Mely .NET verziók kompatibilisek?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Mi az a „támogatott dokumentumformátumok listázása”? +A kifejezés arra utal, hogy programozott módon lekérdezzük azon fájltípusok gyűjteményét, amelyeket a GroupDocs.Editor megnyithat, szerkeszthet és menthet. Ez a művelet lehetővé teszi dinamikus UI legördülő menük létrehozását vagy a felhasználói feltöltések validálását a feldolgozás előtt, biztosítva, hogy csak kompatibilis fájlok kerüljenek az editorba a további manipulációhoz. + +## Miért listázzuk a támogatott dokumentumformátumokat? +A GroupDocs.Editor **több mint 30 bemeneti és kimeneti formátumot támogat** és akár **2 GB** méretű fájlokat is kezel anélkül, hogy a teljes dokumentumot a memóriába töltené. A pontos lista ismerete megakadályozza a futásidejű hibákat, javítja a felhasználói élményt, és lehetővé teszi üzleti szabályok érvényesítését, például „csak szerkeszthető Office dokumentumok engedélyezése”. Emellett segít a felhasználók számára csak az alkalmazás által valóban támogatott formátumok megjelenítésében. + ## Előfeltételek -Mielőtt belemerülne a GroupDocs.Editor for .NET példáiba és funkcióiba, meg kell felelnie néhány előfeltételnek: -1. A .NET alapvető ismerete: A .NET Framework vagy a .NET Core ismerete elengedhetetlen. -2. Fejlesztői környezet: Visual Studio vagy bármely más megfelelő .NET IDE. -3. GroupDocs.Editor for .NET Library: Töltse le a könyvtárat a[GroupDocs kiadási oldal](https://releases.groupdocs.com/editor/net/). -4. Ideiglenes engedély: Szerezzen be a[ideiglenes engedély](https://purchase.groupdocs.com/temporary-license/) a teljes funkciókért. -## Névterek importálása -GroupDocs.Editor for .NET használatának megkezdéséhez importálnia kell a szükséges névtereket a projektbe. Ez biztosítja, hogy hozzáférjen a könyvtár által biztosított összes osztályhoz és metódushoz. +Mielőtt elkezdené, győződjön meg róla, hogy rendelkezik: + +1. **.NET fejlesztői környezet** – Visual Studio 2022 vagy bármely IDE, amely támogatja a .NET 6+. +2. **GroupDocs.Editor for .NET könyvtár** – letöltés a [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) oldalról. +3. **Ideiglenes licenc** – szerezzen be egy [temporary license](https://purchase.groupdocs.com/temporary-license/) a korlátlan hozzáféréshez. +4. **Alap C# ismeretek** – ismerje a névtereket, a `using` utasításokat és a konzol kimenetet. + +## Hogyan listázzuk a támogatott dokumentumformátumokat? +Töltsük be a támogatott formátumok gyűjteményét, és írjuk ki minden formátum nevét és fájlkiterjesztését. Ez a kétlépéses minta a Word feldolgozási, a Táblázatkezelő és a Prezentáció dokumentumokra egyaránt működik. A gyűjtemény iterálásával dinamikusan tölthetünk fel UI elemeket, például legördülő menüket, biztosítva, hogy a felhasználók csak az editor által ténylegesen kezelhető formátumokat választhassák. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Word feldolgozási formátumok listázása +A `Formats.WordProcessingFormats` egy felsorolás, amely leírja az összes Word‑feldolgozási fájltípust, amelyet az editor felismer. Az `All` tulajdonság egy gyűjteményt ad vissza ezekből a formátumobjektumokból. -## 1. lépés: Munka a dokumentumformátumokkal -A GroupDocs.Editor a dokumentumformátumok széles skáláját támogatja. Vizsgáljuk meg, hogyan sorolhatja fel az összes támogatott szövegszerkesztő és prezentációs formátumot. -### Szövegszerkesztő formátumok listázása +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Magyarázat: -1. Formátumok ismétlése: Végigfutunk az összes elérhető szövegszerkesztő formátumon. -2. Kimeneti formátum részletei: Minden formátumhoz kinyomtatjuk a nevét és a kiterjesztését. +``` + +**Explanation:** +1. **Loop Through Formats:** We iterate over all available Word‑processing formats. +2. **Output Format Details:** For each format we print its friendly name and default file extension. + ### Prezentációs formátumok listázása +A `Formats.PresentationFormats` ugyanúgy működik a diavetítési fájlok esetén, a `All` gyűjteményen keresztül teszi elérhetővé minden támogatott prezentációtípust. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Magyarázat: -1. Formátumok hurkolása: A szövegszerkesztő formátumokhoz hasonlóan az összes prezentációs formátumot végigfutjuk. -2. Kimeneti formátum részletei: Nyomtassa ki az egyes formátumok nevét és kiterjesztését. -## 2. lépés: Formátumok elemzése a bővítményekből -Néha meg kell határoznia a formátumot egy fájlkiterjesztés alapján. A GroupDocs.Editor ezt megkönnyíti. -### Táblázatformátumok elemzése +``` + +**Explanation:** +1. **Loop Through Formats:** The same looping logic applies to presentations. +2. **Output Format Details:** The name and extension are displayed for each format. + +## Hogyan határozzuk meg a fájlformátum kiterjesztését? +Néha csak egy fájlnév áll rendelkezésre, és meg kell határozni a megfelelő `DocumentFormat`-ot. A GroupDocs.Editor egy egyszerű statikus segédfüggvényt kínál, amely a fájl kiterjesztését a belső formátumábrázolásra térképezi, lehetővé téve a fájlok validálását vagy konvertálását, mielőtt betöltené őket az editorba. + +### Táblázatkezelő formátumok feldolgozása +A `Formats.SpreadsheetFormats.FromExtension` egy fájl kiterjesztés karakterláncot alakít át a megfelelő táblázatkezelő formátum enum értékre. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Magyarázat: -1. Elemzési formátum: A`FromExtension` módszer a formátum elemzéséhez a`.xlsm` kiterjesztés. -2. Kimeneti formátum: Az elemzett formátum nevének kinyomtatása. -### Szöveges formátumok elemzése +``` + +**Explanation:** +1. **Parse Format:** `FromExtension` converts the `.xlsm` extension into its internal `SpreadsheetFormat` enum. +2. **Output Format:** The parsed format’s name is printed, confirming the mapping. + +### Szöveges formátumok feldolgozása +Hasonlóképpen, a `Formats.TextualFormats.FromExtension` feloldja a szöveges fájl kiterjesztéseket, például a HTML vagy TXT formátumokat. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Magyarázat: -1. Elemzési formátum: A`FromExtension` metódust használjuk a formátum elemzésére a`html` kiterjesztés. -2. Kimeneti formátum: Nyomtassa ki az elemzett szöveges formátum nevét. -## 3. lépés: Dokumentumok szerkesztése -Most, hogy láttuk, hogyan kell dolgozni a formátumokkal, merüljünk el a dokumentumok GroupDocs.Editor segítségével történő szerkesztésében. +``` + +**Explanation:** +1. **Parse Format:** The `FromExtension` method resolves the `html` extension to a `TextFormat`. +2. **Output Format:** The name of the textual format is displayed, useful for web‑based editors. + +## Hogyan szerkesszünk dokumentumokat a formátumok azonosítása után? +Miután ismeri a formátumot, a dokumentum betöltése és szerkesztése egy konzisztens mintát követ. Először egy `Editor` példányt hoz létre a forrásfájl elérési útjával, majd meghívja az `Edit()` metódust, hogy egy `EditableDocument` objektumot kapjon. Innen olvashat, módosíthat és végül mentheti a tartalmat a megfelelő `SaveOptions` használatával. + ### Dokumentum betöltése -Egy dokumentum szerkesztéséhez először be kell töltenie. +Az `Editor` az a központi osztály, amely egy adott fájl összes szerkesztési műveletét magába foglalja. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // A további lépésekről itt lesz szó. + // Further steps will be covered here. } ``` -Magyarázat: -1. Szerkesztő inicializálása: Hozzon létre egy példányt a`Editor` osztályt, megadva a dokumentum elérési útját. -2. Eldobási minta: Használja a`using` nyilatkozatot, amely biztosítja az erőforrások megfelelő kezelését. +``` + +**Explanation:** +1. **Initialize Editor:** Create an `Editor` instance, passing the full path of the target file. +2. **Dispose Pattern:** The `using` statement guarantees that all unmanaged resources are released promptly. + ### Tartalom kinyerése -A dokumentum betöltése után kibonthatja a tartalmát szerkesztés céljából. +A `EditableDocument.GetContent()` visszaadja a dokumentum nyers szövegét (vagy HTML‑t web‑alapú szerkesztők esetén), amelyet megjeleníthet vagy manipulálhat. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Magyarázat: -1. Módszer szerkesztése: Hívja a`Edit` módszer egy`EditableDocument`. -2. Tartalom beszerzése: Használd`GetContent` a dokumentum tartalmának karakterláncként történő lekéréséhez. -3. Kimeneti tartalom: Nyomtassa ki a tartalmat a konzolra. -### Módosítások mentése -A szerkesztés után mentse vissza a módosításokat a dokumentumba. +``` + +**Explanation:** +1. **Edit Method:** `Edit()` returns an `EditableDocument` object. +2. **Get Content:** `GetContent()` extracts the document’s raw text (or HTML for web‑based editors). +3. **Output Content:** The content is written to the console for verification. + +### Változások mentése +A `SaveOptions` megmondja az editornak, hogyan és milyen formátumban írja vissza a szerkesztett dokumentumot a tárolóba. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Itt módosíthatja a tartalmat + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Magyarázat: -1. Módszer szerkesztése: Hívja a`Edit` módszer egy`EditableDocument`. -2. Tartalom módosítása: Szükség szerint módosítsa a tartalmat (nem látható ebben a részletben). -3. Mentés opciók: Létrehoz`SaveOptions` a formátum megadása. -4. Dokumentum mentése: Használja a`Save` módot a szerkesztett dokumentum mentésére. -## 4. lépés: Különböző típusú dokumentumok kezelése -A GroupDocs.Editor különféle dokumentumtípusokat támogat. Így dolgozhat velük: -### Táblázatdokumentumok szerkesztése +``` + +**Explanation:** +1. **Edit Method:** Re‑obtain the `EditableDocument` after modifications. +2. **Modify Content:** Apply your changes to the string (not shown here). +3. **Save Options:** Configure `SaveOptions` with the desired output format. +4. **Save Document:** Persist the edited file back to disk. + +## Hogyan dolgozzunk különböző dokumentumtípusokkal? +A GroupDocs.Editor a Word, Spreadsheet és Presentation kezelését ugyanazon API felületen absztrahálja, így könnyű kontextust váltani anélkül, hogy minden dokumentumcsaládhoz új osztálykészletet kellene megtanulni. + +### Táblázat dokumentumok szerkesztése +A `SpreadsheetSaveOptions` meghatározza, hogyan íródik egy táblázat, beleértve a formátumot és az opcionális tömörítési beállításokat. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Itt módosíthatja a tartalmat + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Magyarázat: -1. Szerkesztő inicializálása: Hozzon létre egy`Editor` példa egy táblázathoz. -2. Módszer szerkesztése: Hívás`Edit` hogy egy`EditableDocument`. -3. Tartalom beszerzése: Töltse le és nyomtassa ki a tartalmat. -4. Tartalom módosítása: Végezze el a szükséges módosításokat. -5. Mentés beállításai: Adja meg a táblázatok mentési beállításait. -6. Dokumentum mentése: Mentse el a módosított dokumentumot. -### Prezentációs dokumentumok szerkesztése +``` + +**Explanation:** +1. **Initialize Editor:** Pass a spreadsheet file path to the `Editor` constructor. +2. **Edit Method:** Retrieve an `EditableDocument`. +3. **Get Content:** Print the spreadsheet’s CSV representation (or HTML). +4. **Modify Content:** Apply any cell‑level changes you need. +5. **Save Options:** Choose the appropriate `SpreadsheetSaveOptions`. +6. **Save Document:** Write the updated spreadsheet back to storage. + +### Prezentáció dokumentumok szerkesztése +A `PresentationSaveOptions` szabályozza a diavetítések kimeneti formátumát, lehetővé téve az eredeti fájltípus megőrzését vagy módosítását. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Itt módosíthatja a tartalmat + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Magyarázat: -1. Szerkesztő inicializálása: Hozzon létre egy`Editor` példa egy prezentációhoz. -2. Módszer szerkesztése: Hívás`Edit` hogy egy`EditableDocument`. -3. Tartalom beszerzése: Töltse le és nyomtassa ki a tartalmat. -4. Tartalom módosítása: Végezze el a szükséges módosításokat. -5. Mentési beállítások: Adja meg a bemutatók mentési beállításait. -6. Dokumentum mentése: Mentse el a módosított dokumentumot. +``` + +**Explanation:** +1. **Initialize Editor:** Load a PowerPoint file via `Editor`. +2. **Edit Method:** Obtain an `EditableDocument`. +3. **Get Content:** Extract slide HTML or plain text. +4. **Modify Content:** Update titles, bullet points, or images. +5. **Save Options:** Use `PresentationSaveOptions` to define the output format. +6. **Save Document:** Persist the edited presentation. + +## Gyakori problémák és megoldások +- **„Format not supported” error:** Verify you’re using the latest GroupDocs.Editor version; it adds support for newer Office formats regularly. +- **Large file memory consumption:** Enable streaming mode by setting `EditorSettings.EnableStreaming = true` before loading the document. +- **License not applied:** Ensure the temporary license file is placed in the application root or loaded via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Gyakran ismételt kérdések + +**Q: Mi a különbség a `DocumentFormatInfo` és a `SaveOptions` között?** +A: A `DocumentFormatInfo` metaadatokat szolgáltat a támogatott fájltípusokról, míg a `SaveOptions` konfigurálja, hogyan írja vissza a dokumentumot a lemezre (formátum, tömörítés stb.). + +**Q: Listázhatok formátumokat egy egyedi fájlkiterjesztéshez?** +A: Igen—használja a `DocumentFormatInfo.FromExtension("yourExt")`‑t; ha a kiterjesztést nem ismeri fel, a metódus `null`‑t ad vissza. + +**Q: Támogatja a GroupDocs.Editor a jelszóval védett fájlokat?** +A: Teljes mértékben. A jelszót az `Editor` konstruktorába az `EditorSettings`‑en keresztül adhatja meg a titkosított dokumentumok megnyitásához. + +**Q: Hány formátumot támogat valójában a GroupDocs.Editor?** +A: Több mint **30 bemeneti és kimeneti formátum**, beleértve a Word, Excel, PowerPoint, HTML és egyszerű szöveg formátumokat. + +**Q: Van mód a listát csak a szerkeszthető formátumokra korlátozni?** +A: Használja a `GetEditableWordProcessingFormats()` (vagy Spreadsheet/Presentation megfelelőket) metódust, hogy lekérje azokat a formátumokat, amelyek teljes szerkesztési képességet biztosítanak. + +## További források +- Töltse le a könyvtárat a [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) oldalról. +- Szerezzen be egy [temporary license](https://purchase.groupdocs.com/temporary-license/) teljes funkciókhoz. +- Próbálja ki a terméket egy [free trial](https://releases.groupdocs.com/) segítségével. +- Tekintse meg a részletes használati példákat a [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/) oldalon. +- Kérjen segítséget a közösségtől a [support forum](https://forum.groupdocs.com/c/editor/20) fórumon. + ## Következtetés -GroupDocs.Editor for .NET robusztus és rugalmas módot biztosít a különféle dokumentumformátumok programozott szerkesztésére. Az útmutató követésével hatékonyan integrálhatja a dokumentumszerkesztő funkciókat .NET-alkalmazásaiba, javítva azok képességeit, és nagyobb értéket biztosítva a felhasználóknak. -## GYIK -### Mi az a GroupDocs.Editor for .NET? -A GroupDocs.Editor for .NET egy hatékony könyvtár, amely lehetővé teszi a fejlesztők számára, hogy .NET-alkalmazásaikon belül programozottan szerkesszenek különféle dokumentumformátumokat. -### Hogyan kezdhetem el a GroupDocs.Editor for .NET használatát? -Le kell töltenie a könyvtárat, be kell szereznie egy ideiglenes licencet, és be kell állítania a fejlesztői környezetet a szükséges névterekkel. -### Milyen dokumentumformátumok támogatottak? -A GroupDocs.Editor többek között támogatja a szövegszerkesztőt, a táblázatkezelőt, a prezentációt és a szöveges formátumokat. -### Használhatom ingyenesen a GroupDocs.Editort? - Használhatja a[ingyenes próbaverzió](https://releases.groupdocs.com/) korlátozott funkciókkal, vagy szerezzen be a[ideiglenes engedély](https://purchase.groupdocs.com/temporary-license/) a teljes hozzáférés érdekében. -### Hol találhatok további forrásokat és támogatást? - Meglátogatni a[GroupDocs.Editor dokumentáció](https://tutorials.groupdocs.com/editor/net/) részletes információkért, vagy nézze meg őket[támogatói fórum](https://forum.groupdocs.com/c/editor/20) segítségért. \ No newline at end of file +Az útmutató követésével most már tudja, hogyan **listázhatja a támogatott dokumentumformátumokat**, **határozza meg a fájlformátumot a kiterjesztés alapján**, és **szerkesszen dokumentumokat** a Word, Spreadsheet és Presentation típusokban a GroupDocs.Editor for .NET használatával. Integrálja ezeket a kódrészleteket saját projektjeibe, hogy robusztus, formátum‑tudatos alkalmazásokat építsen, amelyek örömet szereznek a végfelhasználóknak és csökkentik a futásidejű hibákat. + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Kapcsolódó oktatóanyagok + +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Master Document Editing in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Convert Word to HTML Using GroupDocs.Editor .NET: A Step‑By‑Step Guide](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/indonesian/net/document-processing/work-document-formats/_index.md b/content/indonesian/net/document-processing/work-document-formats/_index.md index bfc81075..daff4b9b 100644 --- a/content/indonesian/net/document-processing/work-document-formats/_index.md +++ b/content/indonesian/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Bekerja dengan Format Dokumen -linktitle: Bekerja dengan Format Dokumen +date: 2026-06-06 +description: Pelajari cara membuat daftar format dokumen yang didukung dan menentukan + ekstensi format file menggunakan GroupDocs.Editor untuk .NET. Panduan langkah demi + langkah dengan cuplikan kode, jawaban cepat, dan FAQ. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Daftar Format Dokumen yang Didukung +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Pelajari cara menggunakan GroupDocs.Editor untuk .NET untuk mengedit berbagai format dokumen secara terprogram. Panduan langkah demi langkah dengan contoh untuk integrasi yang lancar. -weight: 13 -url: /id/net/document-processing/work-document-formats/ +title: Daftar Format Dokumen yang Didukung dengan GroupDocs.Editor .NET type: docs +url: /id/net/document-processing/work-document-formats/ +weight: 13 --- -# Bekerja dengan Format Dokumen -## Perkenalan -Selamat datang di panduan mendalam kami tentang penggunaan GroupDocs.Editor untuk .NET! Jika Anda seorang pengembang yang ingin menyempurnakan aplikasi Anda dengan kemampuan mengedit dokumen, Anda telah datang ke tempat yang tepat. Artikel ini akan memandu Anda melalui semua yang perlu Anda ketahui, mulai dari prasyarat hingga contoh praktis, agar Anda dapat mulai menggunakan perpustakaan canggih ini. +# Daftar Format Dokumen yang Didukung + +Selamat datang di tutorial komprehensif kami tentang **cara menampilkan daftar format dokumen yang didukung** dengan GroupDocs.Editor untuk .NET. Baik Anda sedang membangun aplikasi web yang berfokus pada dokumen maupun alat desktop kelas perusahaan, mengetahui secara tepat format apa yang dapat Anda edit atau konversi sangat penting. Dalam panduan ini Anda akan menemukan cara menenumerasi format, mengurai ekstensi, dan mengedit dokumen—semua dengan penjelasan yang jelas, ramah manusia, dan cuplikan kode siap dijalankan. + +## Jawaban Cepat +- **Bagaimana cara menampilkan semua format yang didukung?** Gunakan `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (atau setara untuk Presentation/Spreadsheet) dan iterasi koleksinya. +- **Bisakah saya menentukan format dari ekstensi file?** Ya—panggil `DocumentFormatInfo.FromExtension(".docx")`. +- **Jenis file apa yang didukung oleh GroupDocs.Editor?** Lebih dari 30 format input dan output, termasuk DOCX, XLSX, PPTX, HTML, dan teks biasa. +- **Apakah saya memerlukan lisensi untuk menampilkan format?** Lisensi sementara membuka penuh API; jika tidak, versi percobaan berfungsi dengan fitur terbatas. +- **Versi .NET mana yang kompatibel?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Apa itu “daftar format dokumen yang didukung”? +Istilah ini merujuk pada pengambilan koleksi tipe file yang secara programatik dapat dibuka, diedit, dan disimpan oleh GroupDocs.Editor. Operasi ini memungkinkan Anda membangun dropdown UI dinamis atau memvalidasi unggahan pengguna sebelum diproses, memastikan hanya file yang kompatibel yang diteruskan ke editor untuk manipulasi lebih lanjut. + +## Mengapa harus mencantumkan format dokumen yang didukung? +GroupDocs.Editor **mendukung lebih dari 30 format input dan output** serta dapat menangani file hingga **2 GB** tanpa memuat seluruh dokumen ke memori. Mengetahui daftar tepat mencegah kesalahan runtime, meningkatkan pengalaman pengguna, dan memungkinkan Anda menegakkan aturan bisnis seperti “hanya izinkan dokumen Office yang dapat diedit.” Ini juga membantu Anda menampilkan hanya format yang benar‑benar didukung aplikasi Anda. + ## Prasyarat -Sebelum mendalami contoh dan fungsi GroupDocs.Editor untuk .NET, ada beberapa prasyarat yang perlu Anda miliki: -1. Pemahaman Dasar tentang .NET: Keakraban dengan .NET Framework atau .NET Core sangat penting. -2. Lingkungan Pengembangan: Visual Studio atau .NET IDE lain yang sesuai. -3. GroupDocs.Editor untuk .NET Library: Unduh perpustakaan dari[Halaman rilis GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Lisensi Sementara: Mendapatkan a[izin sementara](https://purchase.groupdocs.com/temporary-license/) untuk fitur lengkap. -## Impor Namespace -Untuk memulai GroupDocs.Editor untuk .NET, Anda perlu mengimpor namespace yang diperlukan ke dalam proyek Anda. Ini akan memastikan Anda memiliki akses ke semua kelas dan metode yang disediakan oleh perpustakaan. +Sebelum memulai, pastikan Anda memiliki: + +1. **Lingkungan pengembangan .NET** – Visual Studio 2022 atau IDE apa pun yang mendukung .NET 6+. +2. **Pustaka GroupDocs.Editor untuk .NET** – unduh dari [halaman rilis GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Lisensi sementara** – dapatkan [lisensi sementara](https://purchase.groupdocs.com/temporary-license/) untuk akses tanpa batas. +4. **Pengetahuan dasar C#** – familiar dengan namespace, pernyataan `using`, dan output konsol. + +## Cara Menampilkan Daftar Format Dokumen yang Didukung? +Muat koleksi format yang didukung dan cetak nama serta ekstensi masing‑masing. Pola dua langkah ini bekerja untuk dokumen Word Processing, Spreadsheet, dan Presentation. Dengan mengiterasi koleksi, Anda dapat secara dinamis mengisi elemen UI seperti dropdown, memastikan pengguna hanya dapat memilih format yang memang dapat ditangani editor. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Menampilkan Format Pengolahan Kata +`Formats.WordProcessingFormats` adalah enumerasi yang menggambarkan setiap tipe file pengolahan kata yang dikenali oleh editor. Properti `All` mengembalikan koleksi objek format ini. -## Langkah 1: Bekerja dengan Format Dokumen -GroupDocs.Editor mendukung berbagai format dokumen. Mari jelajahi bagaimana Anda dapat membuat daftar semua format Pemrosesan Kata dan Presentasi yang didukung. -### Mencantumkan Format Pengolahan Kata +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Penjelasan: -1. Format Loop Through: Kami menelusuri semua format Pemrosesan Kata yang tersedia. -2. Detail Format Output: Untuk setiap format, kami mencetak nama dan ekstensinya. -### Daftar Format Presentasi +``` + +**Penjelasan:** +1. **Iterasi Melalui Format:** Kami mengiterasi semua format pengolahan kata yang tersedia. +2. **Tampilkan Detail Format:** Untuk setiap format kami mencetak nama yang bersahabat dan ekstensi file default. + +### Menampilkan Format Presentasi +`Formats.PresentationFormats` bekerja dengan cara yang sama untuk file slide, menampilkan setiap tipe presentasi yang didukung melalui koleksi `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Penjelasan: -1. Format Loop Through: Mirip dengan format Pemrosesan Kata, kami mengulang semua format Presentasi. -2. Detail Format Output: Cetak nama dan ekstensi setiap format. -## Langkah 2: Mengurai Format dari Ekstensi -Terkadang, Anda perlu menentukan format berdasarkan ekstensi file. GroupDocs.Editor membuat ini mudah. +``` + +**Penjelasan:** +1. **Iterasi Melalui Format:** Logika iterasi yang sama diterapkan pada presentasi. +2. **Tampilkan Detail Format:** Nama dan ekstensi ditampilkan untuk setiap format. + +## Cara Menentukan Ekstensi Format File? +Terkadang Anda hanya memiliki nama file dan perlu menebak `DocumentFormat` yang sesuai. GroupDocs.Editor menyediakan helper statis yang langsung memetakan ekstensi file ke representasi format internal, memungkinkan Anda memvalidasi atau mengkonversi file sebelum memuatnya ke editor. + ### Mengurai Format Spreadsheet +`Formats.SpreadsheetFormats.FromExtension` mengubah string ekstensi file menjadi nilai enum format spreadsheet yang cocok. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Penjelasan: -1. Format Parse: Kami menggunakan`FromExtension` metode untuk mengurai format dari`.xlsm` perpanjangan. -2. Format Output: Cetak nama format yang diurai. -### Mengurai Format Tekstual +``` + +**Penjelasan:** +1. **Parse Format:** `FromExtension` mengubah ekstensi `.xlsm` menjadi enum `SpreadsheetFormat` internal. +2. **Output Format:** Nama format yang diparse dicetak, mengonfirmasi pemetaan. + +### Mengurai Format Teks +Demikian pula, `Formats.TextualFormats.FromExtension` menyelesaikan ekstensi file teks seperti HTML atau TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Penjelasan: -1. Format Penguraian: The`FromExtension` Metode ini digunakan untuk mengurai format dari`html` perpanjangan. -2. Format Output: Cetak nama format tekstual yang diurai. -## Langkah 3: Mengedit Dokumen -Sekarang kita telah melihat cara bekerja dengan format, mari selami pengeditan dokumen menggunakan GroupDocs.Editor. +``` + +**Penjelasan:** +1. **Parse Format:** Metode `FromExtension` menyelesaikan ekstensi `html` menjadi `TextFormat`. +2. **Output Format:** Nama format teks ditampilkan, berguna untuk editor berbasis web. + +## Cara Mengedit Dokumen Setelah Menentukan Format? +Setelah Anda mengetahui formatnya, memuat dan mengedit dokumen mengikuti pola konsisten. Pertama buat instance `Editor` dengan path ke file sumber, lalu panggil `Edit()` untuk memperoleh `EditableDocument`. Dari sana Anda dapat membaca, memodifikasi, dan akhirnya menyimpan konten menggunakan `SaveOptions` yang sesuai. + ### Memuat Dokumen -Untuk mengedit dokumen, Anda perlu memuatnya terlebih dahulu. +`Editor` adalah kelas inti yang membungkus semua operasi pengeditan untuk file tertentu. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Langkah selanjutnya akan dibahas di sini. + // Further steps will be covered here. } ``` -Penjelasan: -1. Inisialisasi Editor: Buat sebuah instance dari`Editor` kelas, menyediakan jalur ke dokumen Anda. -2. Pola Buang: Gunakan`using` pernyataan untuk memastikan sumber daya dibuang dengan benar. +``` + +**Penjelasan:** +1. **Inisialisasi Editor:** Buat instance `Editor`, berikan path lengkap file target. +2. **Pola Dispose:** Pernyataan `using` menjamin semua sumber daya tak terkelola dilepaskan dengan cepat. + ### Mengekstrak Konten -Setelah dokumen dimuat, Anda dapat mengekstrak kontennya untuk diedit. +`EditableDocument.GetContent()` mengembalikan teks mentah dokumen (atau HTML untuk editor berbasis web), yang dapat Anda tampilkan atau manipulasi. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Penjelasan: -1. Metode Edit: Hubungi`Edit` metode untuk mendapatkan`EditableDocument`. -2. Dapatkan Konten: Gunakan`GetContent` untuk mengambil konten dokumen sebagai string. -3. Konten Keluaran: Cetak konten ke konsol. -### Menyimpan perubahan -Setelah mengedit, simpan perubahan Anda kembali ke dokumen. +``` + +**Penjelasan:** +1. **Metode Edit:** `Edit()` mengembalikan objek `EditableDocument`. +2. **Dapatkan Konten:** `GetContent()` mengekstrak teks mentah dokumen (atau HTML untuk editor berbasis web). +3. **Output Konten:** Konten ditulis ke konsol untuk verifikasi. + +### Menyimpan Perubahan +`SaveOptions` memberi tahu editor cara dan dalam format apa menulis kembali dokumen yang telah diedit ke penyimpanan. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Ubah konten di sini + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Penjelasan: -1. Metode Edit: Hubungi`Edit` metode untuk mendapatkan`EditableDocument`. -2. Ubah Konten: Ubah konten sesuai kebutuhan (tidak ditampilkan dalam cuplikan ini). -3. Opsi Simpan: Buat`SaveOptions` menentukan formatnya. -4. Simpan Dokumen: Gunakan`Save` metode untuk menyimpan dokumen yang diedit. -## Langkah 4: Bekerja dengan Berbagai Jenis Dokumen -GroupDocs.Editor mendukung berbagai jenis dokumen. Berikut cara bekerja dengan mereka: +``` + +**Penjelasan:** +1. **Metode Edit:** Dapatkan kembali `EditableDocument` setelah modifikasi. +2. **Modifikasi Konten:** Terapkan perubahan pada string (tidak ditampilkan di sini). +3. **Opsi Simpan:** Konfigurasikan `SaveOptions` dengan format output yang diinginkan. +4. **Simpan Dokumen:** Persist file yang telah diedit kembali ke disk. + +## Cara Bekerja dengan Berbagai Jenis Dokumen? +GroupDocs.Editor menyatukan penanganan Word, Spreadsheet, dan Presentation di balik antarmuka API yang sama, sehingga mudah beralih konteks tanpa harus mempelajari kumpulan kelas baru untuk tiap keluarga dokumen. + ### Mengedit Dokumen Spreadsheet +`SpreadsheetSaveOptions` menentukan cara spreadsheet ditulis, termasuk format dan pengaturan kompresi opsional. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Ubah konten di sini + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Penjelasan: -1. Inisialisasi Editor: Buat`Editor` contoh untuk spreadsheet. -2. Metode Edit: Telepon`Edit` untuk mendapatkan`EditableDocument`. -3. Dapatkan Konten: Ambil dan cetak konten. -4. Ubah Konten: Buat perubahan yang diperlukan. -5. Opsi Simpan: Tentukan opsi penyimpanan untuk spreadsheet. -6. Simpan Dokumen: Menyimpan dokumen yang dimodifikasi. +``` + +**Penjelasan:** +1. **Inisialisasi Editor:** Berikan path file spreadsheet ke konstruktor `Editor`. +2. **Metode Edit:** Dapatkan `EditableDocument`. +3. **Dapatkan Konten:** Cetak representasi CSV spreadsheet (atau HTML). +4. **Modifikasi Konten:** Terapkan perubahan pada tingkat sel yang diperlukan. +5. **Opsi Simpan:** Pilih `SpreadsheetSaveOptions` yang sesuai. +6. **Simpan Dokumen:** Tulis spreadsheet yang telah diperbarui kembali ke penyimpanan. + ### Mengedit Dokumen Presentasi +`PresentationSaveOptions` mengontrol format output untuk deck slide, memungkinkan Anda mempertahankan atau mengubah tipe file asli. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Ubah konten di sini + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Penjelasan: -1. Inisialisasi Editor: Buat`Editor` misalnya untuk presentasi. -2. Metode Edit: Telepon`Edit` untuk mendapatkan`EditableDocument`. -3. Dapatkan Konten: Ambil dan cetak konten. -4. Ubah Konten: Buat perubahan yang diperlukan. -5. Opsi Simpan: Tentukan opsi penyimpanan untuk presentasi. -6. Simpan Dokumen: Menyimpan dokumen yang dimodifikasi. +``` + +**Penjelasan:** +1. **Inisialisasi Editor:** Muat file PowerPoint melalui `Editor`. +2. **Metode Edit:** Peroleh `EditableDocument`. +3. **Dapatkan Konten:** Ekstrak HTML slide atau teks biasa. +4. **Modifikasi Konten:** Perbarui judul, poin bullet, atau gambar. +5. **Opsi Simpan:** Gunakan `PresentationSaveOptions` untuk menentukan format output. +6. **Simpan Dokumen:** Persist presentasi yang telah diedit. + +## Masalah Umum dan Solusinya +- **Kesalahan “Format not supported”:** Pastikan Anda menggunakan versi terbaru GroupDocs.Editor; versi terbaru secara rutin menambah dukungan untuk format Office yang lebih baru. +- **Konsumsi memori file besar:** Aktifkan mode streaming dengan mengatur `EditorSettings.EnableStreaming = true` sebelum memuat dokumen. +- **Lisensi tidak diterapkan:** Pastikan file lisensi sementara ditempatkan di root aplikasi atau dimuat via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Pertanyaan yang Sering Diajukan + +**Q: Apa perbedaan antara `DocumentFormatInfo` dan `SaveOptions`?** +**A:** `DocumentFormatInfo` memberikan metadata tentang tipe file yang didukung, sedangkan `SaveOptions` mengonfigurasi cara dokumen ditulis kembali ke disk (format, kompresi, dll.). + +**Q: Bisakah saya menampilkan format untuk ekstensi file khusus?** +**A:** Ya—gunakan `DocumentFormatInfo.FromExtension("yourExt")`; jika ekstensi tidak dikenali, metode akan mengembalikan `null`. + +**Q: Apakah GroupDocs.Editor mendukung file yang dilindungi kata sandi?** +**A:** Tentu saja. Berikan kata sandi ke konstruktor `Editor` melalui `EditorSettings` untuk membuka dokumen terenkripsi. + +**Q: Berapa banyak format yang sebenarnya didukung oleh GroupDocs.Editor?** +**A:** Lebih dari **30 format input dan output**, mencakup Word, Excel, PowerPoint, HTML, dan teks biasa. + +**Q: Apakah ada cara membatasi daftar hanya pada format yang dapat diedit?** +**A:** Gunakan `GetEditableWordProcessingFormats()` (atau setara Spreadsheet/Presentation) untuk mengambil format yang memungkinkan kemampuan edit penuh. + +## Sumber Daya Tambahan +- Unduh pustaka dari [halaman rilis GroupDocs](https://releases.groupdocs.com/editor/net/). +- Dapatkan [lisensi sementara](https://purchase.groupdocs.com/temporary-license/) untuk akses penuh fitur. +- Coba produk dengan [percobaan gratis](https://releases.groupdocs.com/). +- Jelajahi contoh penggunaan terperinci dalam [dokumentasi GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Dapatkan bantuan dari komunitas di [forum dukungan](https://forum.groupdocs.com/c/editor/20). + ## Kesimpulan -GroupDocs.Editor untuk .NET menyediakan cara yang kuat dan fleksibel untuk mengedit berbagai format dokumen secara terprogram. Dengan mengikuti panduan ini, Anda dapat secara efisien mengintegrasikan fungsi pengeditan dokumen ke dalam aplikasi .NET Anda, meningkatkan kemampuannya dan memberikan nilai lebih bagi pengguna Anda. -## FAQ -### Apa itu GroupDocs.Editor untuk .NET? -GroupDocs.Editor untuk .NET adalah perpustakaan canggih yang memungkinkan pengembang mengedit berbagai format dokumen secara terprogram dalam aplikasi .NET mereka. -### Bagaimana cara memulai GroupDocs.Editor untuk .NET? -Anda perlu mengunduh perpustakaan, mendapatkan lisensi sementara, dan menyiapkan lingkungan pengembangan Anda dengan namespace yang diperlukan. -### Format dokumen apa yang didukung? -GroupDocs.Editor antara lain mendukung format Pemrosesan Kata, Spreadsheet, Presentasi, dan Tekstual. -### Bisakah saya menggunakan GroupDocs.Editor secara gratis? - Anda dapat menggunakan a[uji coba gratis](https://releases.groupdocs.com/) dengan fitur terbatas atau dapatkan a[izin sementara](https://purchase.groupdocs.com/temporary-license/) untuk akses penuh. -### Di mana saya dapat menemukan lebih banyak sumber daya dan dukungan? - Mengunjungi[Dokumentasi GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) untuk informasi rinci, atau lihat mereka[forum dukungan](https://forum.groupdocs.com/c/editor/20) untuk bantuan. \ No newline at end of file +Dengan mengikuti panduan ini Anda kini tahu cara **menampilkan daftar format dokumen yang didukung**, **menentukan format file dari ekstensi**, dan **mengedit dokumen** di seluruh tipe Word, Spreadsheet, dan Presentation menggunakan GroupDocs.Editor untuk .NET. Integrasikan cuplikan kode ini ke dalam proyek Anda untuk membangun aplikasi yang sadar format, kuat, dan memberikan pengalaman pengguna yang mulus serta mengurangi kesalahan runtime. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## Tutorial Terkait + +- [Menguasai Pemuatan Dokumen di .NET dengan GroupDocs.Editor: Panduan Komprehensif](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Menguasai Pengeditan Dokumen di .NET dengan GroupDocs.Editor: Panduan Komprehensif](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Mengonversi Word ke HTML Menggunakan GroupDocs.Editor .NET: Panduan Langkah‑per‑Langkah](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/italian/net/document-processing/work-document-formats/_index.md b/content/italian/net/document-processing/work-document-formats/_index.md index 4c0489d4..f4826163 100644 --- a/content/italian/net/document-processing/work-document-formats/_index.md +++ b/content/italian/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Lavora con i formati di documento -linktitle: Lavora con i formati di documento -second_title: API GroupDocs.Editor .NET -description: Scopri come utilizzare GroupDocs.Editor for .NET per modificare vari formati di documenti a livello di codice. Guida passo passo con esempi per un'integrazione perfetta. -weight: 13 -url: /it/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Scopri come elencare i formati di documento supportati e determinare + l'estensione del formato file utilizzando GroupDocs.Editor per .NET. Guida step‑by‑step + con code snippets, quick answers e FAQs. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Elenca i formati di documento supportati +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Elenca i formati di documento supportati con GroupDocs.Editor .NET type: docs +url: /it/net/document-processing/work-document-formats/ +weight: 13 --- -# Lavora con i formati di documento -## introduzione -Benvenuti nella nostra guida approfondita sull'utilizzo di GroupDocs.Editor per .NET! Se sei uno sviluppatore che desidera migliorare le sue applicazioni con funzionalità di modifica dei documenti, sei nel posto giusto. Questo articolo ti guiderà attraverso tutto ciò che devi sapere, dai prerequisiti agli esempi pratici, per iniziare a utilizzare questa potente libreria. +# Elenco dei formati di documento supportati + +Benvenuti al nostro tutorial completo su **come elencare i formati di documento supportati** con GroupDocs.Editor per .NET. Che tu stia creando un'app web incentrata sui documenti o uno strumento desktop di livello enterprise, conoscere esattamente quali formati puoi modificare o convertire è fondamentale. In questa guida scoprirai come enumerare i formati, analizzare le estensioni e modificare i documenti—tutto con spiegazioni chiare e comprensibili e snippet di codice pronti da eseguire. + +## Risposte rapide +- **Come faccio a elencare tutti i formati supportati?** Usa `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (o gli equivalenti per Presentation/Spreadsheet) e itera la collezione. +- **Posso determinare un formato da un'estensione di file?** Sì—chiama `DocumentFormatInfo.FromExtension(".docx")`. +- **Quali tipi di file supporta GroupDocs.Editor?** Oltre 30 formati di input e output, inclusi DOCX, XLSX, PPTX, HTML e testo semplice. +- **È necessaria una licenza per elencare i formati?** Una licenza temporanea sblocca l'intera API; altrimenti una versione di prova funziona con funzionalità limitate. +- **Quali versioni .NET sono compatibili?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Cos'è “elencare i formati di documento supportati”? +La frase si riferisce al recupero programmatico della collezione di tipi di file che GroupDocs.Editor può aprire, modificare e salvare. Questa operazione ti consente di creare menu a discesa UI dinamici o di convalidare i caricamenti degli utenti prima dell'elaborazione, garantendo che solo i file compatibili vengano passati all'editor per ulteriori manipolazioni. + +## Perché elencare i formati di documento supportati? +GroupDocs.Editor **supporta oltre 30 formati di input e output** e può gestire file fino a **2 GB** senza caricare l'intero documento in memoria. Conoscere l'elenco esatto previene errori di runtime, migliora l'esperienza dell'utente e consente di applicare regole aziendali come “consentire solo documenti Office modificabili”. Aiuta inoltre a mostrare agli utenti solo i formati che la tua applicazione supporta realmente. + ## Prerequisiti -Prima di immergerci negli esempi e nelle funzionalità di GroupDocs.Editor per .NET, è necessario possedere alcuni prerequisiti: -1. Comprensione di base di .NET: la familiarità con .NET Framework o .NET Core è essenziale. -2. Ambiente di sviluppo: Visual Studio o qualsiasi altro IDE .NET adatto. -3. GroupDocs.Editor per .NET Library: scarica la libreria da[Pagina delle versioni di GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Licenza temporanea: ottenere a[licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per le funzionalità complete. -## Importa spazi dei nomi -Per iniziare con GroupDocs.Editor per .NET, devi importare gli spazi dei nomi necessari nel tuo progetto. Ciò ti garantirà l'accesso a tutte le classi e i metodi forniti dalla libreria. +Prima di iniziare, assicurati di avere: + +1. **Ambiente di sviluppo .NET** – Visual Studio 2022 o qualsiasi IDE che supporti .NET 6+. +2. **Libreria GroupDocs.Editor per .NET** – scarica dalla [pagina dei rilasci GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Licenza temporanea** – ottieni una [licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per accesso illimitato. +4. **Conoscenza di base di C#** – familiarità con i namespace, le istruzioni `using` e l'output della console. + +## Come elencare i formati di documento supportati? +Carica la collezione dei formati supportati e stampa il nome e l'estensione di ciascun formato. Questo modello a due passaggi funziona per documenti Word Processing, Spreadsheet e Presentation. Iterando la collezione puoi popolare dinamicamente elementi UI come menu a discesa, assicurando che gli utenti possano selezionare solo i formati che l'editor può effettivamente gestire. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Elencare i formati di Word Processing +`Formats.WordProcessingFormats` è un'enumerazione che descrive ogni tipo di file di elaborazione testi riconosciuto dall'editor. La proprietà `All` restituisce una collezione di questi oggetti formato. -## Passaggio 1: lavorare con i formati dei documenti -GroupDocs.Editor supporta un'ampia gamma di formati di documenti. Esploriamo come elencare tutti i formati di elaborazione testi e presentazioni supportati. -### Elenco dei formati di elaborazione testi +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Spiegazione: -1. Formati in loop: eseguiamo il loop in tutti i formati di elaborazione testi disponibili. -2. Dettagli sul formato di output: per ogni formato, stampiamo il nome e l'estensione. -### Elenco dei formati di presentazione +``` + +**Spiegazione:** +1. **Itera sui formati:** Iteriamo tutti i formati di elaborazione testi disponibili. +2. **Dettagli del formato di output:** Per ogni formato stampiamo il suo nome leggibile e l'estensione di file predefinita. + +### Elencare i formati di presentazione +`Formats.PresentationFormats` funziona allo stesso modo per i file di presentazione, esponendo ogni tipo di presentazione supportato tramite la collezione `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Spiegazione: -1. Formati in loop: analogamente ai formati di elaborazione testi, eseguiamo il loop in tutti i formati di presentazione. -2. Dettagli formato di output: stampa il nome e l'estensione di ciascun formato. -## Passaggio 2: analisi dei formati dalle estensioni -A volte è necessario determinare il formato in base all'estensione del file. GroupDocs.Editor rende tutto questo semplice. -### Analisi dei formati dei fogli di calcolo +``` + +**Spiegazione:** +1. **Itera sui formati:** Lo stesso ciclo si applica alle presentazioni. +2. **Dettagli del formato di output:** Il nome e l'estensione vengono visualizzati per ogni formato. + +## Come determinare l'estensione del formato di file? +A volte hai solo un nome file e devi dedurre il corrispondente `DocumentFormat`. GroupDocs.Editor offre un semplice helper statico che mappa un'estensione di file alla sua rappresentazione di formato interno, consentendoti di convalidare o convertire i file prima di caricarli nell'editor. + +### Analisi dei formati di foglio di calcolo +`Formats.SpreadsheetFormats.FromExtension` converte una stringa di estensione di file nel valore enum del formato di foglio di calcolo corrispondente. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Spiegazione: -1. Formato di analisi: utilizziamo il file`FromExtension` metodo per analizzare il formato dal file`.xlsm` estensione. -2. Formato di output: stampa il nome del formato analizzato. +``` + +**Spiegazione:** +1. **Analizza il formato:** `FromExtension` converte l'estensione `.xlsm` nel suo enum interno `SpreadsheetFormat`. +2. **Formato di output:** Il nome del formato analizzato viene stampato, confermando la mappatura. + ### Analisi dei formati testuali +Analogamente, `Formats.TextualFormats.FromExtension` risolve le estensioni di file testuali come HTML o TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Spiegazione: -1. Formato di analisi: The`FromExtension` viene utilizzato per analizzare il formato dal file`html` estensione. -2. Formato di output: stampa il nome del formato testuale analizzato. -## Passaggio 3: modifica dei documenti -Ora che abbiamo visto come lavorare con i formati, tuffiamoci nella modifica dei documenti utilizzando GroupDocs.Editor. +``` + +**Spiegazione:** +1. **Analizza il formato:** Il metodo `FromExtension` risolve l'estensione `html` in un `TextFormat`. +2. **Formato di output:** Il nome del formato testuale viene mostrato, utile per editor basati sul web. + +## Come modificare i documenti dopo aver identificato i formati? +Una volta conosciuto il formato, il caricamento e la modifica di un documento segue un modello coerente. Prima crei un'istanza di `Editor` con il percorso del file sorgente, poi chiami `Edit()` per ottenere un `EditableDocument`. Da lì puoi leggere, modificare e infine salvare il contenuto usando i `SaveOptions` appropriati. + ### Caricamento di un documento -Per modificare un documento, devi prima caricarlo. +`Editor` è la classe principale che incapsula tutte le operazioni di modifica per un determinato file. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Ulteriori passaggi verranno trattati qui. + // Further steps will be covered here. } ``` -Spiegazione: -1. Inizializza editor: crea un'istanza di`Editor` class, fornendo il percorso del documento. -2. Modello di smaltimento: utilizzare il`using` dichiarazione per garantire che le risorse siano smaltite correttamente. -### Estrazione del contenuto -Una volta caricato il documento, puoi estrarne il contenuto per modificarlo. +``` + +**Spiegazione:** +1. **Inizializza Editor:** Crea un'istanza di `Editor`, passando il percorso completo del file di destinazione. +2. **Pattern di dispose:** L'istruzione `using` garantisce che tutte le risorse non gestite vengano rilasciate prontamente. + +### Estrarre il contenuto +`EditableDocument.GetContent()` restituisce il testo grezzo del documento (o HTML per editor basati sul web), che puoi visualizzare o manipolare. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Spiegazione: -1. Metodo di modifica: chiama il`Edit` metodo per ottenere un`EditableDocument`. -2. Ottieni contenuto: usa`GetContent` per recuperare il contenuto del documento come una stringa. -3. Contenuto di output: stampa il contenuto sulla console. -### Salvataggio delle modifiche -Dopo la modifica, salva nuovamente le modifiche nel documento. +``` + +**Spiegazione:** +1. **Metodo Edit:** `Edit()` restituisce un oggetto `EditableDocument`. +2. **Ottieni contenuto:** `GetContent()` estrae il testo grezzo del documento (o HTML per editor basati sul web). +3. **Output del contenuto:** Il contenuto viene scritto sulla console per verifica. + +### Salvare le modifiche +`SaveOptions` indica all'editor come e in quale formato scrivere il documento modificato nuovamente nello storage. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Modifica il contenuto qui + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Spiegazione: -1. Metodo di modifica: chiama il`Edit` metodo per ottenere un`EditableDocument`. -2. Modifica contenuto: modifica il contenuto secondo necessità (non mostrato in questo snippet). -3. Opzioni di salvataggio: Crea`SaveOptions` specificando il formato. -4. Salva documento: utilizza il file`Save` metodo per salvare il documento modificato. -## Passaggio 4: lavorare con diversi tipi di documenti -GroupDocs.Editor supporta vari tipi di documenti. Ecco come lavorare con loro: -### Modifica di documenti di fogli di calcolo +``` + +**Spiegazione:** +1. **Metodo Edit:** Riottieni l'`EditableDocument` dopo le modifiche. +2. **Modifica contenuto:** Applica le tue modifiche alla stringa (non mostrato qui). +3. **Opzioni di salvataggio:** Configura `SaveOptions` con il formato di output desiderato. +4. **Salva documento:** Persiste il file modificato sul disco. + +## Come lavorare con diversi tipi di documento? +GroupDocs.Editor astrae la gestione di Word, Spreadsheet e Presentation dietro la stessa interfaccia API, rendendo facile cambiare contesto senza dover apprendere un nuovo set di classi per ogni famiglia di documenti. + +### Modifica di documenti Spreadsheet +`SpreadsheetSaveOptions` definisce come viene scritto un foglio di calcolo, includendo il formato e le impostazioni di compressione opzionali. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifica il contenuto qui + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Spiegazione: -1. Inizializza editor: crea un file`Editor` esempio per un foglio di calcolo. -2. Metodo di modifica: chiamata`Edit` per ottenere un`EditableDocument`. -3. Ottieni contenuto: recupera e stampa il contenuto. -4. Modifica contenuto: apporta le modifiche necessarie. -5. Opzioni di salvataggio: specifica le opzioni di salvataggio per i fogli di calcolo. -6. Salva documento: salva il documento modificato. -### Modifica di documenti di presentazione +``` + +**Spiegazione:** +1. **Inizializza Editor:** Passa il percorso di un file spreadsheet al costruttore `Editor`. +2. **Metodo Edit:** Recupera un `EditableDocument`. +3. **Ottieni contenuto:** Stampa la rappresentazione CSV del foglio di calcolo (o HTML). +4. **Modifica contenuto:** Applica le modifiche a livello di cella necessarie. +5. **Opzioni di salvataggio:** Scegli le `SpreadsheetSaveOptions` appropriate. +6. **Salva documento:** Scrivi il foglio di calcolo aggiornato nello storage. + +### Modifica di documenti Presentation +`PresentationSaveOptions` controlla il formato di output per le presentazioni, consentendoti di preservare o modificare il tipo di file originale. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifica il contenuto qui + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Spiegazione: -1. Inizializza editor: crea un file`Editor` esempio per una presentazione. -2. Metodo di modifica: chiamata`Edit` per ottenere un`EditableDocument`. -3. Ottieni contenuto: recupera e stampa il contenuto. -4. Modifica contenuto: apporta le modifiche necessarie. -5. Opzioni di salvataggio: specifica le opzioni di salvataggio per le presentazioni. -6. Salva documento: salva il documento modificato. -## Conclusione -GroupDocs.Editor per .NET fornisce un modo affidabile e flessibile per modificare vari formati di documenti a livello di codice. Seguendo questa guida, puoi integrare in modo efficiente le funzionalità di modifica dei documenti nelle tue applicazioni .NET, migliorandone le capacità e fornendo maggiore valore ai tuoi utenti. +``` + +**Spiegazione:** +1. **Inizializza Editor:** Carica un file PowerPoint tramite `Editor`. +2. **Metodo Edit:** Ottieni un `EditableDocument`. +3. **Ottieni contenuto:** Estrai l'HTML delle diapositive o il testo semplice. +4. **Modifica contenuto:** Aggiorna titoli, punti elenco o immagini. +5. **Opzioni di salvataggio:** Usa `PresentationSaveOptions` per definire il formato di output. +6. **Salva documento:** Persiste la presentazione modificata. + +## Problemi comuni e soluzioni +- **Errore “Formato non supportato”**: Verifica di utilizzare l'ultima versione di GroupDocs.Editor; aggiunge regolarmente il supporto per i nuovi formati Office. +- **Consumo di memoria per file grandi**: Abilita la modalità streaming impostando `EditorSettings.EnableStreaming = true` prima di caricare il documento. +- **Licenza non applicata**: Assicurati che il file di licenza temporanea sia posizionato nella radice dell'applicazione o caricato tramite `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## Domande frequenti -### Cos'è GroupDocs.Editor per .NET? -GroupDocs.Editor per .NET è una potente libreria che consente agli sviluppatori di modificare vari formati di documenti a livello di codice all'interno delle loro applicazioni .NET. -### Come posso iniziare con GroupDocs.Editor per .NET? -Devi scaricare la libreria, ottenere una licenza temporanea e configurare il tuo ambiente di sviluppo con gli spazi dei nomi necessari. -### Quali formati di documenti sono supportati? -GroupDocs.Editor supporta, tra gli altri, i formati di elaborazione testi, fogli di calcolo, presentazioni e testi. -### Posso utilizzare GroupDocs.Editor gratuitamente? - Puoi usare a[prova gratuita](https://releases.groupdocs.com/) con funzionalità limitate o ottenere a[licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per l'accesso completo. -### Dove posso trovare più risorse e supporto? - Visitare il[Documentazione di GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) per informazioni dettagliate o dai un'occhiata al loro[Forum di assistenza](https://forum.groupdocs.com/c/editor/20) per un aiuto. \ No newline at end of file + +**D: Qual è la differenza tra `DocumentFormatInfo` e `SaveOptions`?** +R: `DocumentFormatInfo` fornisce metadati sui tipi di file supportati, mentre `SaveOptions` configura come un documento viene scritto nuovamente su disco (formato, compressione, ecc.). + +**D: Posso elencare i formati per un'estensione di file personalizzata?** +R: Sì—usa `DocumentFormatInfo.FromExtension("yourExt")`; se l'estensione non è riconosciuta, il metodo restituisce `null`. + +**D: GroupDocs.Editor supporta file protetti da password?** +R: Assolutamente. Passa la password al costruttore `Editor` tramite `EditorSettings` per aprire documenti crittografati. + +**D: Quanti formati supporta effettivamente GroupDocs.Editor?** +R: Oltre **30 formati di input e output**, che includono Word, Excel, PowerPoint, HTML e testo semplice. + +**D: Esiste un modo per limitare l'elenco solo ai formati modificabili?** +R: Usa `GetEditableWordProcessingFormats()` (o gli equivalenti per Spreadsheet/Presentation) per recuperare i formati che consentono piena capacità di modifica. + +## Risorse aggiuntive +- Scarica la libreria dalla [pagina dei rilasci GroupDocs](https://releases.groupdocs.com/editor/net/). +- Ottieni una [licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per l'accesso a tutte le funzionalità. +- Prova il prodotto con una [prova gratuita](https://releases.groupdocs.com/). +- Esplora esempi di utilizzo dettagliati nella [documentazione GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Ottieni aiuto dalla community sul [forum di supporto](https://forum.groupdocs.com/c/editor/20). + +## Conclusione +Seguendo questa guida ora sai come **elencare i formati di documento supportati**, **determinare un formato di file dalla sua estensione** e **modificare i documenti** nei tipi Word, Spreadsheet e Presentation usando GroupDocs.Editor per .NET. Integra questi snippet nei tuoi progetti per costruire applicazioni robuste, consapevoli dei formati, che deliziano gli utenti finali e riducono gli errori di runtime. + +--- + +**Ultimo aggiornamento:** 2026-06-06 +**Testato con:** GroupDocs.Editor 23.9 per .NET +**Autore:** GroupDocs + +## Tutorial correlati + +- [Padronanza del caricamento di documenti in .NET con GroupDocs.Editor: Guida completa](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Master Editing di documenti in .NET con GroupDocs.Editor: Guida completa](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Converti Word in HTML usando GroupDocs.Editor .NET: Guida passo‑passo](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/japanese/net/document-processing/work-document-formats/_index.md b/content/japanese/net/document-processing/work-document-formats/_index.md index a7662de0..9e0ed47d 100644 --- a/content/japanese/net/document-processing/work-document-formats/_index.md +++ b/content/japanese/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,213 @@ --- -title: ドキュメント形式の操作 -linktitle: ドキュメント形式の操作 +date: 2026-06-06 +description: GroupDocs.Editor for .NET を使用して、サポートされているドキュメント形式を一覧表示し、ファイル形式の拡張子を判定する方法を学びます。ステップバイステップガイドで、code + snippets、quick answers、FAQs を含みます。 +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: サポートされているドキュメント形式の一覧 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: GroupDocs.Editor for .NET を使用してさまざまなドキュメント形式をプログラムで編集する方法を学びます。シームレスな統合のための例を説明したステップバイステップ ガイドです。 -weight: 13 -url: /ja/net/document-processing/work-document-formats/ +title: GroupDocs.Editor .NET でサポートされているドキュメント形式の一覧 type: docs +url: /ja/net/document-processing/work-document-formats/ +weight: 13 --- -# ドキュメント形式の操作 -## 導入 -GroupDocs.Editor for .NET の使用に関する詳細なガイドへようこそ。ドキュメント編集機能を使用してアプリケーションを強化したい開発者にとって、これは最適な場所です。この記事では、前提条件から実際の例まで、この強力なライブラリを使い始めるために必要なすべてのことを説明します。 +# サポートされているドキュメント形式の一覧 + +GroupDocs.Editor for .NET を使用した **サポートされているドキュメント形式の一覧方法** に関する包括的なチュートリアルへようこそ。ドキュメント中心の Web アプリやエンタープライズ向けデスクトップツールを構築する場合でも、編集または変換できる形式を正確に把握しておくことは不可欠です。このガイドでは、形式を列挙し、拡張子を解析し、ドキュメントを編集する方法を学びます—すべて分かりやすい説明とすぐに実行できるコードスニペット付きです。 + +## クイック回答 +- **すべてのサポートされている形式を一覧表示するには?** `DocumentFormatInfo.GetSupportedWordProcessingFormats()`(または Presentation/Spreadsheet の同等メソッド)を使用し、コレクションを反復処理します。 +- **ファイル拡張子から形式を判定できますか?** はい、`DocumentFormatInfo.FromExtension(".docx")` を呼び出します。 +- **GroupDocs.Editor がサポートするファイルタイプは何ですか?** DOCX、XLSX、PPTX、HTML、プレーンテキストなど、30 以上の入力および出力形式をサポートしています。 +- **形式を一覧表示するのにライセンスは必要ですか?** 一時ライセンスを使用するとフル API が利用可能になります。ライセンスがない場合は、機能が制限されたトライアルが動作します。 +- **対応している .NET バージョンはどれですか?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## 「サポートされているドキュメント形式の一覧」とは何ですか? +このフレーズは、GroupDocs.Editor が開く、編集する、保存できるファイルタイプのコレクションをプログラムで取得することを指します。この操作により、動的な UI ドロップダウンを構築したり、処理前にユーザーのアップロードを検証したりでき、互換性のあるファイルのみがエディタに渡されてさらに操作できるようになります。 + +## サポートされているドキュメント形式を一覧表示する理由は何ですか? +GroupDocs.Editor は **30 以上の入力および出力形式** をサポートし、**2 GB** までのファイルをメモリに全文読み込まずに処理できます。正確な一覧を把握することで、実行時エラーを防止し、ユーザーエクスペリエンスを向上させ、「編集可能な Office ドキュメントのみを許可する」などのビジネスルールを適用できます。また、アプリケーションが実際にサポートする形式だけをユーザーに提示するのにも役立ちます。 + ## 前提条件 -GroupDocs.Editor for .NET の例と機能について詳しく説明する前に、いくつかの前提条件を満たす必要があります。 -1. .NET の基本的な理解: .NET Framework または .NET Core に精通していることが必須です。 -2. 開発環境: Visual Studio またはその他の適切な .NET IDE。 -3. GroupDocs.Editor for .NETライブラリ:ライブラリを以下からダウンロードしてください。[GroupDocs リリースページ](https://releases.groupdocs.com/editor/net/). -4. 一時ライセンス:取得[一時ライセンス](https://purchase.groupdocs.com/temporary-license/)完全な機能についてはこちらをご覧ください。 -## 名前空間のインポート -GroupDocs.Editor for .NET を使い始めるには、必要な名前空間をプロジェクトにインポートする必要があります。これにより、ライブラリによって提供されるすべてのクラスとメソッドにアクセスできるようになります。 +開始する前に、以下が揃っていることを確認してください: + +1. **.NET 開発環境** – Visual Studio 2022 または .NET 6+ をサポートする任意の IDE。 +2. **GroupDocs.Editor for .NET ライブラリ** – [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) からダウンロードしてください。 +3. **一時ライセンス** – 無制限にアクセスできるように、[temporary license](https://purchase.groupdocs.com/temporary-license/) を取得してください。 +4. **基本的な C# の知識** – 名前空間、`using` ステートメント、コンソール出力に慣れていること。 + +## サポートされているドキュメント形式を一覧表示する方法は? +サポートされている形式のコレクションをロードし、各形式の名前とファイル拡張子を出力します。この 2 段階パターンは Word Processing、Spreadsheet、Presentation のドキュメントで機能します。コレクションを反復処理することで、ドロップダウンなどの UI 要素を動的に生成でき、ユーザーがエディタで実際に扱える形式のみを選択できるようにします。 + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Word Processing 形式の一覧表示 +`Formats.WordProcessingFormats` は、エディタが認識するすべての Word 処理ファイルタイプを表す列挙型です。`All` プロパティはこれらの形式オブジェクトのコレクションを返します。 -## ステップ 1: ドキュメント形式の操作 -GroupDocs.Editor は、幅広いドキュメント形式をサポートしています。サポートされているすべてのワードプロセッサおよびプレゼンテーション形式を一覧表示する方法を見てみましょう。 -### ワードプロセッサ形式の一覧 +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -説明: -1. フォーマットのループ: 使用可能なすべてのワード プロセッシング フォーマットをループします。 -2. 出力形式の詳細: 形式ごとに、名前と拡張子を出力します。 -### プレゼンテーション形式の一覧 +``` + +**説明:** +1. **形式のループ:** 利用可能なすべての Word 処理形式を反復処理します。 +2. **形式の詳細出力:** 各形式について、フレンドリーネームとデフォルトのファイル拡張子を出力します。 + +### プレゼンテーション形式の一覧表示 +`Formats.PresentationFormats` はスライドデックファイルに対して同様に機能し、`All` コレクションを通じてサポートされる各プレゼンテーションタイプを公開します。 + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -説明: -1. フォーマットのループ: ワード プロセッシング フォーマットと同様に、すべてのプレゼンテーション フォーマットをループします。 -2. 出力形式の詳細: 各形式の名前と拡張子を出力します。 -## ステップ2: 拡張子からフォーマットを解析する -場合によっては、ファイル拡張子に基づいて形式を決定する必要があります。GroupDocs.Editor を使用すると、これが簡単に行えます。 +``` + +**説明:** +1. **形式のループ:** プレゼンテーションにも同じループロジックが適用されます。 +2. **形式の詳細出力:** 各形式の名前と拡張子が表示されます。 + +## ファイル形式の拡張子を判定する方法は? +時にはファイル名だけがあり、対応する `DocumentFormat` を推測する必要があります。GroupDocs.Editor は、ファイル拡張子を内部の形式表現にマッピングするシンプルな静的ヘルパーを提供しており、エディタにロードする前にファイルの検証や変換が可能です。 + ### スプレッドシート形式の解析 +`Formats.SpreadsheetFormats.FromExtension` は、ファイル拡張子文字列を対応するスプレッドシート形式の列挙値に変換します。 + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -説明: -1. 解析フォーマット:`FromExtension`フォーマットを解析する方法`.xlsm`拡大。 -2. 出力形式: 解析された形式の名前を出力します。 +``` + +**説明:** +1. **形式の解析:** `FromExtension` は `.xlsm` 拡張子を内部の `SpreadsheetFormat` 列挙型に変換します。 +2. **形式の出力:** 解析された形式の名前が出力され、マッピングが確認できます。 + ### テキスト形式の解析 +同様に、`Formats.TextualFormats.FromExtension` は HTML や TXT などのテキストファイル拡張子を解決します。 + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -説明: -1. 解析フォーマット:`FromExtension`メソッドは、`html`拡大。 -2. 出力形式: 解析されたテキスト形式の名前を出力します。 -## ステップ3: ドキュメントの編集 -フォーマットの操作方法を説明したので、GroupDocs.Editor を使用してドキュメントを編集してみましょう。 -### ドキュメントの読み込み -ドキュメントを編集するには、まずそれを読み込む必要があります。 +``` + +**説明:** +1. **形式の解析:** `FromExtension` メソッドは `html` 拡張子を `TextFormat` に解決します。 +2. **形式の出力:** テキスト形式の名前が表示され、Web ベースのエディタで役立ちます。 + +## 形式を特定した後にドキュメントを編集する方法は? +形式が分かれば、ドキュメントのロードと編集は一貫したパターンで行えます。まず、ソースファイルへのパスで `Editor` インスタンスを作成し、`Edit()` を呼び出して `EditableDocument` を取得します。その後、適切な `SaveOptions` を使用して内容を読み取り、変更し、最終的に保存できます。 + +### ドキュメントのロード +`Editor` は、特定のファイルに対するすべての編集操作をカプセル化するコアクラスです。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - //以降の手順についてはここで説明します。 + // Further steps will be covered here. } ``` -説明: -1. エディタの初期化: インスタンスを作成する`Editor`クラスはドキュメントへのパスを提供します。 -2. 破棄パターン:`using`リソースが適切に廃棄されることを保証するための声明。 +``` + +**説明:** +1. **エディタの初期化:** ターゲットファイルのフルパスを渡して `Editor` インスタンスを作成します。 +2. **Dispose パターン:** `using` ステートメントにより、すべてのアンマネージドリソースが速やかに解放されます。 + ### コンテンツの抽出 -ドキュメントが読み込まれたら、そのコンテンツを抽出して編集できます。 +`EditableDocument.GetContent()` は、ドキュメントの生テキスト(Web ベースエディタの場合は HTML)を返し、表示または操作できます。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +215,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -説明: -1. 編集方法: 呼び出し`Edit`取得する方法`EditableDocument`. -2. コンテンツを取得: 使用`GetContent`ドキュメントのコンテンツを文字列として取得します。 -3. 出力コンテンツ: コンテンツをコンソールに出力します。 -### 変更を保存 -編集後、変更内容をドキュメントに保存します。 +``` + +**説明:** +1. **Edit メソッド:** `Edit()` は `EditableDocument` オブジェクトを返します。 +2. **コンテンツ取得:** `GetContent()` はドキュメントの生テキスト(または Web ベースエディタの場合は HTML)を抽出します。 +3. **コンテンツ出力:** コンテンツがコンソールに書き出され、検証できます。 + +### 変更の保存 +`SaveOptions` は、編集されたドキュメントをどのように、どの形式でストレージに書き戻すかをエディタに指示します。 + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - //ここでコンテンツを変更する + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -説明: -1. 編集方法: 呼び出し`Edit`取得する方法`EditableDocument`. -2. コンテンツの変更: 必要に応じてコンテンツを変更します (このスニペットには表示されていません)。 -3. 保存オプション: 作成`SaveOptions`フォーマットを指定します。 -4. ドキュメントを保存:`Save`編集したドキュメントを保存する方法。 -## ステップ4: さまざまなドキュメントタイプを操作する -GroupDocs.Editor はさまざまなドキュメント タイプをサポートしています。操作方法は次のとおりです。 +``` + +**説明:** +1. **Edit メソッド:** 変更後に `EditableDocument` を再取得します。 +2. **コンテンツの変更:** 文字列に変更を適用します(ここでは省略)。 +3. **保存オプション:** 希望する出力形式で `SaveOptions` を設定します。 +4. **ドキュメントの保存:** 編集されたファイルをディスクに保存します。 + +## 異なるドキュメントタイプを扱う方法は? +GroupDocs.Editor は、Word、Spreadsheet、Presentation の取り扱いを同一 API で抽象化しているため、各ドキュメントファミリごとに新しいクラスを学習することなく、コンテキストを簡単に切り替えられます。 + ### スプレッドシートドキュメントの編集 +`SpreadsheetSaveOptions` は、スプレッドシートの書き込み方法(形式やオプションの圧縮設定など)を定義します。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +256,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //ここでコンテンツを変更する + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -説明: -1. エディターの初期化:`Editor`スプレッドシートのインスタンス。 -2. 編集方法: 呼び出し`Edit`取得する`EditableDocument`. -3. コンテンツの取得: コンテンツを取得して印刷します。 -4. コンテンツの変更: 必要な変更を加えます。 -5. 保存オプション: スプレッドシートの保存オプションを指定します。 -6. ドキュメントを保存: 変更したドキュメントを保存します。 -### プレゼンテーション文書の編集 +``` + +**説明:** +1. **エディタの初期化:** スプレッドシートファイルのパスを `Editor` コンストラクタに渡します。 +2. **Edit メソッド:** `EditableDocument` を取得します。 +3. **コンテンツ取得:** スプレッドシートの CSV 表現(または HTML)を出力します。 +4. **コンテンツの変更:** 必要なセルレベルの変更を適用します。 +5. **保存オプション:** 適切な `SpreadsheetSaveOptions` を選択します。 +6. **ドキュメントの保存:** 更新されたスプレッドシートをストレージに書き戻します。 + +### プレゼンテーションドキュメントの編集 +`PresentationSaveOptions` はスライドデックの出力形式を制御し、元のファイルタイプを保持したり変更したりできます。 + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +283,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - //ここでコンテンツを変更する + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -説明: -1. エディターの初期化:`Editor`プレゼンテーションのインスタンス。 -2. 編集方法: 呼び出し`Edit`取得する`EditableDocument`. -3. コンテンツの取得: コンテンツを取得して印刷します。 -4. コンテンツの変更: 必要な変更を加えます。 -5. 保存オプション: プレゼンテーションの保存オプションを指定します。 -6. ドキュメントを保存: 変更したドキュメントを保存します。 -## 結論 -GroupDocs.Editor for .NET は、さまざまなドキュメント形式をプログラムで編集するための堅牢かつ柔軟な方法を提供します。このガイドに従うことで、ドキュメント編集機能を .NET アプリケーションに効率的に統合し、その機能を強化してユーザーにさらに大きな価値を提供できます。 +``` + +**説明:** +1. **エディタの初期化:** `Editor` を使用して PowerPoint ファイルをロードします。 +2. **Edit メソッド:** `EditableDocument` を取得します。 +3. **コンテンツ取得:** スライドの HTML またはプレーンテキストを抽出します。 +4. **コンテンツの変更:** タイトル、箇条書き、画像などを更新します。 +5. **保存オプション:** `PresentationSaveOptions` を使用して出力形式を定義します。 +6. **ドキュメントの保存:** 編集されたプレゼンテーションを保存します。 + +## 一般的な問題と解決策 +- **“Format not supported” エラー:** 最新の GroupDocs.Editor バージョンを使用しているか確認してください。新しい Office 形式のサポートが定期的に追加されます。 +- **大きなファイルのメモリ消費:** ドキュメントをロードする前に `EditorSettings.EnableStreaming = true` を設定してストリーミングモードを有効にします。 +- **ライセンスが適用されていない:** 一時ライセンスファイルがアプリケーションのルートに配置されているか、`License license = new License(); license.SetLicense("path/to/license.lic");` でロードされていることを確認してください。 + ## よくある質問 -### GroupDocs.Editor for .NET とは何ですか? -GroupDocs.Editor for .NET は、開発者が .NET アプリケーション内でさまざまなドキュメント形式をプログラム的に編集できるようにする強力なライブラリです。 -### GroupDocs.Editor for .NET を使い始めるにはどうすればよいですか? -ライブラリをダウンロードし、一時ライセンスを取得し、必要な名前空間を使用して開発環境を設定する必要があります。 -### どのようなドキュメント形式がサポートされていますか? -GroupDocs.Editor は、ワードプロセッシング、スプレッドシート、プレゼンテーション、テキスト形式などをサポートしています。 -### GroupDocs.Editor は無料で使用できますか? -あなたは[無料トライアル](https://releases.groupdocs.com/)機能が制限された[一時ライセンス](https://purchase.groupdocs.com/temporary-license/)フルアクセス。 -### より多くのリソースとサポートはどこで見つかりますか? -訪問[GroupDocs.Editor ドキュメント](https://tutorials.groupdocs.com/editor/net/)詳しい情報はこちら、または[サポートフォーラム](https://forum.groupdocs.com/c/editor/20)助けを求めて。 \ No newline at end of file +**Q: `DocumentFormatInfo` と `SaveOptions` の違いは何ですか?** +**A:** `DocumentFormatInfo` はサポートされているファイルタイプのメタデータを提供し、`SaveOptions` はドキュメントをディスクに書き戻す方法(形式、圧縮など)を構成します。 + +**Q: カスタムファイル拡張子の形式を一覧表示できますか?** +**A:** はい、`DocumentFormatInfo.FromExtension("yourExt")` を使用します。拡張子が認識されない場合、メソッドは `null` を返します。 + +**Q: GroupDocs.Editor はパスワードで保護されたファイルをサポートしていますか?** +**A:** もちろんです。`EditorSettings` を介してパスワードを `Editor` コンストラクタに渡すことで、暗号化されたドキュメントを開くことができます。 + +**Q: GroupDocs.Editor は実際に何種類の形式をサポートしていますか?** +**A:** 30 以上の入力および出力形式をサポートしており、Word、Excel、PowerPoint、HTML、プレーンテキストにまたがります。 + +**Q: 編集可能な形式だけに一覧を絞る方法はありますか?** +**A:** `GetEditableWordProcessingFormats()`(または Spreadsheet/Presentation の同等メソッド)を使用して、完全な編集機能が可能な形式だけを取得します。 + +## 追加リソース +- [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) からライブラリをダウンロードしてください。 +- フル機能にアクセスするには、[temporary license](https://purchase.groupdocs.com/temporary-license/) を取得してください。 +- [free trial](https://releases.groupdocs.com/) で製品をお試しください。 +- [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/) で詳細な使用例を確認してください。 +- [support forum](https://forum.groupdocs.com/c/editor/20) でコミュニティからサポートを受け取れます。 + +## 結論 +このガイドに従うことで、**サポートされているドキュメント形式の一覧表示**、**拡張子からファイル形式を判定**、および **Word、Spreadsheet、Presentation の各タイプのドキュメントを編集** する方法が分かります。これらのスニペットをプロジェクトに組み込むことで、エンドユーザーに喜ばれ、実行時エラーを減らす、堅牢で形式に対応したアプリケーションを構築できます。 + +--- + +**最終更新日:** 2026-06-06 +**テスト環境:** GroupDocs.Editor 23.9 for .NET +**作者:** GroupDocs + +## 関連チュートリアル +- [GroupDocs.Editor を使用した .NET のドキュメントロードのマスタリング:包括的ガイド](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [GroupDocs.Editor を使用した .NET のマスタードキュメント編集:包括的ガイド](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [GroupDocs.Editor .NET を使用した Word から HTML への変換:ステップバイステップガイド](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/korean/net/document-processing/work-document-formats/_index.md b/content/korean/net/document-processing/work-document-formats/_index.md index 2292640a..bb0f5237 100644 --- a/content/korean/net/document-processing/work-document-formats/_index.md +++ b/content/korean/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,213 @@ --- -title: 문서 형식 작업 -linktitle: 문서 형식 작업 +date: 2026-06-06 +description: GroupDocs.Editor for .NET를 사용하여 지원되는 문서 형식을 나열하고 파일 형식 확장자를 확인하는 방법을 + 배웁니다. 코드 스니펫, 빠른 답변 및 FAQ가 포함된 단계별 가이드. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: 지원되는 문서 형식 나열 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: .NET용 GroupDocs.Editor를 사용하여 다양한 문서 형식을 프로그래밍 방식으로 편집하는 방법을 알아보세요. 원활한 통합을 위한 예시가 포함된 단계별 가이드입니다. -weight: 13 -url: /ko/net/document-processing/work-document-formats/ +title: GroupDocs.Editor .NET를 사용하여 지원되는 문서 형식 나열 type: docs +url: /ko/net/document-processing/work-document-formats/ +weight: 13 --- -# 문서 형식 작업 - -## 소개 -.NET용 GroupDocs.Editor 사용에 대한 심층 가이드에 오신 것을 환영합니다! 문서 편집 기능으로 애플리케이션을 향상시키려는 개발자라면 잘 찾아오셨습니다. 이 문서에서는 이 강력한 라이브러리를 시작하고 실행하는 데 필요한 전제 조건부터 실제 예제까지 알아야 할 모든 것을 안내합니다. -## 전제조건 -.NET용 GroupDocs.Editor의 예제와 기능을 살펴보기 전에 준비해야 할 몇 가지 전제 조건이 있습니다. -1. .NET에 대한 기본 이해: .NET Framework 또는 .NET Core에 대한 지식이 필수적입니다. -2. 개발 환경: Visual Studio 또는 기타 적합한 .NET IDE. -3. .NET 라이브러리용 GroupDocs.Editor: 다음에서 라이브러리를 다운로드하세요.[GroupDocs 릴리스 페이지](https://releases.groupdocs.com/editor/net/). -4. 임시 면허 취득:[임시면허](https://purchase.groupdocs.com/temporary-license/) 완전한 기능을 위해. -## 네임스페이스 가져오기 -.NET용 GroupDocs.Editor를 시작하려면 필요한 네임스페이스를 프로젝트로 가져와야 합니다. 이렇게 하면 라이브러리에서 제공하는 모든 클래스와 메서드에 액세스할 수 있습니다. + +# 지원되는 문서 형식 나열 + +GroupDocs.Editor for .NET와 함께 **지원되는 문서 형식을 나열하는 방법**에 대한 포괄적인 튜토리얼에 오신 것을 환영합니다. 문서 중심의 웹 앱을 구축하든 엔터프라이즈급 데스크톱 도구를 만들든, 편집하거나 변환할 수 있는 형식을 정확히 아는 것이 필수적입니다. 이 가이드에서는 형식을 열거하고, 확장자를 파싱하며, 문서를 편집하는 방법을 알아볼 수 있습니다—명확하고 이해하기 쉬운 설명과 바로 실행 가능한 코드 스니펫을 제공합니다. + +## 빠른 답변 +- **모든 지원 형식을 어떻게 나열합니까?** `DocumentFormatInfo.GetSupportedWordProcessingFormats()`(또는 Presentation/Spreadsheet 동등 메서드)를 사용하고 컬렉션을 반복합니다. +- **파일 확장자에서 형식을 결정할 수 있나요?** 예—`DocumentFormatInfo.FromExtension(".docx")`를 호출합니다. +- **GroupDocs.Editor가 지원하는 파일 유형은 무엇인가요?** DOCX, XLSX, PPTX, HTML, 일반 텍스트 등을 포함한 30개 이상의 입력 및 출력 형식이 있습니다. +- **형식을 나열하려면 라이선스가 필요합니까?** 임시 라이선스를 사용하면 전체 API가 해제됩니다; 그렇지 않으면 제한된 기능으로 체험판을 사용할 수 있습니다. +- **호환되는 .NET 버전은 무엇인가요?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## “지원되는 문서 형식 나열”이란 무엇인가요? +이 문구는 GroupDocs.Editor가 열고, 편집하고, 저장할 수 있는 파일 유형 컬렉션을 프로그래밍 방식으로 가져오는 것을 의미합니다. 이 작업을 통해 동적 UI 드롭다운을 만들거나 처리 전에 사용자 업로드를 검증하여 호환 가능한 파일만 편집기로 전달되도록 할 수 있습니다. + +## 지원되는 문서 형식을 나열해야 하는 이유는 무엇인가요? +GroupDocs.Editor는 **30개 이상의 입력 및 출력 형식**을 지원하며 전체 문서를 메모리에 로드하지 않고 **2 GB**까지의 파일을 처리할 수 있습니다. 정확한 목록을 알면 런타임 오류를 방지하고 사용자 경험을 향상시키며 “편집 가능한 Office 문서만 허용”과 같은 비즈니스 규칙을 적용할 수 있습니다. 또한 애플리케이션이 실제로 지원하는 형식만 사용자에게 표시하는 데 도움이 됩니다. + +## 사전 요구 사항 +시작하기 전에 다음을 확인하십시오: + +1. **.NET 개발 환경** – Visual Studio 2022 또는 .NET 6+를 지원하는 모든 IDE. +2. **GroupDocs.Editor for .NET 라이브러리** – [GroupDocs releases page](https://releases.groupdocs.com/editor/net/)에서 다운로드합니다. +3. **임시 라이선스** – 제한 없는 접근을 위해 [temporary license](https://purchase.groupdocs.com/temporary-license/)를 획득합니다. +4. **기본 C# 지식** – 네임스페이스, `using` 구문, 콘솔 출력에 익숙함. + +## 지원되는 문서 형식을 나열하는 방법은? +지원되는 형식 컬렉션을 로드하고 각 형식의 이름과 파일 확장자를 출력합니다. 이 두 단계 패턴은 워드 프로세싱, 스프레드시트, 프레젠테이션 문서에 모두 적용됩니다. 컬렉션을 반복함으로써 드롭다운과 같은 UI 요소를 동적으로 채울 수 있어 사용자가 편집기가 실제로 처리할 수 있는 형식만 선택하도록 보장합니다. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## 1단계: 문서 형식 작업 -GroupDocs.Editor는 다양한 문서 형식을 지원합니다. 지원되는 모든 워드 프로세싱 및 프레젠테이션 형식을 나열하는 방법을 살펴보겠습니다. ### 워드 프로세싱 형식 나열 +`Formats.WordProcessingFormats`는 편집기가 인식하는 모든 워드 프로세싱 파일 유형을 설명하는 열거형입니다. `All` 속성은 이러한 형식 객체들의 컬렉션을 반환합니다. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -설명: -1. 루프 스루 형식: 사용 가능한 모든 워드 프로세싱 형식을 반복합니다. -2. 출력 형식 세부 정보: 각 형식에 대해 해당 이름과 확장자를 인쇄합니다. -### 프리젠테이션 형식 나열 +``` + +**설명:** +1. **형식 반복:** 사용 가능한 모든 워드 프로세싱 형식을 반복합니다. +2. **형식 세부 정보 출력:** 각 형식에 대해 친숙한 이름과 기본 파일 확장자를 출력합니다. + +### 프레젠테이션 형식 나열 +`Formats.PresentationFormats`는 슬라이드 파일에 대해 동일하게 작동하며, `All` 컬렉션을 통해 지원되는 각 프레젠테이션 유형을 노출합니다. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -설명: -1. 루프 스루 형식: 워드 프로세싱 형식과 유사하게 모든 프레젠테이션 형식을 반복합니다. -2. 출력 형식 세부 정보: 각 형식의 이름과 확장자를 인쇄합니다. -## 2단계: 확장에서 형식 구문 분석 -때로는 파일 확장자를 기준으로 형식을 결정해야 하는 경우도 있습니다. GroupDocs.Editor를 사용하면 이 작업이 쉬워집니다. -### 스프레드시트 형식 구문 분석 +``` + +**설명:** +1. **형식 반복:** 프레젠테이션에도 동일한 반복 로직이 적용됩니다. +2. **형식 세부 정보 출력:** 각 형식의 이름과 확장자가 표시됩니다. + +## 파일 형식 확장자를 결정하는 방법은? +때때로 파일 이름만 가지고 해당 `DocumentFormat`을 추론해야 할 때가 있습니다. GroupDocs.Editor는 파일 확장자를 내부 형식 표현에 매핑하는 간단한 정적 헬퍼를 제공하여, 편집기에 로드하기 전에 파일을 검증하거나 변환할 수 있게 합니다. + +### 스프레드시트 형식 파싱 +`Formats.SpreadsheetFormats.FromExtension`은 파일 확장자 문자열을 해당 스프레드시트 형식 열거값으로 변환합니다. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -설명: -1. 구문 분석 형식: 우리는`FromExtension` 형식을 구문 분석하는 방법`.xlsm` 확대. -2. 출력 형식: 구문 분석된 형식의 이름을 인쇄합니다. -### 텍스트 형식 구문 분석 +``` + +**설명:** +1. **형식 파싱:** `FromExtension`은 `.xlsm` 확장자를 내부 `SpreadsheetFormat` 열거형으로 변환합니다. +2. **형식 출력:** 파싱된 형식의 이름이 출력되어 매핑을 확인합니다. + +### 텍스트 형식 파싱 +마찬가지로, `Formats.TextualFormats.FromExtension`은 HTML이나 TXT와 같은 텍스트 파일 확장자를 해결합니다. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -설명: -1. 구문 분석 형식:`FromExtension` 메서드는 형식을 구문 분석하는 데 사용됩니다.`html` 확대. -2. 출력 형식: 구문 분석된 텍스트 형식의 이름을 인쇄합니다. -## 3단계: 문서 편집하기 -이제 형식 작업 방법을 살펴보았으므로 GroupDocs.Editor를 사용하여 문서를 편집하는 방법을 살펴보겠습니다. +``` + +**설명:** +1. **형식 파싱:** `FromExtension` 메서드는 `html` 확장자를 `TextFormat`으로 해결합니다. +2. **형식 출력:** 텍스트 형식의 이름이 표시되어 웹 기반 편집기에 유용합니다. + +## 형식을 식별한 후 문서를 편집하는 방법은? +형식을 알게 되면 문서를 로드하고 편집하는 과정은 일관된 패턴을 따릅니다. 먼저 소스 파일 경로로 `Editor` 인스턴스를 생성하고, `Edit()`를 호출해 `EditableDocument`를 얻습니다. 이후 적절한 `SaveOptions`를 사용해 내용을 읽고, 수정하고, 최종적으로 저장할 수 있습니다. + ### 문서 로드 -문서를 편집하려면 먼저 문서를 로드해야 합니다. +`Editor`는 주어진 파일에 대한 모든 편집 작업을 캡슐화하는 핵심 클래스입니다. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // 추가 단계는 여기에서 다루겠습니다. + // Further steps will be covered here. } ``` -설명: -1. 초기화 편집기: 인스턴스를 생성합니다.`Editor` 클래스, 문서 경로를 제공합니다. -2. 폐기 패턴:`using` 자원이 적절하게 폐기되었는지 확인하는 성명입니다. +``` + +**설명:** +1. **Editor 초기화:** 대상 파일의 전체 경로를 전달하여 `Editor` 인스턴스를 생성합니다. +2. **Dispose 패턴:** `using` 문은 모든 비관리 리소스가 즉시 해제되도록 보장합니다. + ### 콘텐츠 추출 -문서가 로드되면 편집을 위해 해당 내용을 추출할 수 있습니다. +`EditableDocument.GetContent()`는 문서의 원시 텍스트(또는 웹 기반 편집기의 경우 HTML)를 반환하며, 이를 표시하거나 조작할 수 있습니다. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +215,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -설명: -1. 편집 방법:`Edit` 얻는 방법`EditableDocument`. -2. 콘텐츠 가져오기: 사용`GetContent` 문서의 내용을 문자열로 검색합니다. -3. 출력 콘텐츠: 콘텐츠를 콘솔에 인쇄합니다. -### 변경사항 저장 -편집 후 변경 사항을 문서에 다시 저장합니다. +``` + +**설명:** +1. **Edit 메서드:** `Edit()`는 `EditableDocument` 객체를 반환합니다. +2. **콘텐츠 가져오기:** `GetContent()`는 문서의 원시 텍스트(또는 웹 기반 편집기의 경우 HTML)를 추출합니다. +3. **콘텐츠 출력:** 검증을 위해 콘솔에 내용을 출력합니다. + +### 변경 사항 저장 +`SaveOptions`는 편집된 문서를 저장소에 어떤 형식으로 쓸지 편집기에 알려줍니다. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // 여기에서 내용을 수정하세요 + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -설명: -1. 편집 방법:`Edit` 얻는 방법`EditableDocument`. -2. 콘텐츠 수정: 필요에 따라 콘텐츠를 수정합니다(이 스니펫에는 표시되지 않음). -3. 저장 옵션: 생성`SaveOptions` 형식을 지정합니다. -4. 문서 저장:`Save` 편집된 문서를 저장하는 방법입니다. -## 4단계: 다양한 문서 유형 작업 -GroupDocs.Editor는 다양한 문서 유형을 지원합니다. 작업 방법은 다음과 같습니다. +``` + +**설명:** +1. **Edit 메서드:** 수정 후 `EditableDocument`를 다시 가져옵니다. +2. **콘텐츠 수정:** 문자열에 변경 사항을 적용합니다(여기서는 표시되지 않음). +3. **저장 옵션:** 원하는 출력 형식으로 `SaveOptions`를 구성합니다. +4. **문서 저장:** 편집된 파일을 디스크에 저장합니다. + +## 다양한 문서 유형을 다루는 방법은? +GroupDocs.Editor는 Word, Spreadsheet, Presentation 처리를 동일한 API 인터페이스 뒤에 추상화하여, 각 문서군마다 새로운 클래스를 배울 필요 없이 컨텍스트를 쉽게 전환할 수 있게 합니다. + ### 스프레드시트 문서 편집 +`SpreadsheetSaveOptions`는 형식 및 선택적 압축 설정을 포함하여 스프레드시트를 쓰는 방식을 정의합니다. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +256,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // 여기에서 내용을 수정하세요 + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -설명: -1. 편집기 초기화: 생성`Editor` 스프레드시트의 예입니다. -2. 편집 방법: 전화`Edit` 얻기 위해`EditableDocument`. -3. 콘텐츠 가져오기: 콘텐츠를 검색하고 인쇄합니다. -4. 콘텐츠 수정: 필요한 사항을 변경합니다. -5. 저장 옵션: 스프레드시트에 대한 저장 옵션을 지정합니다. -6. 문서 저장: 수정된 문서를 저장합니다. -### 프리젠테이션 문서 편집 +``` + +**설명:** +1. **Editor 초기화:** 스프레드시트 파일 경로를 `Editor` 생성자에 전달합니다. +2. **Edit 메서드:** `EditableDocument`를 가져옵니다. +3. **콘텐츠 가져오기:** 스프레드시트의 CSV 표현(또는 HTML)을 출력합니다. +4. **콘텐츠 수정:** 필요한 셀 수준 변경을 적용합니다. +5. **저장 옵션:** 적절한 `SpreadsheetSaveOptions`를 선택합니다. +6. **문서 저장:** 업데이트된 스프레드시트를 저장소에 기록합니다. + +### 프레젠테이션 문서 편집 +`PresentationSaveOptions`는 슬라이드 덱의 출력 형식을 제어하며, 원본 파일 유형을 유지하거나 변경할 수 있게 합니다. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +283,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // 여기에서 내용을 수정하세요 + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -설명: -1. 편집기 초기화: 생성`Editor` 프레젠테이션의 예입니다. -2. 편집 방법: 전화`Edit` 얻기 위해`EditableDocument`. -3. 콘텐츠 가져오기: 콘텐츠를 검색하고 인쇄합니다. -4. 콘텐츠 수정: 필요한 사항을 변경합니다. -5. 저장 옵션: 프레젠테이션에 대한 저장 옵션을 지정합니다. -6. 문서 저장: 수정된 문서를 저장합니다. +``` + +**설명:** +1. **Editor 초기화:** `Editor`를 통해 PowerPoint 파일을 로드합니다. +2. **Edit 메서드:** `EditableDocument`를 얻습니다. +3. **콘텐츠 가져오기:** 슬라이드 HTML 또는 일반 텍스트를 추출합니다. +4. **콘텐츠 수정:** 제목, 글머리표 또는 이미지를 업데이트합니다. +5. **저장 옵션:** `PresentationSaveOptions`를 사용해 출력 형식을 정의합니다. +6. **문서 저장:** 편집된 프레젠테이션을 저장합니다. + +## 일반적인 문제 및 해결책 +- **“지원되지 않는 형식” 오류:** 최신 GroupDocs.Editor 버전을 사용하고 있는지 확인하십시오; 최신 Office 형식 지원이 정기적으로 추가됩니다. +- **대용량 파일 메모리 사용량:** 문서를 로드하기 전에 `EditorSettings.EnableStreaming = true`로 설정하여 스트리밍 모드를 활성화합니다. +- **라이선스 적용 안 됨:** 임시 라이선스 파일이 애플리케이션 루트에 있거나 `License license = new License(); license.SetLicense("path/to/license.lic");`를 통해 로드되었는지 확인합니다. + +## 자주 묻는 질문 + +**Q: `DocumentFormatInfo`와 `SaveOptions`의 차이점은 무엇인가요?** +A: `DocumentFormatInfo`는 지원되는 파일 유형에 대한 메타데이터를 제공하고, `SaveOptions`는 문서를 디스크에 다시 쓸 때(형식, 압축 등) 어떻게 구성할지를 정의합니다. + +**Q: 사용자 정의 파일 확장자에 대한 형식을 나열할 수 있나요?** +A: 예—`DocumentFormatInfo.FromExtension("yourExt")`를 사용합니다; 확장자를 인식하지 못하면 메서드는 `null`을 반환합니다. + +**Q: GroupDocs.Editor가 비밀번호로 보호된 파일을 지원하나요?** +A: 물론입니다. `EditorSettings`를 통해 비밀번호를 `Editor` 생성자에 전달하면 암호화된 문서를 열 수 있습니다. + +**Q: GroupDocs.Editor가 실제로 지원하는 형식은 몇 개인가요?** +A: **30개 이상의 입력 및 출력 형식**을 지원하며, Word, Excel, PowerPoint, HTML, 일반 텍스트 등을 포함합니다. + +**Q: 편집 가능한 형식만 목록에 포함하도록 제한할 수 있나요?** +A: `GetEditableWordProcessingFormats()`(또는 Spreadsheet/Presentation 동등 메서드)를 사용하면 전체 편집 기능을 허용하는 형식을 가져올 수 있습니다. + +## 추가 리소스 +- [GroupDocs releases page](https://releases.groupdocs.com/editor/net/)에서 라이브러리를 다운로드합니다. +- 전체 기능 접근을 위해 [temporary license](https://purchase.groupdocs.com/temporary-license/)를 획득합니다. +- [free trial](https://releases.groupdocs.com/)로 제품을 사용해 보세요. +- [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/)에서 자세한 사용 예제를 살펴보세요. +- [support forum](https://forum.groupdocs.com/c/editor/20)에서 커뮤니티의 도움을 받으세요. + ## 결론 -.NET용 GroupDocs.Editor는 다양한 문서 형식을 프로그래밍 방식으로 편집할 수 있는 강력하고 유연한 방법을 제공합니다. 이 가이드를 따르면 문서 편집 기능을 .NET 애플리케이션에 효율적으로 통합하여 기능을 향상시키고 사용자에게 더 큰 가치를 제공할 수 있습니다. -## FAQ -### .NET용 GroupDocs.Editor란 무엇입니까? -.NET용 GroupDocs.Editor는 개발자가 .NET 응용 프로그램 내에서 프로그래밍 방식으로 다양한 문서 형식을 편집할 수 있는 강력한 라이브러리입니다. -### .NET용 GroupDocs.Editor를 시작하려면 어떻게 해야 합니까? -라이브러리를 다운로드하고, 임시 라이선스를 획득하고, 필요한 네임스페이스로 개발 환경을 설정해야 합니다. -### 어떤 문서 형식이 지원되나요? -GroupDocs.Editor는 특히 워드 프로세싱, 스프레드시트, 프리젠테이션 및 텍스트 형식을 지원합니다. -### GroupDocs.Editor를 무료로 사용할 수 있나요? - 당신은 사용할 수 있습니다[무료 시험판](https://releases.groupdocs.com/) 제한된 기능을 사용하거나[임시면허](https://purchase.groupdocs.com/temporary-license/) 전체 액세스를 위해. -### 더 많은 리소스와 지원을 어디서 찾을 수 있나요? - 방문하다[GroupDocs.Editor 문서](https://tutorials.groupdocs.com/editor/net/) 자세한 내용을 알아보거나 해당 사이트를 확인하세요.[지원 포럼](https://forum.groupdocs.com/c/editor/20) 도와주기 위해. \ No newline at end of file +이 가이드를 따라 이제 **지원되는 문서 형식 나열**, **확장자를 통해 파일 형식 결정**, 그리고 GroupDocs.Editor for .NET을 사용한 Word, Spreadsheet, Presentation 유형의 **문서 편집** 방법을 알게 되었습니다. 이러한 스니펫을 프로젝트에 통합하면 견고하고 형식 인식을 갖춘 애플리케이션을 구축하여 최종 사용자에게 만족을 주고 런타임 오류를 줄일 수 있습니다. + +--- + +**마지막 업데이트:** 2026-06-06 +**테스트 환경:** GroupDocs.Editor 23.9 for .NET +**작성자:** GroupDocs + +## 관련 튜토리얼 + +- [GroupDocs.Editor와 함께 .NET에서 문서 로딩 마스터하기: 포괄적인 가이드](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [GroupDocs.Editor와 함께 .NET에서 문서 편집 마스터하기: 포괄적인 가이드](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [GroupDocs.Editor .NET을 사용해 Word를 HTML로 변환하기: 단계별 가이드](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/polish/net/document-processing/work-document-formats/_index.md b/content/polish/net/document-processing/work-document-formats/_index.md index 55e92652..2cca0274 100644 --- a/content/polish/net/document-processing/work-document-formats/_index.md +++ b/content/polish/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Pracuj z formatami dokumentów -linktitle: Pracuj z formatami dokumentów -second_title: Edytor GroupDocs.NET API -description: Dowiedz się, jak używać GroupDocs.Editor dla .NET do programowej edycji różnych formatów dokumentów. Przewodnik krok po kroku z przykładami bezproblemowej integracji. -weight: 13 -url: /pl/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Dowiedz się, jak wyświetlić obsługiwane formaty dokumentów i określić + rozszerzenie formatu pliku przy użyciu GroupDocs.Editor dla .NET. Przewodnik krok + po kroku z fragmentami kodu, szybkimi odpowiedziami i FAQ. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Lista obsługiwanych formatów dokumentów +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Lista obsługiwanych formatów dokumentów w GroupDocs.Editor .NET type: docs +url: /pl/net/document-processing/work-document-formats/ +weight: 13 --- -# Pracuj z formatami dokumentów - -## Wstęp -Witamy w naszym szczegółowym przewodniku na temat korzystania z GroupDocs.Editor dla .NET! Jeśli jesteś programistą i chcesz ulepszyć swoje aplikacje o możliwości edycji dokumentów, trafiłeś we właściwe miejsce. W tym artykule omówiono wszystko, co musisz wiedzieć, od wymagań wstępnych po praktyczne przykłady, które pomogą Ci rozpocząć pracę z tą potężną biblioteką. -## Warunki wstępne -Zanim zagłębisz się w przykłady i funkcjonalności GroupDocs.Editor dla .NET, musisz spełnić kilka warunków wstępnych: -1. Podstawowa znajomość .NET: Znajomość .NET Framework lub .NET Core jest niezbędna. -2. Środowisko programistyczne: Visual Studio lub inne odpowiednie środowisko .NET IDE. -3. GroupDocs.Editor dla biblioteki .NET: Pobierz bibliotekę z[Strona z wersjami GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Licencja tymczasowa: Uzyskaj[licencja tymczasowa](https://purchase.groupdocs.com/temporary-license/) dla pełnych funkcji. -## Importuj przestrzenie nazw -Aby rozpocząć pracę z GroupDocs.Editor dla .NET, musisz zaimportować niezbędne przestrzenie nazw do swojego projektu. Dzięki temu będziesz miał dostęp do wszystkich klas i metod udostępnianych przez bibliotekę. + +# Lista obsługiwanych formatów dokumentów + +Witamy w naszym obszernej samouczku dotyczącym **jak wyświetlić obsługiwane formaty dokumentów** z GroupDocs.Editor dla .NET. Niezależnie od tego, czy tworzysz aplikację webową skoncentrowaną na dokumentach, czy narzędzie desktopowe klasy enterprise, znajomość dokładnych formatów, które możesz edytować lub konwertować, jest niezbędna. W tym przewodniku dowiesz się, jak wyliczyć formaty, parsować rozszerzenia i edytować dokumenty — wszystko z jasnymi, przyjaznymi dla człowieka wyjaśnieniami i gotowymi do uruchomienia fragmentami kodu. + +## Szybkie odpowiedzi +- **Jak wyświetlić wszystkie obsługiwane formaty?** Użyj `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (lub odpowiedników dla Presentation/Spreadsheet) i iteruj kolekcję. +- **Czy mogę określić format na podstawie rozszerzenia pliku?** Tak — wywołaj `DocumentFormatInfo.FromExtension(".docx")`. +- **Jakie typy plików obsługuje GroupDocs.Editor?** Ponad 30 formatów wejściowych i wyjściowych, w tym DOCX, XLSX, PPTX, HTML oraz zwykły tekst. +- **Czy potrzebuję licencji, aby wyświetlić formaty?** Tymczasowa licencja odblokowuje pełne API; w przeciwnym razie wersja próbna działa z ograniczonymi funkcjami. +- **Które wersje .NET są kompatybilne?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Co oznacza „lista obsługiwanych formatów dokumentów”? +Wyrażenie odnosi się do programowego pobierania kolekcji typów plików, które GroupDocs.Editor może otworzyć, edytować i zapisać. Ta operacja pozwala tworzyć dynamiczne listy rozwijane w interfejsie użytkownika lub weryfikować przesyłane pliki przed przetworzeniem, zapewniając, że tylko kompatybilne pliki są przekazywane do edytora w celu dalszej manipulacji. + +## Dlaczego warto wyświetlać obsługiwane formaty dokumentów? +GroupDocs.Editor **obsługuje ponad 30 formatów wejściowych i wyjściowych** i może obsługiwać pliki do **2 GB** bez ładowania całego dokumentu do pamięci. Znajomość dokładnej listy zapobiega błędom w czasie wykonywania, poprawia doświadczenie użytkownika i umożliwia egzekwowanie reguł biznesowych, takich jak „zezwalaj tylko na edytowalne dokumenty Office”. Pomaga również prezentować użytkownikom wyłącznie formaty, które naprawdę obsługuje Twoja aplikacja. + +## Wymagania wstępne +1. **Środowisko programistyczne .NET** – Visual Studio 2022 lub dowolne IDE obsługujące .NET 6+. +2. **Biblioteka GroupDocs.Editor for .NET** – pobierz ze [strony wydań GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Tymczasowa licencja** – uzyskaj [tymczasową licencję](https://purchase.groupdocs.com/temporary-license/) dla nieograniczonego dostępu. +4. **Podstawowa znajomość C#** – znajomość przestrzeni nazw, instrukcji `using` oraz wyjścia konsoli. + +## Jak wyświetlić obsługiwane formaty dokumentów? +Załaduj kolekcję obsługiwanych formatów i wypisz nazwę oraz rozszerzenie każdego formatu. Ten dwustopniowy wzorzec działa dla dokumentów Word, Spreadsheet i Presentation. Iterując kolekcję, możesz dynamicznie wypełniać elementy UI, takie jak listy rozwijane, zapewniając, że użytkownicy mogą wybierać jedynie formaty, które edytor rzeczywiście obsługuje. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Wyświetlanie formatów przetwarzania tekstu +`Formats.WordProcessingFormats` jest wyliczeniem opisującym każdy typ pliku przetwarzania tekstu rozpoznawany przez edytor. Właściwość `All` zwraca kolekcję tych obiektów formatu. -## Krok 1: Praca z formatami dokumentów -GroupDocs.Editor obsługuje szeroką gamę formatów dokumentów. Przyjrzyjmy się, jak wyświetlić listę wszystkich obsługiwanych formatów edytora tekstu i prezentacji. -### Lista formatów przetwarzania tekstu +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Wyjaśnienie: -1. Zapętlaj formaty: Przeglądamy wszystkie dostępne formaty przetwarzania tekstu. -2. Szczegóły formatu wyjściowego: Dla każdego formatu drukujemy jego nazwę i rozszerzenie. -### Formaty prezentacji aukcji +``` + +**Wyjaśnienie:** +1. **Iteracja po formatach:** Przechodzimy po wszystkich dostępnych formatach przetwarzania tekstu. +2. **Wyświetlanie szczegółów formatu:** Dla każdego formatu wypisujemy przyjazną nazwę i domyślne rozszerzenie pliku. + +### Wyświetlanie formatów prezentacji +`Formats.PresentationFormats` działa w ten sam sposób dla plików prezentacji, udostępniając każdy obsługiwany typ prezentacji poprzez kolekcję `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Wyjaśnienie: -1. Zapętlanie formatów: Podobnie jak w przypadku formatów edytora tekstu, przeglądamy wszystkie formaty prezentacji. -2. Szczegóły formatu wyjściowego: Wydrukuj nazwę i rozszerzenie każdego formatu. -## Krok 2: Analizowanie formatów z rozszerzeń -Czasami konieczne jest określenie formatu na podstawie rozszerzenia pliku. Dzięki GroupDocs.Editor jest to łatwe. -### Analizowanie formatów arkuszy kalkulacyjnych +``` + +**Wyjaśnienie:** +1. **Iteracja po formatach:** Ta sama logika iteracji dotyczy prezentacji. +2. **Wyświetlanie szczegółów formatu:** Nazwa i rozszerzenie są wyświetlane dla każdego formatu. + +## Jak określić rozszerzenie formatu pliku? +Czasami masz tylko nazwę pliku i musisz wywnioskować odpowiadający mu `DocumentFormat`. GroupDocs.Editor oferuje prosty statyczny pomocnik, który mapuje rozszerzenie pliku na wewnętrzną reprezentację formatu, umożliwiając walidację lub konwersję plików przed ich załadowaniem do edytora. + +### Parsowanie formatów arkuszy kalkulacyjnych +`Formats.SpreadsheetFormats.FromExtension` konwertuje ciąg rozszerzenia pliku na odpowiadającą wartość wyliczenia formatu arkusza kalkulacyjnego. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Wyjaśnienie: -1. Format analizy: Używamy formatu`FromExtension` metoda analizowania formatu z pliku`.xlsm` rozszerzenie. -2. Format wyjściowy: Wydrukuj nazwę przeanalizowanego formatu. +``` + +**Wyjaśnienie:** +1. **Parsowanie formatu:** `FromExtension` konwertuje rozszerzenie `.xlsm` na wewnętrzne wyliczenie `SpreadsheetFormat`. +2. **Wyświetlenie formatu:** Nazwa sparsowanego formatu jest wypisywana, potwierdzając mapowanie. + ### Parsowanie formatów tekstowych +Analogicznie, `Formats.TextualFormats.FromExtension` rozwiązuje rozszerzenia plików tekstowych, takich jak HTML czy TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Wyjaśnienie: -1. Format analizy: The`FromExtension` Metoda służy do analizowania formatu z pliku`html` rozszerzenie. -2. Format wyjściowy: Wydrukuj nazwę analizowanego formatu tekstowego. -## Krok 3: Edycja dokumentów -Teraz, gdy wiemy, jak pracować z formatami, przejdźmy do edytowania dokumentów za pomocą GroupDocs.Editor. +``` + +**Wyjaśnienie:** +1. **Parsowanie formatu:** Metoda `FromExtension` rozwiązuje rozszerzenie `html` do `TextFormat`. +2. **Wyświetlenie formatu:** Nazwa formatu tekstowego jest wyświetlana, przydatna dla edytorów internetowych. + +## Jak edytować dokumenty po zidentyfikowaniu formatów? +Gdy znasz format, ładowanie i edytowanie dokumentu odbywa się według spójnego wzorca. Najpierw tworzysz instancję `Editor` z ścieżką do pliku źródłowego, następnie wywołujesz `Edit()`, aby uzyskać `EditableDocument`. Stamtąd możesz odczytać, zmodyfikować i ostatecznie zapisać zawartość przy użyciu odpowiednich `SaveOptions`. + ### Ładowanie dokumentu -Aby edytować dokument, należy go najpierw załadować. +`Editor` jest klasą podstawową, która kapsułkuje wszystkie operacje edycji dla danego pliku. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Dalsze kroki zostaną omówione tutaj. + // Further steps will be covered here. } ``` -Wyjaśnienie: -1. Zainicjuj edytor: Utwórz instancję pliku`Editor` class, podając ścieżkę do dokumentu. -2. Wzór utylizacji: użyj`using` oświadczenie potwierdzające, że zasoby są właściwie utylizowane. -### Wyodrębnianie treści -Po załadowaniu dokumentu możesz wyodrębnić jego zawartość do edycji. +``` + +**Wyjaśnienie:** +1. **Inicjalizacja edytora:** Utwórz instancję `Editor`, przekazując pełną ścieżkę do docelowego pliku. +2. **Wzorzec zwalniania zasobów:** Instrukcja `using` zapewnia, że wszystkie niezarządzane zasoby zostaną szybko zwolnione. + +### Pobieranie zawartości +`EditableDocument.GetContent()` zwraca surowy tekst dokumentu (lub HTML dla edytorów internetowych), który możesz wyświetlić lub zmodyfikować. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Wyjaśnienie: -1. Metoda edycji: Zadzwoń do`Edit` metoda uzyskania`EditableDocument`. -2. Pobierz zawartość: użyj`GetContent` aby pobrać zawartość dokumentu jako ciąg znaków. -3. Treść wyjściowa: Wydrukuj zawartość na konsoli. -### Zapisywania zmian -Po edycji zapisz zmiany z powrotem w dokumencie. +``` + +**Wyjaśnienie:** +1. **Metoda Edit:** `Edit()` zwraca obiekt `EditableDocument`. +2. **Pobranie zawartości:** `GetContent()` wyodrębnia surowy tekst dokumentu (lub HTML dla edytorów internetowych). +3. **Wyświetlenie zawartości:** Zawartość jest wypisywana w konsoli w celu weryfikacji. + +### Zapisywanie zmian +`SaveOptions` określa edytorowi, jak i w jakim formacie zapisać edytowany dokument z powrotem do pamięci. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Zmodyfikuj treść tutaj + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Wyjaśnienie: -1. Metoda edycji: Zadzwoń do`Edit` metoda uzyskania`EditableDocument`. -2. Modyfikuj treść: Zmodyfikuj treść według potrzeb (nie pokazano w tym fragmencie). -3. Opcje zapisu: Utwórz`SaveOptions` określenie formatu. -4. Zapisz dokument: Użyj`Save` metoda zapisania edytowanego dokumentu. -## Krok 4: Praca z różnymi typami dokumentów -GroupDocs.Editor obsługuje różne typy dokumentów. Oto jak z nimi pracować: -### Edycja dokumentów arkusza kalkulacyjnego +``` + +**Wyjaśnienie:** +1. **Metoda Edit:** Ponownie uzyskaj `EditableDocument` po wprowadzeniu modyfikacji. +2. **Modyfikacja zawartości:** Zastosuj zmiany w ciągu znaków (nie pokazano tutaj). +3. **Opcje zapisu:** Skonfiguruj `SaveOptions` z żądanym formatem wyjściowym. +4. **Zapis dokumentu:** Zapisz zmodyfikowany plik z powrotem na dysk. + +## Jak pracować z różnymi typami dokumentów? +GroupDocs.Editor abstrahuje obsługę Word, Spreadsheet i Presentation za pomocą tego samego interfejsu API, co ułatwia przełączanie kontekstów bez konieczności nauki nowego zestawu klas dla każdej rodziny dokumentów. + +### Edytowanie dokumentów arkuszy kalkulacyjnych +`SpreadsheetSaveOptions` definiuje sposób zapisu arkusza kalkulacyjnego, w tym format i opcjonalne ustawienia kompresji. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Zmodyfikuj treść tutaj + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Wyjaśnienie: -1. Zainicjuj edytor: Utwórz plik`Editor` przykład arkusza kalkulacyjnego. -2. Metoda edycji: Zadzwoń`Edit` aby uzyskać`EditableDocument`. -3. Pobierz zawartość: pobierz i wydrukuj zawartość. -4. Modyfikuj treść: Wprowadź niezbędne zmiany. -5. Opcje zapisywania: Określ opcje zapisywania arkuszy kalkulacyjnych. -6. Zapisz dokument: Zapisz zmodyfikowany dokument. -### Edycja dokumentów prezentacji +``` + +**Wyjaśnienie:** +1. **Inicjalizacja edytora:** Przekaż ścieżkę do pliku arkusza kalkulacyjnego w konstruktorze `Editor`. +2. **Metoda Edit:** Pobierz `EditableDocument`. +3. **Pobranie zawartości:** Wypisz reprezentację CSV arkusza (lub HTML). +4. **Modyfikacja zawartości:** Wprowadź potrzebne zmiany na poziomie komórek. +5. **Opcje zapisu:** Wybierz odpowiednie `SpreadsheetSaveOptions`. +6. **Zapis dokumentu:** Zapisz zaktualizowany arkusz z powrotem w pamięci. + +### Edytowanie dokumentów prezentacji +`PresentationSaveOptions` kontroluje format wyjściowy dla prezentacji, umożliwiając zachowanie lub zmianę pierwotnego typu pliku. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Zmodyfikuj treść tutaj + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Wyjaśnienie: -1. Zainicjuj edytor: Utwórz plik`Editor` przykład prezentacji. -2. Metoda edycji: Zadzwoń`Edit` aby uzyskać`EditableDocument`. -3. Pobierz zawartość: pobierz i wydrukuj zawartość. -4. Modyfikuj treść: Wprowadź niezbędne zmiany. -5. Opcje zapisywania: Określ opcje zapisywania prezentacji. -6. Zapisz dokument: Zapisz zmodyfikowany dokument. -## Wniosek -GroupDocs.Editor dla .NET zapewnia solidny i elastyczny sposób programowej edycji różnych formatów dokumentów. Postępując zgodnie z tym przewodnikiem, możesz skutecznie zintegrować funkcje edycji dokumentów z aplikacjami .NET, zwiększając ich możliwości i zapewniając większą wartość użytkownikom. -## Często zadawane pytania -### Co to jest GroupDocs.Editor dla .NET? -GroupDocs.Editor dla .NET to potężna biblioteka, która umożliwia programistom programową edycję różnych formatów dokumentów w aplikacjach .NET. -### Jak rozpocząć pracę z GroupDocs.Editor dla .NET? -Musisz pobrać bibliotekę, uzyskać tymczasową licencję i skonfigurować środowisko programistyczne z niezbędnymi przestrzeniami nazw. -### Jakie formaty dokumentów są obsługiwane? -GroupDocs.Editor obsługuje między innymi formaty edytora tekstu, arkusza kalkulacyjnego, prezentacji i tekstu. -### Czy mogę korzystać z GroupDocs.Editor za darmo? - Możesz użyć A[bezpłatna wersja próbna](https://releases.groupdocs.com/) z ograniczonymi funkcjami lub uzyskaj[licencja tymczasowa](https://purchase.groupdocs.com/temporary-license/) dla pełnego dostępu. -### Gdzie mogę znaleźć więcej zasobów i wsparcia? - Odwiedzić[Dokumentacja GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) aby uzyskać szczegółowe informacje, lub sprawdź ich[forum wsparcia](https://forum.groupdocs.com/c/editor/20) o pomoc. \ No newline at end of file +``` + +**Wyjaśnienie:** +1. **Inicjalizacja edytora:** Załaduj plik PowerPoint przy użyciu `Editor`. +2. **Metoda Edit:** Uzyskaj `EditableDocument`. +3. **Pobranie zawartości:** Wyodrębnij HTML slajdów lub zwykły tekst. +4. **Modyfikacja zawartości:** Zaktualizuj tytuły, wypunktowania lub obrazy. +5. **Opcje zapisu:** Użyj `PresentationSaveOptions`, aby określić format wyjściowy. +6. **Zapis dokumentu:** Zapisz zmodyfikowaną prezentację. + +## Typowe problemy i rozwiązania +- **Błąd „Format nieobsługiwany”**: Upewnij się, że używasz najnowszej wersji GroupDocs.Editor; regularnie dodaje wsparcie dla nowszych formatów Office. +- **Wysokie zużycie pamięci przy dużych plikach**: Włącz tryb strumieniowy, ustawiając `EditorSettings.EnableStreaming = true` przed załadowaniem dokumentu. +- **Licencja nie została zastosowana**: Upewnij się, że plik tymczasowej licencji znajduje się w katalogu głównym aplikacji lub jest ładowany za pomocą `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Najczęściej zadawane pytania + +**Q: Jaka jest różnica między `DocumentFormatInfo` a `SaveOptions`?** +A: `DocumentFormatInfo` dostarcza metadane o obsługiwanych typach plików, natomiast `SaveOptions` konfiguruje sposób zapisu dokumentu na dysk (format, kompresja itp.). + +**Q: Czy mogę wyświetlić formaty dla własnego rozszerzenia pliku?** +A: Tak — użyj `DocumentFormatInfo.FromExtension("yourExt")`; jeśli rozszerzenie nie jest rozpoznane, metoda zwraca `null`. + +**Q: Czy GroupDocs.Editor obsługuje pliki zabezpieczone hasłem?** +A: Zdecydowanie tak. Przekaż hasło do konstruktora `Editor` za pomocą `EditorSettings`, aby otworzyć zaszyfrowane dokumenty. + +**Q: Ile formatów rzeczywiście obsługuje GroupDocs.Editor?** +A: Ponad **30 formatów wejściowych i wyjściowych**, obejmujących Word, Excel, PowerPoint, HTML oraz zwykły tekst. + +**Q: Czy istnieje sposób, aby ograniczyć listę tylko do formatów edytowalnych?** +A: Użyj `GetEditableWordProcessingFormats()` (lub odpowiedników dla Spreadsheet/Presentation), aby pobrać formaty umożliwiające pełne możliwości edycji. + +## Dodatkowe zasoby +- Pobierz bibliotekę ze [strony wydań GroupDocs](https://releases.groupdocs.com/editor/net/). +- Uzyskaj [tymczasową licencję](https://purchase.groupdocs.com/temporary-license/) dla pełnego dostępu do funkcji. +- Wypróbuj produkt z [bezpłatną wersją próbną](https://releases.groupdocs.com/). +- Zapoznaj się ze szczegółowymi przykładami użycia w [dokumentacji GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Uzyskaj pomoc od społeczności na [forum wsparcia](https://forum.groupdocs.com/c/editor/20). + +## Podsumowanie +Stosując się do tego przewodnika, teraz wiesz, jak **wyświetlić obsługiwane formaty dokumentów**, **określić format pliku na podstawie jego rozszerzenia** oraz **edytować dokumenty** w typach Word, Spreadsheet i Presentation przy użyciu GroupDocs.Editor dla .NET. Włącz te fragmenty kodu do własnych projektów, aby budować solidne aplikacje świadome formatów, które zachwycą użytkowników końcowych i zredukują błędy w czasie wykonywania. + +--- + +**Ostatnia aktualizacja:** 2026-06-06 +**Testowano z:** GroupDocs.Editor 23.9 for .NET +**Autor:** GroupDocs + +## Powiązane samouczki + +- [Opanowanie ładowania dokumentów w .NET z GroupDocs.Editor: Kompletny przewodnik](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Mistrzowska edycja dokumentów w .NET z GroupDocs.Editor: Kompletny przewodnik](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Konwersja Word do HTML przy użyciu GroupDocs.Editor .NET: Przewodnik krok po kroku](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/portuguese/net/document-processing/work-document-formats/_index.md b/content/portuguese/net/document-processing/work-document-formats/_index.md index 25d9e6b5..91b53825 100644 --- a/content/portuguese/net/document-processing/work-document-formats/_index.md +++ b/content/portuguese/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Trabalhar com formatos de documentos -linktitle: Trabalhar com formatos de documentos -second_title: API GroupDocs.Editor .NET -description: Aprenda como usar o GroupDocs.Editor for .NET para editar vários formatos de documentos de forma programática. Guia passo a passo com exemplos para integração perfeita. -weight: 13 -url: /pt/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Aprenda como listar os formatos de documento suportados e determinar + a extensão do formato de arquivo usando o GroupDocs.Editor para .NET. Guia passo + a passo com trechos de código, respostas rápidas e perguntas frequentes. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Listar formatos de documento suportados +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Listar formatos de documento suportados com GroupDocs.Editor .NET type: docs +url: /pt/net/document-processing/work-document-formats/ +weight: 13 --- -# Trabalhar com formatos de documentos -## Introdução -Bem-vindo ao nosso guia detalhado sobre como usar o GroupDocs.Editor for .NET! Se você é um desenvolvedor que deseja aprimorar seus aplicativos com recursos de edição de documentos, você veio ao lugar certo. Este artigo orientará você em tudo o que você precisa saber, desde pré-requisitos até exemplos práticos, para começar a usar esta poderosa biblioteca. +# Lista de Formatos de Documento Suportados + +Bem‑vindo ao nosso tutorial abrangente sobre **como listar formatos de documento suportados** com o GroupDocs.Editor para .NET. Seja você desenvolvendo um aplicativo web centrado em documentos ou uma ferramenta desktop de nível empresarial, saber exatamente quais formatos você pode editar ou converter é essencial. Neste guia, você descobrirá como enumerar formatos, analisar extensões e editar documentos — tudo com explicações claras e amigáveis e trechos de código prontos para execução. + +## Respostas Rápidas +- **Como listar todos os formatos suportados?** Use `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (ou os equivalentes para Presentation/Spreadsheet) e itere a coleção. +- **Posso determinar um formato a partir de uma extensão de arquivo?** Sim — chame `DocumentFormatInfo.FromExtension(".docx")`. +- **Quais tipos de arquivo o GroupDocs.Editor suporta?** Mais de 30 formatos de entrada e saída, incluindo DOCX, XLSX, PPTX, HTML e texto simples. +- **Preciso de uma licença para listar formatos?** Uma licença temporária desbloqueia a API completa; caso contrário, uma avaliação funciona com recursos limitados. +- **Quais versões do .NET são compatíveis?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## O que é “listar formatos de documento suportados”? +A expressão refere‑se a recuperar programaticamente a coleção de tipos de arquivo que o GroupDocs.Editor pode abrir, editar e salvar. Essa operação permite que você crie menus suspensos de UI dinâmicos ou valide uploads de usuários antes do processamento, garantindo que apenas arquivos compatíveis sejam enviados ao editor para manipulação posterior. + +## Por que listar formatos de documento suportados? +O GroupDocs.Editor **suporta mais de 30 formatos de entrada e saída** e pode lidar com arquivos de até **2 GB** sem carregar o documento inteiro na memória. Conhecer a lista exata evita erros em tempo de execução, melhora a experiência do usuário e permite aplicar regras de negócio, como “permitir apenas documentos do Office editáveis”. Também ajuda a apresentar aos usuários somente os formatos que sua aplicação realmente suporta. + ## Pré-requisitos -Antes de mergulhar nos exemplos e funcionalidades do GroupDocs.Editor for .NET, existem alguns pré-requisitos que você precisa ter em vigor: -1. Compreensão básica de .NET: Familiaridade com .NET Framework ou .NET Core é essencial. -2. Ambiente de desenvolvimento: Visual Studio ou qualquer outro IDE .NET adequado. -3. Biblioteca GroupDocs.Editor for .NET: Baixe a biblioteca do[Página de lançamentos do GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Licença Temporária: Obtenha uma[licença temporária](https://purchase.groupdocs.com/temporary-license/) para recursos completos. -## Importar namespaces -Para começar a usar o GroupDocs.Editor for .NET, você precisa importar os namespaces necessários para o seu projeto. Isso garantirá que você tenha acesso a todas as classes e métodos fornecidos pela biblioteca. +Antes de começar, certifique‑se de que você tem: + +1. **Ambiente de desenvolvimento .NET** – Visual Studio 2022 ou qualquer IDE que suporte .NET 6+. +2. **Biblioteca GroupDocs.Editor para .NET** – faça o download na [página de lançamentos do GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Licença temporária** – obtenha uma [licença temporária](https://purchase.groupdocs.com/temporary-license/) para acesso irrestrito. +4. **Conhecimento básico de C#** – familiaridade com namespaces, declarações `using` e saída de console. + +## Como Listar Formatos de Documento Suportados? +Carregue a coleção de formatos suportados e imprima o nome e a extensão de cada formato. Esse padrão de duas etapas funciona para documentos de Processamento de Texto, Planilha e Apresentação. Ao iterar a coleção, você pode preencher dinamicamente elementos de UI, como menus suspensos, garantindo que os usuários só possam selecionar formatos que o editor realmente manipula. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Listando Formatos de Processamento de Texto +`Formats.WordProcessingFormats` é uma enumeração que descreve cada tipo de arquivo de processamento de texto reconhecido pelo editor. A propriedade `All` devolve uma coleção desses objetos de formato. -## Etapa 1: trabalhando com formatos de documentos -GroupDocs.Editor oferece suporte a uma ampla variedade de formatos de documentos. Vamos explorar como você pode listar todos os formatos de apresentação e processamento de texto suportados. -### Listando formatos de processamento de texto +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explicação: -1. Formatos de loop through: percorremos todos os formatos de processamento de texto disponíveis. -2. Detalhes do formato de saída: Para cada formato, imprimimos seu nome e extensão. -### Listando formatos de apresentação +``` + +**Explicação:** +1. **Iterar pelos Formatos:** Iteramos sobre todos os formatos de processamento de texto disponíveis. +2. **Exibir Detalhes do Formato:** Para cada formato imprimimos seu nome amigável e a extensão de arquivo padrão. + +### Listando Formatos de Apresentação +`Formats.PresentationFormats` funciona da mesma forma para arquivos de apresentações, expondo cada tipo de apresentação suportado através da coleção `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explicação: -1. Formatos Loop Through: Semelhante aos formatos de processamento de texto, percorremos todos os formatos de apresentação. -2. Detalhes do formato de saída: imprima o nome e a extensão de cada formato. -## Etapa 2: analisando formatos de extensões -Às vezes, você precisa determinar o formato com base na extensão do arquivo. GroupDocs.Editor torna isso fácil. -### Analisando formatos de planilha +``` + +**Explicação:** +1. **Iterar pelos Formatos:** A mesma lógica de iteração se aplica às apresentações. +2. **Exibir Detalhes do Formato:** O nome e a extensão são exibidos para cada formato. + +## Como Determinar a Extensão do Formato de Arquivo? +Às vezes você tem apenas o nome de um arquivo e precisa inferir o `DocumentFormat` correspondente. O GroupDocs.Editor oferece um helper estático simples que mapeia uma extensão de arquivo para sua representação interna de formato, permitindo validar ou converter arquivos antes de carregá‑los no editor. + +### Analisando Formatos de Planilha +`Formats.SpreadsheetFormats.FromExtension` converte uma string de extensão de arquivo no valor enum correspondente ao formato de planilha. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Explicação: -1. Formato de análise: usamos o`FromExtension` método para analisar o formato do`.xlsm` extensão. -2. Formato de saída: Imprima o nome do formato analisado. +``` + +**Explicação:** +1. **Analisar Formato:** `FromExtension` converte a extensão `.xlsm` para seu enum interno `SpreadsheetFormat`. +2. **Exibir Formato:** O nome do formato analisado é impresso, confirmando o mapeamento. + ### Analisando Formatos Textuais +De forma semelhante, `Formats.TextualFormats.FromExtension` resolve extensões de arquivos textuais como HTML ou TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Explicação: -1. Formato de análise: o`FromExtension` método é usado para analisar o formato do`html` extensão. -2. Formato de saída: Imprima o nome do formato textual analisado. -## Etapa 3: Editando Documentos -Agora que vimos como trabalhar com formatos, vamos mergulhar na edição de documentos usando GroupDocs.Editor. -### Carregando um documento -Para editar um documento, primeiro você precisa carregá-lo. +``` + +**Explicação:** +1. **Analisar Formato:** O método `FromExtension` resolve a extensão `html` para um `TextFormat`. +2. **Exibir Formato:** O nome do formato textual é exibido, útil para editores baseados na web. + +## Como Editar Documentos Após Identificar os Formatos? +Depois de conhecer o formato, carregar e editar um documento segue um padrão consistente. Primeiro você cria uma instância de `Editor` com o caminho do arquivo fonte, então chama `Edit()` para obter um `EditableDocument`. A partir daí você pode ler, modificar e, finalmente, salvar o conteúdo usando as `SaveOptions` apropriadas. + +### Carregando um Documento +`Editor` é a classe principal que encapsula todas as operações de edição para um determinado arquivo. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Outras etapas serão abordadas aqui. + // Further steps will be covered here. } ``` -Explicação: -1. Inicializar Editor: Crie uma instância do`Editor` class, fornecendo o caminho para o seu documento. -2. Padrão de descarte: use o`using` declaração para garantir que os recursos sejam adequadamente descartados. +``` + +**Explicação:** +1. **Inicializar Editor:** Crie uma instância de `Editor`, passando o caminho completo do arquivo alvo. +2. **Padrão Dispose:** A instrução `using` garante que todos os recursos não gerenciados sejam liberados prontamente. + ### Extraindo Conteúdo -Depois que o documento for carregado, você poderá extrair seu conteúdo para edição. +`EditableDocument.GetContent()` devolve o texto bruto do documento (ou HTML para editores baseados na web), que você pode exibir ou manipular. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Explicação: -1. Método de edição: Chame o`Edit` método para obter um`EditableDocument`. -2. Obtenha conteúdo: use`GetContent` para recuperar o conteúdo do documento como uma string. -3. Conteúdo de saída: imprima o conteúdo no console. -### Salvando alterações -Após a edição, salve as alterações no documento. +``` + +**Explicação:** +1. **Método Edit:** `Edit()` devolve um objeto `EditableDocument`. +2. **Obter Conteúdo:** `GetContent()` extrai o texto bruto do documento (ou HTML para editores baseados na web). +3. **Exibir Conteúdo:** O conteúdo é escrito no console para verificação. + +### Salvando Alterações +`SaveOptions` informa ao editor como e em qual formato gravar o documento editado de volta ao armazenamento. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Modifique o conteúdo aqui + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Explicação: -1. Método de edição: Chame o`Edit` método para obter um`EditableDocument`. -2. Modificar conteúdo: modifique o conteúdo conforme necessário (não mostrado neste snippet). -3. Opções para salvar: Criar`SaveOptions` especificando o formato. -4. Salvar documento: use o`Save` método para salvar o documento editado. -## Etapa 4: trabalhando com diferentes tipos de documentos -GroupDocs.Editor oferece suporte a vários tipos de documentos. Veja como trabalhar com eles: -### Editando documentos de planilha +``` + +**Explicação:** +1. **Método Edit:** Reobtenha o `EditableDocument` após as modificações. +2. **Modificar Conteúdo:** Aplique suas alterações à string (não mostrada aqui). +3. **Opções de Salvamento:** Configure `SaveOptions` com o formato de saída desejado. +4. **Salvar Documento:** Persista o arquivo editado de volta ao disco. + +## Como Trabalhar com Diferentes Tipos de Documento? +O GroupDocs.Editor abstrai o manuseio de Word, Planilha e Apresentação por trás da mesma superfície de API, facilitando a troca de contextos sem precisar aprender um novo conjunto de classes para cada família de documentos. + +### Editando Documentos de Planilha +`SpreadsheetSaveOptions` define como uma planilha é gravada, incluindo formato e configurações opcionais de compressão. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifique o conteúdo aqui + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Explicação: -1. Inicializar Editor: Crie um`Editor` exemplo para uma planilha. -2. Método de edição: chamada`Edit` para obter um`EditableDocument`. -3. Obter conteúdo: recupere e imprima o conteúdo. -4. Modificar conteúdo: faça as alterações necessárias. -5. Opções de salvamento: Especifique opções de salvamento para planilhas. -6. Salvar documento: salva o documento modificado. +``` + +**Explicação:** +1. **Inicializar Editor:** Passe o caminho de um arquivo de planilha ao construtor `Editor`. +2. **Método Edit:** Recupere um `EditableDocument`. +3. **Obter Conteúdo:** Imprima a representação CSV da planilha (ou HTML). +4. **Modificar Conteúdo:** Aplique quaisquer alterações ao nível de célula que precisar. +5. **Opções de Salvamento:** Escolha o `SpreadsheetSaveOptions` apropriado. +6. **Salvar Documento:** Grave a planilha atualizada de volta ao armazenamento. + ### Editando Documentos de Apresentação +`PresentationSaveOptions` controla o formato de saída para apresentações, permitindo preservar ou alterar o tipo de arquivo original. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modifique o conteúdo aqui + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Explicação: -1. Inicializar Editor: Crie um`Editor` exemplo para uma apresentação. -2. Método de edição: chamada`Edit` para obter um`EditableDocument`. -3. Obter conteúdo: recupere e imprima o conteúdo. -4. Modificar conteúdo: faça as alterações necessárias. -5. Opções de salvamento: Especifique opções de salvamento para apresentações. -6. Salvar documento: salva o documento modificado. +``` + +**Explicação:** +1. **Inicializar Editor:** Carregue um arquivo PowerPoint via `Editor`. +2. **Método Edit:** Obtenha um `EditableDocument`. +3. **Obter Conteúdo:** Extraia o HTML dos slides ou texto simples. +4. **Modificar Conteúdo:** Atualize títulos, marcadores ou imagens. +5. **Opções de Salvamento:** Use `PresentationSaveOptions` para definir o formato de saída. +6. **Salvar Documento:** Persista a apresentação editada. + +## Problemas Comuns e Soluções +- **Erro “Formato não suportado”**: Verifique se está usando a versão mais recente do GroupDocs.Editor; ela adiciona suporte a novos formatos do Office regularmente. +- **Consumo de memória com arquivos grandes**: Habilite o modo streaming definindo `EditorSettings.EnableStreaming = true` antes de carregar o documento. +- **Licença não aplicada**: Certifique‑se de que o arquivo de licença temporária esteja colocado na raiz da aplicação ou carregado via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Perguntas Frequentes + +**Q: Qual é a diferença entre `DocumentFormatInfo` e `SaveOptions`?** +A: `DocumentFormatInfo` fornece metadados sobre os tipos de arquivo suportados, enquanto `SaveOptions` configura como um documento é gravado de volta ao disco (formato, compressão, etc.). + +**Q: Posso listar formatos para uma extensão de arquivo personalizada?** +A: Sim — use `DocumentFormatInfo.FromExtension("yourExt")`; se a extensão não for reconhecida, o método retorna `null`. + +**Q: O GroupDocs.Editor suporta arquivos protegidos por senha?** +A: Absolutamente. Passe a senha ao construtor `Editor` via `EditorSettings` para abrir documentos criptografados. + +**Q: Quantos formatos o GroupDocs.Editor realmente suporta?** +A: Mais de **30 formatos de entrada e saída**, abrangendo Word, Excel, PowerPoint, HTML e texto simples. + +**Q: Existe uma maneira de restringir a lista apenas a formatos editáveis?** +A: Use `GetEditableWordProcessingFormats()` (ou os equivalentes para Spreadsheet/Presentation) para obter formatos que permitem recursos completos de edição. + +## Recursos Adicionais +- Baixe a biblioteca na [página de lançamentos do GroupDocs](https://releases.groupdocs.com/editor/net/). +- Obtenha uma [licença temporária](https://purchase.groupdocs.com/temporary-license/) para acesso total aos recursos. +- Experimente o produto com um [teste gratuito](https://releases.groupdocs.com/). +- Explore exemplos de uso detalhados na [documentação do GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Obtenha ajuda da comunidade no [fórum de suporte](https://forum.groupdocs.com/c/editor/20). + ## Conclusão -GroupDocs.Editor for .NET fornece uma maneira robusta e flexível de editar vários formatos de documentos de forma programática. Seguindo este guia, você pode integrar com eficiência funcionalidades de edição de documentos em seus aplicativos .NET, aprimorando seus recursos e agregando maior valor aos seus usuários. -## Perguntas frequentes -### O que é GroupDocs.Editor para .NET? -GroupDocs.Editor for .NET é uma biblioteca poderosa que permite aos desenvolvedores editar vários formatos de documentos programaticamente em seus aplicativos .NET. -### Como posso começar a usar o GroupDocs.Editor para .NET? -Você precisa baixar a biblioteca, obter uma licença temporária e configurar seu ambiente de desenvolvimento com os namespaces necessários. -### Quais formatos de documentos são suportados? -GroupDocs.Editor suporta formatos de processamento de texto, planilha, apresentação e texto, entre outros. -### Posso usar o GroupDocs.Editor gratuitamente? - Você pode usar um[teste grátis](https://releases.groupdocs.com/) com recursos limitados ou obter um[licença temporária](https://purchase.groupdocs.com/temporary-license/) para acesso total. -### Onde posso encontrar mais recursos e suporte? - Visite a[Documentação do GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) para obter informações detalhadas ou verifique seus[Fórum de suporte](https://forum.groupdocs.com/c/editor/20) para ajuda. \ No newline at end of file +Seguindo este guia, você agora sabe como **listar formatos de documento suportados**, **determinar o formato de um arquivo a partir de sua extensão** e **editar documentos** nos tipos Word, Planilha e Apresentação usando o GroupDocs.Editor para .NET. Incorpore esses trechos em seus próprios projetos para criar aplicações robustas e conscientes de formatos, que encantam os usuários finais e reduzem erros em tempo de execução. + +**Última atualização:** 2026-06-06 +**Testado com:** GroupDocs.Editor 23.9 for .NET +**Autor:** GroupDocs + +## Tutoriais Relacionados + +- [Dominando o Carregamento de Documentos em .NET com GroupDocs.Editor: Um Guia Abrangente](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Domínio da Edição de Documentos em .NET com GroupDocs.Editor: Um Guia Abrangente](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Converter Word para HTML Usando GroupDocs.Editor .NET: Um Guia Passo a Passo](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/russian/net/document-processing/work-document-formats/_index.md b/content/russian/net/document-processing/work-document-formats/_index.md index 2ae064b2..a3b23a11 100644 --- a/content/russian/net/document-processing/work-document-formats/_index.md +++ b/content/russian/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Работа с форматами документов -linktitle: Работа с форматами документов +date: 2026-06-06 +description: Узнайте, как вывести список поддерживаемых форматов документов и определить + расширение файлов с помощью GroupDocs.Editor для .NET. Пошаговое руководство с примерами + кода, быстрыми ответами и часто задаваемыми вопросами. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Список поддерживаемых форматов документов +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Узнайте, как использовать GroupDocs.Editor для .NET для программного редактирования документов различных форматов. Пошаговое руководство с примерами для бесшовной интеграции. -weight: 13 -url: /ru/net/document-processing/work-document-formats/ +title: Список поддерживаемых форматов документов с GroupDocs.Editor .NET type: docs +url: /ru/net/document-processing/work-document-formats/ +weight: 13 --- -# Работа с форматами документов - -## Введение -Добро пожаловать в наше подробное руководство по использованию GroupDocs.Editor для .NET! Если вы разработчик, желающий расширить свои приложения возможностями редактирования документов, вы попали по адресу. В этой статье вы узнаете все, что вам нужно знать, от предварительных условий до практических примеров, чтобы начать работу с этой мощной библиотекой. -## Предварительные условия -Прежде чем углубляться в примеры и функциональные возможности GroupDocs.Editor для .NET, необходимо выполнить несколько предварительных условий: -1. Базовое понимание .NET. Знание .NET Framework или .NET Core необходимо. -2. Среда разработки: Visual Studio или любая другая подходящая .NET IDE. -3. GroupDocs.Editor для библиотеки .NET: загрузите библиотеку из[Страница выпусков GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Временная лицензия: получите[временная лицензия](https://purchase.groupdocs.com/temporary-license/) для полных функций. -## Импортировать пространства имен -Чтобы начать работу с GroupDocs.Editor для .NET, вам необходимо импортировать необходимые пространства имен в ваш проект. Это обеспечит вам доступ ко всем классам и методам, предоставляемым библиотекой. + +# Список поддерживаемых форматов документов + +Добро пожаловать в наш подробный учебник о **how to list supported document formats** с GroupDocs.Editor для .NET. Независимо от того, создаёте ли вы веб‑приложение, ориентированное на документы, или корпоративный настольный инструмент, знание точных форматов, которые вы можете редактировать или конвертировать, имеет решающее значение. В этом руководстве вы узнаете, как перечислять форматы, разбирать расширения и редактировать документы — всё с понятными, человеко‑дружелюбными объяснениями и готовыми к запуску фрагментами кода. + +## Быстрые ответы +- **Как перечислить все поддерживаемые форматы?** Используйте `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (или эквиваленты для Presentation/Spreadsheet) и пройдитесь по коллекции. +- **Могу ли я определить формат по расширению файла?** Да — вызовите `DocumentFormatInfo.FromExtension(".docx")`. +- **Какие типы файлов поддерживает GroupDocs.Editor?** Более 30 форматов ввода и вывода, включая DOCX, XLSX, PPTX, HTML и обычный текст. +- **Нужна ли лицензия для получения списка форматов?** Временная лицензия разблокирует полный API; в противном случае пробная версия работает с ограниченными возможностями. +- **Какие версии .NET совместимы?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Что означает «list supported document formats»? +Фраза относится к программному получению коллекции типов файлов, которые GroupDocs.Editor может открыть, отредактировать и сохранить. Эта операция позволяет создавать динамические выпадающие списки в пользовательском интерфейсе или проверять загружаемые пользователем файлы до их обработки, гарантируя, что только совместимые файлы передаются редактору для дальнейшего манипулирования. + +## Почему нужно перечислять поддерживаемые форматы документов? +GroupDocs.Editor **поддерживает более 30 форматов ввода и вывода** и может обрабатывать файлы размером до **2 ГБ**, не загружая весь документ в память. Точное знание списка предотвращает ошибки выполнения, улучшает пользовательский опыт и позволяет применять бизнес‑правила, такие как «разрешать только редактируемые документы Office». Это также помогает показывать пользователям только те форматы, которые действительно поддерживает ваше приложение. + +## Требования +1. **Среда разработки .NET** — Visual Studio 2022 или любая IDE, поддерживающая .NET 6+. +2. **Библиотека GroupDocs.Editor для .NET** — загрузите с [страницы выпусков GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Временная лицензия** — получите [временную лицензию](https://purchase.groupdocs.com/temporary-license/) для неограниченного доступа. +4. **Базовые знания C#** — знакомство с пространствами имён, инструкциями `using` и выводом в консоль. + +## Как перечислить поддерживаемые форматы документов? +Загрузите коллекцию поддерживаемых форматов и выведите имя и расширение каждого формата. Этот двухшаговый шаблон работает для документов Word, Spreadsheet и Presentation. Перебирая коллекцию, вы можете динамически заполнять элементы UI, такие как выпадающие списки, гарантируя, что пользователи могут выбирать только форматы, действительно поддерживаемые редактором. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` -## Шаг 1. Работа с форматами документов -GroupDocs.Editor поддерживает широкий спектр форматов документов. Давайте рассмотрим, как составить список всех поддерживаемых форматов обработки текстов и презентаций. ### Перечисление форматов обработки текста +`Formats.WordProcessingFormats` — перечисление, описывающее каждый тип файлов обработки текста, распознаваемый редактором. Свойство `All` возвращает коллекцию этих объектов форматов. + +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Объяснение: -1. Прохождение форматов: мы просматриваем все доступные форматы обработки текста. -2. Подробности выходного формата: для каждого формата мы печатаем его имя и расширение. -### Перечисление форматов представления +``` + +**Объяснение:** +1. **Перебор форматов:** Мы проходим по всем доступным форматам обработки текста. +2. **Вывод деталей формата:** Для каждого формата мы выводим его читаемое название и расширение по умолчанию. + +### Перечисление форматов презентаций +`Formats.PresentationFormats` работает аналогично для файлов презентаций, предоставляя каждый поддерживаемый тип через коллекцию `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Объяснение: -1. Циклическое перебор форматов. Подобно форматам обработки текстов, мы просматриваем все форматы презентаций. -2. Подробности о выходном формате: напечатайте имя и расширение каждого формата. -## Шаг 2. Анализ форматов из расширений -Иногда вам нужно определить формат на основе расширения файла. GroupDocs.Editor упрощает эту задачу. -### Анализ форматов электронных таблиц +``` + +**Объяснение:** +1. **Перебор форматов:** Та же логика перебора применяется к презентациям. +2. **Вывод деталей формата:** Имя и расширение отображаются для каждого формата. + +## Как определить расширение формата файла? +Иногда у вас есть только имя файла, и нужно определить соответствующий `DocumentFormat`. GroupDocs.Editor предлагает простой статический помощник, который сопоставляет расширение файла его внутреннему представлению формата, позволяя проверять или конвертировать файлы до их загрузки в редактор. + +### Разбор форматов электронных таблиц +`Formats.SpreadsheetFormats.FromExtension` преобразует строку расширения файла в соответствующее значение перечисления формата таблицы. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Объяснение: -1. Формат анализа: мы используем`FromExtension` метод для анализа формата из`.xlsm` расширение. -2. Формат вывода: напечатайте имя проанализированного формата. -### Анализ текстовых форматов +``` + +**Объяснение:** +1. **Разбор формата:** `FromExtension` преобразует расширение `.xlsm` во внутреннее перечисление `SpreadsheetFormat`. +2. **Вывод формата:** Выводится имя разобранного формата, подтверждая соответствие. + +### Разбор текстовых форматов +Аналогично, `Formats.TextualFormats.FromExtension` определяет текстовые расширения, такие как HTML или TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Объяснение: -1. Формат анализа:`FromExtension` метод используется для анализа формата из`html` расширение. -2. Выходной формат: выведите имя анализируемого текстового формата. -## Шаг 3: Редактирование документов -Теперь, когда мы увидели, как работать с форматами, давайте углубимся в редактирование документов с помощью GroupDocs.Editor. +``` + +**Объяснение:** +1. **Разбор формата:** Метод `FromExtension` определяет расширение `html` как `TextFormat`. +2. **Вывод формата:** Отображается название текстового формата, полезное для веб‑редакторов. + +## Как редактировать документы после определения форматов? +После того как вы знаете формат, загрузка и редактирование документа следуют единому шаблону. Сначала создаётся экземпляр `Editor` с путём к исходному файлу, затем вызывается `Edit()`, получая `EditableDocument`. Далее можно читать, изменять и, наконец, сохранять содержимое, используя соответствующие `SaveOptions`. + ### Загрузка документа -Чтобы отредактировать документ, его сначала необходимо загрузить. +`Editor` — основной класс, инкапсулирующий все операции редактирования для данного файла. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Дальнейшие шаги будут описаны здесь. + // Further steps will be covered here. } ``` -Объяснение: -1. Инициализируйте редактор: создайте экземпляр`Editor` класс, указав путь к вашему документу. -2. Шаблон утилизации: используйте`using` заявление, обеспечивающее правильное использование ресурсов. -### Извлечение контента -После загрузки документа вы можете извлечь его содержимое для редактирования. +``` + +**Объяснение:** +1. **Инициализация Editor:** Создайте экземпляр `Editor`, передав полный путь к целевому файлу. +2. **Шаблон освобождения:** Оператор `using` гарантирует своевременное освобождение всех неуправляемых ресурсов. + +### Извлечение содержимого +`EditableDocument.GetContent()` возвращает необработанный текст документа (или HTML для веб‑редакторов), который можно отобразить или изменить. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Объяснение: -1. Метод редактирования: вызвать`Edit` метод получения`EditableDocument`. -2. Получить контент: использовать`GetContent` для получения содержимого документа в виде строки. -3. Выходное содержимое: распечатайте содержимое на консоль. +``` + +**Объяснение:** +1. **Метод Edit:** `Edit()` возвращает объект `EditableDocument`. +2. **Получить содержимое:** `GetContent()` извлекает необработанный текст документа (или HTML для веб‑редакторов). +3. **Вывод содержимого:** Содержимое выводится в консоль для проверки. + ### Сохранение изменений -После редактирования сохраните изменения обратно в документ. +`SaveOptions` указывает редактору, как и в каком формате записать отредактированный документ обратно в хранилище. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Измените содержимое здесь + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Объяснение: -1. Метод редактирования: вызвать`Edit` метод получения`EditableDocument`. -2. Изменить содержимое: измените содержимое по мере необходимости (не показано в этом фрагменте). -3. Параметры сохранения: Создать`SaveOptions` указав формат. -4. Сохранить документ: используйте`Save` метод сохранения отредактированного документа. -## Шаг 4. Работа с различными типами документов -GroupDocs.Editor поддерживает различные типы документов. Вот как с ними работать: -### Редактирование табличных документов +``` + +**Объяснение:** +1. **Метод Edit:** Снова получаем `EditableDocument` после внесения изменений. +2. **Изменить содержимое:** Примените изменения к строке (не показано здесь). +3. **Параметры сохранения:** Настройте `SaveOptions` с нужным форматом вывода. +4. **Сохранить документ:** Сохраните отредактированный файл обратно на диск. + +## Как работать с различными типами документов? +GroupDocs.Editor абстрагирует работу с Word, Spreadsheet и Presentation за единым API, что упрощает переключение контекстов без необходимости изучать отдельный набор классов для каждой семейства документов. + +### Редактирование документов электронных таблиц +`SpreadsheetSaveOptions` определяет, как записывается таблица, включая формат и необязательные параметры сжатия. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Измените содержимое здесь + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Объяснение: -1. Инициализируйте редактор: создайте`Editor` экземпляр для электронной таблицы. -2. Метод редактирования: Вызов`Edit` чтобы получить`EditableDocument`. -3. Получить контент: получить и распечатать контент. -4. Изменить содержимое: внесите необходимые изменения. -5. Параметры сохранения: укажите параметры сохранения электронных таблиц. -6. Сохранить документ: сохранить измененный документ. -### Редактирование документов презентации +``` + +**Объяснение:** +1. **Инициализация Editor:** Передайте путь к файлу электронной таблицы в конструктор `Editor`. +2. **Метод Edit:** Получите `EditableDocument`. +3. **Получить содержимое:** Выведите CSV‑представление таблицы (или HTML). +4. **Изменить содержимое:** Примените необходимые изменения на уровне ячеек. +5. **Параметры сохранения:** Выберите соответствующий `SpreadsheetSaveOptions`. +6. **Сохранить документ:** Запишите обновлённую таблицу обратно в хранилище. + +### Редактирование документов презентаций +`PresentationSaveOptions` управляет форматом вывода для наборов слайдов, позволяя сохранять оригинальный тип файла или менять его. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Измените содержимое здесь + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Объяснение: -1. Инициализируйте редактор: создайте`Editor` экземпляр для презентации. -2. Метод редактирования: Вызов`Edit` чтобы получить`EditableDocument`. -3. Получить контент: получить и распечатать контент. -4. Изменить содержимое: внесите необходимые изменения. -5. Параметры сохранения: укажите параметры сохранения презентаций. -6. Сохранить документ: сохранить измененный документ. -## Заключение -GroupDocs.Editor для .NET предоставляет надежный и гибкий способ программного редактирования различных форматов документов. Следуя этому руководству, вы сможете эффективно интегрировать функции редактирования документов в свои приложения .NET, расширяя их возможности и обеспечивая большую ценность для ваших пользователей. +``` + +**Объяснение:** +1. **Инициализация Editor:** Загрузите файл PowerPoint через `Editor`. +2. **Метод Edit:** Получите `EditableDocument`. +3. **Получить содержимое:** Извлеките HTML слайдов или обычный текст. +4. **Изменить содержимое:** Обновите заголовки, маркеры или изображения. +5. **Параметры сохранения:** Используйте `PresentationSaveOptions` для определения формата вывода. +6. **Сохранить документ:** Сохраните отредактированную презентацию. + +## Распространённые проблемы и решения +- **Ошибка «Format not supported»:** Убедитесь, что используете последнюю версию GroupDocs.Editor; она регулярно добавляет поддержку новых форматов Office. +- **Большое потребление памяти файлом:** Включите режим потоковой передачи, установив `EditorSettings.EnableStreaming = true` перед загрузкой документа. +- **Лицензия не применена:** Убедитесь, что файл временной лицензии находится в корне приложения или загружен через `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## Часто задаваемые вопросы -### Что такое GroupDocs.Editor для .NET? -GroupDocs.Editor для .NET — это мощная библиотека, которая позволяет разработчикам программно редактировать различные форматы документов в своих приложениях .NET. -### Как начать работу с GroupDocs.Editor для .NET? -Вам необходимо загрузить библиотеку, получить временную лицензию и настроить среду разработки с необходимыми пространствами имен. -### Какие форматы документов поддерживаются? -GroupDocs.Editor поддерживает, среди прочего, текстовые форматы, электронные таблицы, презентации и текстовые форматы. -### Могу ли я использовать GroupDocs.Editor бесплатно? - Вы можете использовать[бесплатная пробная версия](https://releases.groupdocs.com/) с ограниченными возможностями или получить[временная лицензия](https://purchase.groupdocs.com/temporary-license/) для полного доступа. -### Где я могу найти дополнительные ресурсы и поддержку? - Посетить[Документация GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) для получения подробной информации или ознакомьтесь с их[форум поддержки](https://forum.groupdocs.com/c/editor/20) для помощи. \ No newline at end of file + +**Q: В чём разница между `DocumentFormatInfo` и `SaveOptions`?** +A: `DocumentFormatInfo` предоставляет метаданные о поддерживаемых типах файлов, тогда как `SaveOptions` настраивает, как документ будет записан обратно на диск (формат, сжатие и т.д.). + +**Q: Можно ли вывести список форматов для пользовательского расширения файла?** +A: Да — используйте `DocumentFormatInfo.FromExtension("yourExt")`; если расширение не распознано, метод вернёт `null`. + +**Q: Поддерживает ли GroupDocs.Editor файлы, защищённые паролем?** +A: Абсолютно. Передайте пароль в конструктор `Editor` через `EditorSettings`, чтобы открыть зашифрованные документы. + +**Q: Сколько форматов действительно поддерживает GroupDocs.Editor?** +A: Более **30 форматов ввода и вывода**, охватывающих Word, Excel, PowerPoint, HTML и обычный текст. + +**Q: Есть ли способ ограничить список только редактируемыми форматами?** +A: Используйте `GetEditableWordProcessingFormats()` (или эквиваленты для Spreadsheet/Presentation), чтобы получить форматы, позволяющие полное редактирование. + +## Дополнительные ресурсы +- Скачайте библиотеку с [страницы выпусков GroupDocs](https://releases.groupdocs.com/editor/net/). +- Получите [временную лицензию](https://purchase.groupdocs.com/temporary-license/) для полного доступа к функциям. +- Попробуйте продукт с [бесплатной пробной версией](https://releases.groupdocs.com/). +- Изучите подробные примеры использования в [документации GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Получите помощь от сообщества на [форуме поддержки](https://forum.groupdocs.com/c/editor/20). + +## Заключение +Следуя этому руководству, вы теперь знаете, как **перечислять поддерживаемые форматы документов**, **определять формат файла по его расширению** и **редактировать документы** в форматах Word, Spreadsheet и Presentation с помощью GroupDocs.Editor для .NET. Внедрите эти фрагменты кода в свои проекты, чтобы создавать надёжные, ориентированные на форматы приложения, радующие конечных пользователей и снижающие количество ошибок выполнения. + +--- + +**Последнее обновление:** 2026-06-06 +**Тестировано с:** GroupDocs.Editor 23.9 for .NET +**Автор:** GroupDocs + +## Связанные руководства + +- [Освоение загрузки документов в .NET с GroupDocs.Editor: Полное руководство](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Мастер‑редактирование документов в .NET с GroupDocs.Editor: Полное руководство](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Конвертация Word в HTML с помощью GroupDocs.Editor .NET: Пошаговое руководство](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/spanish/net/document-processing/work-document-formats/_index.md b/content/spanish/net/document-processing/work-document-formats/_index.md index 3e76654e..46f81d53 100644 --- a/content/spanish/net/document-processing/work-document-formats/_index.md +++ b/content/spanish/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Trabajar con formatos de documentos -linktitle: Trabajar con formatos de documentos -second_title: API GroupDocs.Editor .NET -description: Aprenda a utilizar GroupDocs.Editor para .NET para editar varios formatos de documentos mediante programación. Guía paso a paso con ejemplos para una integración perfecta. -weight: 13 -url: /es/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Aprenda cómo listar los formatos de documento compatibles y determinar + la extensión del formato de archivo usando GroupDocs.Editor para .NET. Guía paso + a paso con fragmentos de código, respuestas rápidas y preguntas frecuentes. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Listar formatos de documento compatibles +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Listar formatos de documento compatibles con GroupDocs.Editor .NET type: docs +url: /es/net/document-processing/work-document-formats/ +weight: 13 --- -# Trabajar con formatos de documentos -## Introducción -¡Bienvenido a nuestra guía detallada sobre el uso de GroupDocs.Editor para .NET! Si es un desarrollador que busca mejorar sus aplicaciones con capacidades de edición de documentos, ha venido al lugar correcto. Este artículo le guiará a través de todo lo que necesita saber, desde requisitos previos hasta ejemplos prácticos, para que pueda empezar a utilizar esta poderosa biblioteca. +# Enumerar formatos de documento compatibles + +Bienvenido a nuestro tutorial completo sobre **cómo enumerar los formatos de documento compatibles** con GroupDocs.Editor para .NET. Ya sea que estés construyendo una aplicación web centrada en documentos o una herramienta de escritorio de nivel empresarial, conocer exactamente qué formatos puedes editar o convertir es esencial. En esta guía descubrirás cómo enumerar formatos, analizar extensiones y editar documentos, todo con explicaciones claras y amigables y fragmentos de código listos para ejecutar. + +## Respuestas rápidas +- **¿Cómo enumero todos los formatos compatibles?** Usa `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (o los equivalentes para Presentation/Spreadsheet) e itera la colección. +- **¿Puedo determinar un formato a partir de una extensión de archivo?** Sí—llama a `DocumentFormatInfo.FromExtension(".docx")`. +- **¿Qué tipos de archivo admite GroupDocs.Editor?** Más de 30 formatos de entrada y salida, incluidos DOCX, XLSX, PPTX, HTML y texto plano. +- **¿Necesito una licencia para enumerar formatos?** Una licencia temporal desbloquea la API completa; de lo contrario, una versión de prueba funciona con funciones limitadas. +- **¿Qué versiones de .NET son compatibles?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## ¿Qué es “enumerar formatos de documento compatibles”? +La frase se refiere a obtener programáticamente la colección de tipos de archivo que GroupDocs.Editor puede abrir, editar y guardar. Esta operación te permite crear menús desplegables dinámicos en la UI o validar las cargas de usuarios antes del procesamiento, garantizando que solo se pasen archivos compatibles al editor para su manipulación posterior. + +## ¿Por qué enumerar formatos de documento compatibles? +GroupDocs.Editor **admite más de 30 formatos de entrada y salida** y puede manejar archivos de hasta **2 GB** sin cargar todo el documento en memoria. Conocer la lista exacta evita errores en tiempo de ejecución, mejora la experiencia del usuario y te permite aplicar reglas de negocio como “solo permitir documentos de Office editables”. También ayuda a presentar a los usuarios únicamente los formatos que tu aplicación realmente soporta. + ## Requisitos previos -Antes de profundizar en los ejemplos y funcionalidades de GroupDocs.Editor para .NET, existen algunos requisitos previos que debe cumplir: -1. Comprensión básica de .NET: la familiaridad con .NET Framework o .NET Core es esencial. -2. Entorno de desarrollo: Visual Studio o cualquier otro .NET IDE adecuado. -3. GroupDocs.Editor para biblioteca .NET: descargue la biblioteca desde[Página de lanzamientos de GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Licencia Temporal: Obtener una[licencia temporal](https://purchase.groupdocs.com/temporary-license/) para funciones completas. -## Importar espacios de nombres -Para comenzar con GroupDocs.Editor para .NET, debe importar los espacios de nombres necesarios a su proyecto. Esto asegurará que tenga acceso a todas las clases y métodos proporcionados por la biblioteca. +Antes de comenzar, asegúrate de tener: + +1. **Entorno de desarrollo .NET** – Visual Studio 2022 o cualquier IDE que soporte .NET 6+. +2. **Biblioteca GroupDocs.Editor para .NET** – descárgala desde la [página de lanzamientos de GroupDocs](https://releases.groupdocs.com/editor/net/). +3. **Licencia temporal** – obtén una [licencia temporal](https://purchase.groupdocs.com/temporary-license/) para acceso sin restricciones. +4. **Conocimientos básicos de C#** – familiaridad con espacios de nombres, sentencias `using` y salida a consola. + +## ¿Cómo enumerar formatos de documento compatibles? +Carga la colección de formatos compatibles e imprime el nombre y la extensión de cada formato. Este patrón de dos pasos funciona para documentos de procesamiento de texto, hoja de cálculo y presentación. Al iterar la colección puedes poblar dinámicamente elementos de UI como menús desplegables, garantizando que los usuarios solo seleccionen formatos que el editor realmente puede manejar. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Enumerar formatos de procesamiento de texto +`Formats.WordProcessingFormats` es una enumeración que describe cada tipo de archivo de procesamiento de texto reconocido por el editor. La propiedad `All` devuelve una colección de estos objetos de formato. -## Paso 1: trabajar con formatos de documentos -GroupDocs.Editor admite una amplia gama de formatos de documentos. Exploremos cómo puede enumerar todos los formatos de presentación y procesamiento de textos compatibles. -### Listado de formatos de procesamiento de textos +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explicación: -1. Recorrer formatos: recorremos todos los formatos de procesamiento de textos disponibles. -2. Detalles del formato de salida: para cada formato, imprimimos su nombre y extensión. -### Listado de formatos de presentación +``` + +**Explicación:** +1. **Recorrer formatos:** Iteramos todos los formatos de procesamiento de texto disponibles. +2. **Mostrar detalles del formato:** Para cada formato imprimimos su nombre amigable y su extensión de archivo predeterminada. + +### Enumerar formatos de presentación +`Formats.PresentationFormats` funciona de la misma manera para archivos de diapositivas, exponiendo cada tipo de presentación soportado a través de la colección `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Explicación: -1. Recorrer formatos: similar a los formatos de procesamiento de textos, recorremos todos los formatos de presentación. -2. Detalles del formato de salida: Imprima el nombre y la extensión de cada formato. -## Paso 2: analizar formatos a partir de extensiones -A veces, es necesario determinar el formato en función de la extensión del archivo. GroupDocs.Editor lo hace fácil. -### Análisis de formatos de hojas de cálculo +``` + +**Explicación:** +1. **Recorrer formatos:** La misma lógica de iteración se aplica a presentaciones. +2. **Mostrar detalles del formato:** Se muestra el nombre y la extensión de cada formato. + +## ¿Cómo determinar la extensión del formato de archivo? +A veces solo dispones del nombre de un archivo y necesitas inferir el `DocumentFormat` correspondiente. GroupDocs.Editor ofrece un asistente estático sencillo que asigna una extensión de archivo a su representación interna de formato, permitiéndote validar o convertir archivos antes de cargarlos en el editor. + +### Analizando formatos de hoja de cálculo +`Formats.SpreadsheetFormats.FromExtension` convierte una cadena de extensión de archivo en el valor de enumeración de formato de hoja de cálculo correspondiente. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Explicación: -1. Formato de análisis: utilizamos el`FromExtension` método para analizar el formato desde el`.xlsm` extensión. -2. Formato de salida: imprime el nombre del formato analizado. -### Análisis de formatos textuales +``` + +**Explicación:** +1. **Analizar formato:** `FromExtension` convierte la extensión `.xlsm` en su enumeración interna `SpreadsheetFormat`. +2. **Mostrar formato:** Se imprime el nombre del formato analizado, confirmando la asignación. + +### Analizando formatos textuales +De manera similar, `Formats.TextualFormats.FromExtension` resuelve extensiones de archivo textuales como HTML o TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Explicación: -1. Formato de análisis: el`FromExtension` El método se utiliza para analizar el formato desde el`html` extensión. -2. Formato de salida: imprime el nombre del formato de texto analizado. -## Paso 3: editar documentos -Ahora que hemos visto cómo trabajar con formatos, profundicemos en la edición de documentos usando GroupDocs.Editor. +``` + +**Explicación:** +1. **Analizar formato:** El método `FromExtension` resuelve la extensión `html` a un `TextFormat`. +2. **Mostrar formato:** Se muestra el nombre del formato textual, útil para editores basados en web. + +## ¿Cómo editar documentos después de identificar los formatos? +Una vez que conoces el formato, cargar y editar un documento sigue un patrón consistente. Primero creas una instancia de `Editor` con la ruta al archivo fuente, luego llamas a `Edit()` para obtener un `EditableDocument`. Desde allí puedes leer, modificar y, finalmente, guardar el contenido usando los `SaveOptions` apropiados. + ### Cargando un documento -Para editar un documento, primero debe cargarlo. +`Editor` es la clase central que encapsula todas las operaciones de edición para un archivo dado. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Aquí se cubrirán más pasos. + // Further steps will be covered here. } ``` -Explicación: -1. Inicializar editor: crea una instancia del`Editor` clase, proporcionando la ruta a su documento. -2. Patrón de eliminación: use el`using` declaración para garantizar que los recursos se eliminen adecuadamente. +``` + +**Explicación:** +1. **Inicializar Editor:** Crea una instancia de `Editor`, pasando la ruta completa del archivo objetivo. +2. **Patrón Dispose:** La instrucción `using` garantiza que todos los recursos no administrados se liberen de inmediato. + ### Extrayendo contenido -Una vez cargado el documento, puede extraer su contenido para editarlo. +`EditableDocument.GetContent()` devuelve el texto bruto del documento (o HTML para editores basados en web), que puedes mostrar o manipular. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Explicación: -1. Método de edición: llame al`Edit` método para obtener un`EditableDocument`. -2. Obtener contenido: usar`GetContent` para recuperar el contenido del documento como una cadena. -3. Contenido de salida: imprime el contenido en la consola. +``` + +**Explicación:** +1. **Método Edit:** `Edit()` devuelve un objeto `EditableDocument`. +2. **Obtener contenido:** `GetContent()` extrae el texto bruto del documento (o HTML para editores web). +3. **Mostrar contenido:** El contenido se escribe en la consola para verificación. + ### Guardando cambios -Después de editar, guarde los cambios nuevamente en el documento. +`SaveOptions` indica al editor cómo y en qué formato escribir el documento editado de vuelta al almacenamiento. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Modificar contenido aquí + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Explicación: -1. Método de edición: llame al`Edit` método para obtener un`EditableDocument`. -2. Modificar contenido: modifique el contenido según sea necesario (no se muestra en este fragmento). -3. Opciones de guardar: crear`SaveOptions` especificando el formato. -4. Guardar documento: utilice el`Save` método para guardar el documento editado. -## Paso 4: trabajar con diferentes tipos de documentos -GroupDocs.Editor admite varios tipos de documentos. A continuación se explica cómo trabajar con ellos: -### Edición de documentos de hoja de cálculo +``` + +**Explicación:** +1. **Método Edit:** Vuelve a obtener el `EditableDocument` después de las modificaciones. +2. **Modificar contenido:** Aplica tus cambios a la cadena (no mostrado aquí). +3. **Opciones de guardado:** Configura `SaveOptions` con el formato de salida deseado. +4. **Guardar documento:** Persiste el archivo editado en disco. + +## ¿Cómo trabajar con diferentes tipos de documento? +GroupDocs.Editor abstrae el manejo de Word, Spreadsheet y Presentation detrás de la misma superficie API, facilitando el cambio de contexto sin aprender un nuevo conjunto de clases para cada familia de documentos. + +### Editando documentos de hoja de cálculo +`SpreadsheetSaveOptions` define cómo se escribe una hoja de cálculo, incluyendo el formato y configuraciones opcionales de compresión. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modificar contenido aquí + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Explicación: -1. Inicializar editor: crear un`Editor` ejemplo para una hoja de cálculo. -2. Método de edición: llamada`Edit` para conseguir un`EditableDocument`. -3. Obtener contenido: recupere e imprima el contenido. -4. Modificar contenido: realice los cambios necesarios. -5. Opciones de guardado: especifique opciones de guardado para hojas de cálculo. -6. Guardar documento: guarda el documento modificado. -### Edición de documentos de presentación +``` + +**Explicación:** +1. **Inicializar Editor:** Pasa la ruta de un archivo de hoja de cálculo al constructor de `Editor`. +2. **Método Edit:** Obtén un `EditableDocument`. +3. **Obtener contenido:** Imprime la representación CSV (o HTML) de la hoja de cálculo. +4. **Modificar contenido:** Aplica los cambios a nivel de celda que necesites. +5. **Opciones de guardado:** Elige el `SpreadsheetSaveOptions` adecuado. +6. **Guardar documento:** Escribe la hoja de cálculo actualizada en el almacenamiento. + +### Editando documentos de presentación +`PresentationSaveOptions` controla el formato de salida para los paquetes de diapositivas, permitiéndote preservar o cambiar el tipo de archivo original. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Modificar contenido aquí + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Explicación: -1. Inicializar editor: crear un`Editor` instancia para una presentación. -2. Método de edición: llamada`Edit` para conseguir un`EditableDocument`. -3. Obtener contenido: recupere e imprima el contenido. -4. Modificar contenido: realice los cambios necesarios. -5. Opciones de guardado: especifique opciones de guardado para presentaciones. -6. Guardar documento: guarda el documento modificado. -## Conclusión -GroupDocs.Editor para .NET proporciona una forma sólida y flexible de editar varios formatos de documentos mediante programación. Si sigue esta guía, podrá integrar eficientemente funcionalidades de edición de documentos en sus aplicaciones .NET, mejorando sus capacidades y brindando mayor valor a sus usuarios. +``` + +**Explicación:** +1. **Inicializar Editor:** Carga un archivo PowerPoint mediante `Editor`. +2. **Método Edit:** Obtén un `EditableDocument`. +3. **Obtener contenido:** Extrae el HTML de las diapositivas o texto plano. +4. **Modificar contenido:** Actualiza títulos, viñetas o imágenes. +5. **Opciones de guardado:** Usa `PresentationSaveOptions` para definir el formato de salida. +6. **Guardar documento:** Persiste la presentación editada. + +## Problemas comunes y soluciones +- **Error “Formato no soportado”:** Verifica que estés usando la última versión de GroupDocs.Editor; agrega soporte para nuevos formatos de Office de forma regular. +- **Alto consumo de memoria con archivos grandes:** Habilita el modo de transmisión estableciendo `EditorSettings.EnableStreaming = true` antes de cargar el documento. +- **Licencia no aplicada:** Asegúrate de que el archivo de licencia temporal esté en la raíz de la aplicación o cárgalo mediante `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## Preguntas frecuentes -### ¿Qué es GroupDocs.Editor para .NET? -GroupDocs.Editor para .NET es una poderosa biblioteca que permite a los desarrolladores editar varios formatos de documentos mediante programación dentro de sus aplicaciones .NET. -### ¿Cómo empiezo a utilizar GroupDocs.Editor para .NET? -Debe descargar la biblioteca, obtener una licencia temporal y configurar su entorno de desarrollo con los espacios de nombres necesarios. -### ¿Qué formatos de documentos son compatibles? -GroupDocs.Editor admite formatos de procesamiento de textos, hojas de cálculo, presentaciones y textos, entre otros. -### ¿Puedo utilizar GroupDocs.Editor gratis? - Puedes usar un[prueba gratis](https://releases.groupdocs.com/) con funciones limitadas u obtener una[licencia temporal](https://purchase.groupdocs.com/temporary-license/) para acceso completo. -### ¿Dónde puedo encontrar más recursos y soporte? - Visita el[Documentación de GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) para obtener información detallada, o consulte su[Foro de soporte](https://forum.groupdocs.com/c/editor/20) por ayuda. \ No newline at end of file + +**P: ¿Cuál es la diferencia entre `DocumentFormatInfo` y `SaveOptions`?** +R: `DocumentFormatInfo` proporciona metadatos sobre los tipos de archivo soportados, mientras que `SaveOptions` configura cómo se escribe un documento de vuelta al disco (formato, compresión, etc.). + +**P: ¿Puedo enumerar formatos para una extensión de archivo personalizada?** +R: Sí—usa `DocumentFormatInfo.FromExtension("yourExt")`; si la extensión no se reconoce, el método devuelve `null`. + +**P: ¿GroupDocs.Editor admite archivos protegidos con contraseña?** +R: Absolutamente. Pasa la contraseña al constructor de `Editor` mediante `EditorSettings` para abrir documentos cifrados. + +**P: ¿Cuántos formatos admite realmente GroupDocs.Editor?** +R: Más de **30 formatos de entrada y salida**, abarcando Word, Excel, PowerPoint, HTML y texto plano. + +**P: ¿Existe una forma de limitar la lista solo a formatos editables?** +R: Usa `GetEditableWordProcessingFormats()` (o los equivalentes para Spreadsheet/Presentation) para obtener los formatos que permiten capacidades completas de edición. + +## Recursos adicionales +- Descarga la biblioteca desde la [página de lanzamientos de GroupDocs](https://releases.groupdocs.com/editor/net/). +- Obtén una [licencia temporal](https://purchase.groupdocs.com/temporary-license/) para acceso completo a todas las funciones. +- Prueba el producto con una [prueba gratuita](https://releases.groupdocs.com/). +- Explora ejemplos de uso detallados en la [documentación de GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/). +- Obtén ayuda de la comunidad en el [foro de soporte](https://forum.groupdocs.com/c/editor/20). + +## Conclusión +Al seguir esta guía ahora sabes cómo **enumerar los formatos de documento compatibles**, **determinar un formato de archivo a partir de su extensión** y **editar documentos** en los tipos Word, Spreadsheet y Presentation usando GroupDocs.Editor para .NET. Incorpora estos fragmentos en tus propios proyectos para crear aplicaciones robustas, conscientes de los formatos, que deleiten a los usuarios finales y reduzcan errores en tiempo de ejecución. + +--- + +**Última actualización:** 2026-06-06 +**Probado con:** GroupDocs.Editor 23.9 para .NET +**Autor:** GroupDocs + +## Tutoriales relacionados + +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Master Document Editing in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Convert Word to HTML Using GroupDocs.Editor .NET: A Step‑By‑Step Guide](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/swedish/net/document-processing/work-document-formats/_index.md b/content/swedish/net/document-processing/work-document-formats/_index.md index 0d48d87a..3cc3e337 100644 --- a/content/swedish/net/document-processing/work-document-formats/_index.md +++ b/content/swedish/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Arbeta med dokumentformat -linktitle: Arbeta med dokumentformat +date: 2026-06-06 +description: Lär dig hur du listar stödda dokumentformat och bestämmer filformatets + filändelse med GroupDocs.Editor för .NET. Step‑by‑step guide med code snippets, + quick answers, och FAQs. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Lista stödda dokumentformat +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Lär dig hur du använder GroupDocs.Editor för .NET för att redigera olika dokumentformat programmatiskt. Steg-för-steg guide med exempel för sömlös integration. -weight: 13 -url: /sv/net/document-processing/work-document-formats/ +title: Lista stödda dokumentformat med GroupDocs.Editor .NET type: docs +url: /sv/net/document-processing/work-document-formats/ +weight: 13 --- -# Arbeta med dokumentformat -## Introduktion -Välkommen till vår djupgående guide om hur du använder GroupDocs.Editor för .NET! Om du är en utvecklare som vill förbättra dina applikationer med dokumentredigeringsfunktioner, har du kommit till rätt plats. Den här artikeln kommer att gå igenom allt du behöver veta, från förutsättningar till praktiska exempel, för att komma igång med detta kraftfulla bibliotek. +# Lista stödda dokumentformat + +Välkommen till vår omfattande handledning om **hur man listar stödda dokumentformat** med GroupDocs.Editor för .NET. Oavsett om du bygger en dokument‑centrerad webbapp eller ett företags‑klassat skrivbordsverktyg, är det viktigt att veta exakt vilka format du kan redigera eller konvertera. I den här guiden kommer du att upptäcka hur du enumererar format, parsar filändelser och redigerar dokument — allt med tydliga, användar‑vänliga förklaringar och färdiga kodexempel. + +## Snabba svar +- **Hur listar jag alla stödda format?** Använd `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (eller motsvarande för Presentation/Spreadsheet) och iterera samlingen. +- **Kan jag avgöra ett format från en filändelse?** Ja — anropa `DocumentFormatInfo.FromExtension(".docx")`. +- **Vilka filtyper stöder GroupDocs.Editor?** Över 30 in- och utdataformat, inklusive DOCX, XLSX, PPTX, HTML och vanlig text. +- **Behöver jag en licens för att lista format?** En tillfällig licens låser upp hela API:et; annars fungerar en provversion med begränsade funktioner. +- **Vilka .NET-versioner är kompatibla?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## Vad betyder “lista stödda dokumentformat”? +Frasen avser att programatiskt hämta samlingen av filtyper som GroupDocs.Editor kan öppna, redigera och spara. Denna operation låter dig bygga dynamiska UI‑rullgardinsmenyer eller validera användaruppladdningar innan de bearbetas, vilket säkerställer att endast kompatibla filer skickas till editorn för vidare manipulation. + +## Varför lista stödda dokumentformat? +GroupDocs.Editor **stödjer 30+ in- och utdataformat** och kan hantera filer upp till **2 GB** utan att ladda hela dokumentet i minnet. Att känna till den exakta listan förhindrar körfel, förbättrar användarupplevelsen och gör det möjligt att upprätthålla affärsregler såsom “tillåt endast redigerbara Office‑dokument.” Det hjälper också att visa användarna endast de format som din applikation faktiskt stödjer. + ## Förutsättningar -Innan du dyker in i exemplen och funktionerna i GroupDocs.Editor för .NET, finns det några förutsättningar du måste ha på plats: -1. Grundläggande förståelse för .NET: Bekantskap med .NET Framework eller .NET Core är viktigt. -2. Utvecklingsmiljö: Visual Studio eller någon annan lämplig .NET IDE. -3. GroupDocs.Editor för .NET Library: Ladda ner biblioteket från[GroupDocs releasesida](https://releases.groupdocs.com/editor/net/). -4. Tillfällig licens: Skaffa en[tillfällig licens](https://purchase.groupdocs.com/temporary-license/) för alla funktioner. -## Importera namnområden -För att komma igång med GroupDocs.Editor för .NET måste du importera de nödvändiga namnrymden till ditt projekt. Detta kommer att säkerställa att du har tillgång till alla klasser och metoder som tillhandahålls av biblioteket. +Innan du börjar, se till att du har: + +1. **.NET‑utvecklingsmiljö** – Visual Studio 2022 eller någon IDE som stödjer .NET 6+. +2. **GroupDocs.Editor för .NET‑bibliotek** – ladda ner från den [GroupDocs releases‑sida](https://releases.groupdocs.com/editor/net/). +3. **Tillfällig licens** – skaffa en [tillfällig licens](https://purchase.groupdocs.com/temporary-license/) för obegränsad åtkomst. +4. **Grundläggande C#‑kunskaper** – bekantskap med namnrymder, `using`‑satser och konsolutmatning. + +## Hur listar man stödda dokumentformat? +Läs in samlingen av stödda format och skriv ut varje formats namn och filändelse. Detta tvåstegs‑mönster fungerar för Word‑processning, kalkylblad och presentationsdokument. Genom att iterera samlingen kan du dynamiskt fylla UI‑element som rullgardinsmenyer, så att användarna endast kan välja format som editorn faktiskt kan hantera. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Lista Word‑processningsformat +`Formats.WordProcessingFormats` är en uppräkning som beskriver varje Word‑processningsfiltyp som editorn känner igen. `All`‑egenskapen returnerar en samling av dessa formatobjekt. -## Steg 1: Arbeta med dokumentformat -GroupDocs.Editor stöder ett brett utbud av dokumentformat. Låt oss utforska hur du kan lista alla ordbehandlings- och presentationsformat som stöds. -### Lista ordbehandlingsformat +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Förklaring: -1. Loop Through-format: Vi går igenom alla tillgängliga ordbehandlingsformat. -2. Information om utdataformat: För varje format skriver vi ut dess namn och tillägg. +``` + +**Förklaring:** +1. **Loop Through Formats:** Vi itererar över alla tillgängliga Word‑processningsformat. +2. **Output Format Details:** För varje format skriver vi ut dess vänliga namn och standardfiländelse. + ### Lista presentationsformat +`Formats.PresentationFormats` fungerar på samma sätt för bildspelsfiler, och exponerar varje stödd presentationstyp via `All`‑samlingen. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Förklaring: -1. Loop Through-format: I likhet med ordbehandlingsformat går vi igenom alla presentationsformat. -2. Information om utdataformat: Skriv ut namnet och tillägget för varje format. -## Steg 2: Analysera format från tillägg -Ibland måste du bestämma formatet baserat på ett filtillägg. GroupDocs.Editor gör detta enkelt. -### Analysera kalkylbladsformat +``` + +**Förklaring:** +1. **Loop Through Formats:** Samma loop‑logik gäller för presentationer. +2. **Output Format Details:** Namnet och filändelsen visas för varje format. + +## Hur bestämmer man filformatets filändelse? +Ibland har du bara ett filnamn och måste härleda motsvarande `DocumentFormat`. GroupDocs.Editor erbjuder en enkel statisk hjälpfunktion som mappar en filändelse till dess interna formatrepresentation, vilket låter dig validera eller konvertera filer innan de laddas in i editorn. + +### Parsning av kalkylbladsformat +`Formats.SpreadsheetFormats.FromExtension` konverterar en filändelsestring till motsvarande kalkylbladsformat‑enum‑värde. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Förklaring: -1. Parse Format: Vi använder`FromExtension` metod för att analysera formatet från`.xlsm` förlängning. -2. Utdataformat: Skriv ut det analyserade formatets namn. -### Analysera textformat +``` + +**Förklaring:** +1. **Parse Format:** `FromExtension` konverterar `.xlsm`‑ändelsen till sitt interna `SpreadsheetFormat`‑enum. +2. **Output Format:** Det parsade formatets namn skrivs ut, vilket bekräftar mappningen. + +### Parsning av textformat +På samma sätt löser `Formats.TextualFormats.FromExtension` textfiländelser som HTML eller TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Förklaring: -1. Parse Format: The`FromExtension` metod används för att analysera formatet från`html` förlängning. -2. Utdataformat: Skriv ut namnet på det analyserade textformatet. -## Steg 3: Redigera dokument -Nu när vi har sett hur man arbetar med format, låt oss dyka in i att redigera dokument med GroupDocs.Editor. -### Laddar ett dokument -För att redigera ett dokument måste du först ladda det. +``` + +**Förklaring:** +1. **Parse Format:** `FromExtension`‑metoden löser `html`‑ändelsen till ett `TextFormat`. +2. **Output Format:** Namnet på textformatet visas, användbart för webbaserade editorer. + +## Hur redigerar man dokument efter att ha identifierat format? +När du känner till formatet följer inläsning och redigering av ett dokument ett konsekvent mönster. Först skapar du en `Editor`‑instans med sökvägen till källfilen, sedan anropar du `Edit()` för att få ett `EditableDocument`. Därefter kan du läsa, ändra och slutligen spara innehållet med lämpliga `SaveOptions`. + +### Ladda ett dokument +`Editor` är kärnklassen som kapslar in alla redigeringsoperationer för en given fil. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Ytterligare steg kommer att behandlas här. + // Further steps will be covered here. } ``` -Förklaring: -1. Initiera Editor: Skapa en instans av`Editor` klass, vilket ger sökvägen till ditt dokument. -2. Kasta mönster: Använd`using` uttalande för att säkerställa att resurser disponeras på rätt sätt. +``` + +**Förklaring:** +1. **Initialize Editor:** Skapa en `Editor`‑instans och ange den fullständiga sökvägen till målfilen. +2. **Dispose Pattern:** `using`‑satsen garanterar att alla resurser som inte hanteras frigörs omedelbart. + ### Extrahera innehåll -När dokumentet har laddats kan du extrahera dess innehåll för redigering. +`EditableDocument.GetContent()` returnerar dokumentets råa text (eller HTML för webbaserade editorer), som du kan visa eller manipulera. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Förklaring: -1. Redigera metod: Ring`Edit` metod för att få en`EditableDocument`. -2. Få innehåll: Använd`GetContent` för att hämta dokumentets innehåll som en sträng. -3. Mata ut innehåll: Skriv ut innehållet till konsolen. -### Sparar ändringar -Efter redigering, spara dina ändringar tillbaka i dokumentet. +``` + +**Förklaring:** +1. **Edit Method:** `Edit()` returnerar ett `EditableDocument`‑objekt. +2. **Get Content:** `GetContent()` extraherar dokumentets råa text (eller HTML för webbaserade editorer). +3. **Output Content:** Innehållet skrivs ut i konsolen för verifiering. + +### Spara ändringar +`SaveOptions` talar om för editorn hur och i vilket format den redigerade dokumentet ska skrivas tillbaka till lagring. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Ändra innehållet här + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Förklaring: -1. Redigera metod: Ring`Edit` metod för att få en`EditableDocument`. -2. Ändra innehåll: Ändra innehållet efter behov (visas inte i detta utdrag). -3. Spara alternativ: Skapa`SaveOptions` anger formatet. -4. Spara dokument: Använd`Save` metod för att spara det redigerade dokumentet. -## Steg 4: Arbeta med olika dokumenttyper -GroupDocs.Editor stöder olika dokumenttyper. Så här arbetar du med dem: +``` + +**Förklaring:** +1. **Edit Method:** Hämta `EditableDocument` igen efter ändringar. +2. **Modify Content:** Applicera dina förändringar på strängen (ej visat här). +3. **Save Options:** Konfigurera `SaveOptions` med önskat utdataformat. +4. **Save Document:** Spara den redigerade filen tillbaka till disken. + +## Hur arbetar man med olika dokumenttyper? +GroupDocs.Editor abstraherar Word-, Spreadsheet- och Presentation‑hantering bakom samma API‑yta, vilket gör det enkelt att byta kontext utan att lära sig en ny uppsättning klasser för varje dokumentfamilj. + ### Redigera kalkylbladsdokument +`SpreadsheetSaveOptions` definierar hur ett kalkylblad skrivs, inklusive format och valfria komprimeringsinställningar. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Ändra innehållet här + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Förklaring: -1. Initiera redigerare: Skapa en`Editor` exempel för ett kalkylblad. -2. Redigera metod: Ring`Edit` att få en`EditableDocument`. -3. Hämta innehåll: Hämta och skriv ut innehållet. -4. Ändra innehåll: Gör nödvändiga ändringar. -5. Spara alternativ: Ange spara alternativ för kalkylblad. -6. Spara dokument: Spara det ändrade dokumentet. +``` + +**Förklaring:** +1. **Initialize Editor:** Ange en kalkylbladsfilväg till `Editor`‑konstruktorn. +2. **Edit Method:** Hämta ett `EditableDocument`. +3. **Get Content:** Skriv ut kalkylbladets CSV‑representation (eller HTML). +4. **Modify Content:** Gör eventuella cell‑nivå‑ändringar du behöver. +5. **Save Options:** Välj lämpliga `SpreadsheetSaveOptions`. +6. **Save Document:** Skriv tillbaka det uppdaterade kalkylbladet till lagring. + ### Redigera presentationsdokument +`PresentationSaveOptions` styr utdataformatet för bildspelsfiler, vilket låter dig bevara eller ändra den ursprungliga filtypen. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,60 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Ändra innehållet här + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Förklaring: -1. Initiera redigerare: Skapa en`Editor` till exempel för en presentation. -2. Redigera metod: Ring`Edit` att få en`EditableDocument`. -3. Hämta innehåll: Hämta och skriv ut innehållet. -4. Ändra innehåll: Gör nödvändiga ändringar. -5. Spara alternativ: Ange spara alternativ för presentationer. -6. Spara dokument: Spara det ändrade dokumentet. +``` + +**Förklaring:** +1. **Initialize Editor:** Ladda en PowerPoint‑fil via `Editor`. +2. **Edit Method:** Hämta ett `EditableDocument`. +3. **Get Content:** Extrahera slide‑HTML eller vanlig text. +4. **Modify Content:** Uppdatera titlar, punktlistor eller bilder. +5. **Save Options:** Använd `PresentationSaveOptions` för att definiera utdataformatet. +6. **Save Document:** Spara den redigerade presentationen. + +## Vanliga problem och lösningar +- **“Format not supported”‑fel:** Verifiera att du använder den senaste GroupDocs.Editor‑versionen; den lägger regelbundet till stöd för nyare Office‑format. +- **Stort minnesförbrukning för stora filer:** Aktivera streaming‑läge genom att sätta `EditorSettings.EnableStreaming = true` innan dokumentet laddas. +- **Licens ej tillämpad:** Säkerställ att den tillfälliga licensfilen ligger i applikationens rot eller laddas via `License license = new License(); license.SetLicense("path/to/license.lic");`. + +## Vanliga frågor och svar + +**Q: Vad är skillnaden mellan `DocumentFormatInfo` och `SaveOptions`?** +A: `DocumentFormatInfo` ger metadata om stödda filtyper, medan `SaveOptions` konfigurerar hur ett dokument skrivs tillbaka till disk (format, komprimering osv.). + +**Q: Kan jag lista format för en anpassad filändelse?** +A: Ja — använd `DocumentFormatInfo.FromExtension("yourExt")`; om ändelsen inte känns igen returnerar metoden `null`. + +**Q: Stöder GroupDocs.Editor lösenordsskyddade filer?** +A: Absolut. Skicka lösenordet till `Editor`‑konstruktorn via `EditorSettings` för att öppna krypterade dokument. + +**Q: Hur många format stödjer GroupDocs.Editor faktiskt?** +A: Över **30 in- och utdataformat**, som täcker Word, Excel, PowerPoint, HTML och vanlig text. + +**Q: Finns det ett sätt att begränsa listan till endast redigerbara format?** +A: Använd `GetEditableWordProcessingFormats()` (eller motsvarande för Spreadsheet/Presentation) för att hämta format som tillåter full redigeringskapacitet. + +## Ytterligare resurser +- Ladda ner biblioteket från den [GroupDocs releases‑sida](https://releases.groupdocs.com/editor/net/). +- Skaffa en [tillfällig licens](https://purchase.groupdocs.com/temporary-license/) för full åtkomst till funktioner. +- Prova produkten med en [gratis provversion](https://releases.groupdocs.com/). +- Utforska detaljerade användningsexempel i [GroupDocs.Editor-dokumentationen](https://tutorials.groupdocs.com/editor/net/). +- Få hjälp från communityn på [supportforumet](https://forum.groupdocs.com/c/editor/20). + ## Slutsats -GroupDocs.Editor för .NET ger ett robust och flexibelt sätt att redigera olika dokumentformat programmatiskt. Genom att följa den här guiden kan du effektivt integrera dokumentredigeringsfunktioner i dina .NET-applikationer, förbättra deras kapacitet och ge dina användare större värde. -## FAQ's -### Vad är GroupDocs.Editor för .NET? -GroupDocs.Editor för .NET är ett kraftfullt bibliotek som tillåter utvecklare att redigera olika dokumentformat programmatiskt i sina .NET-applikationer. -### Hur kommer jag igång med GroupDocs.Editor för .NET? -Du måste ladda ner biblioteket, skaffa en tillfällig licens och ställa in din utvecklingsmiljö med nödvändiga namnrymder. -### Vilka dokumentformat stöds? -GroupDocs.Editor stöder bland annat ordbehandlings-, kalkylblads-, presentations- och textformat. -### Kan jag använda GroupDocs.Editor gratis? - Du kan använda en[gratis provperiod](https://releases.groupdocs.com/) med begränsade funktioner eller skaffa en[tillfällig licens](https://purchase.groupdocs.com/temporary-license/) för full åtkomst. -### Var kan jag hitta mer resurser och support? - Besök[GroupDocs.Editor dokumentation](https://tutorials.groupdocs.com/editor/net/) för detaljerad information, eller kolla in deras[supportforum](https://forum.groupdocs.com/c/editor/20) för hjälp. \ No newline at end of file +Genom att följa den här guiden vet du nu hur du **listar stödda dokumentformat**, **bestämmer ett filformat från dess filändelse** och **redigerar dokument** över Word, Spreadsheet och Presentation‑typer med GroupDocs.Editor för .NET. Integrera dessa kodsnuttar i dina egna projekt för att bygga robusta, format‑medvetna applikationer som glädjer slutanvändare och minskar körfel. + +**Senast uppdaterad:** 2026-06-06 +**Testad med:** GroupDocs.Editor 23.9 för .NET +**Författare:** GroupDocs + +## Relaterade handledningar + +- [Mästarhandledning för dokumentladdning i .NET med GroupDocs.Editor: En omfattande guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Mästarhandledning för dokumentredigering i .NET med GroupDocs.Editor: En omfattande guide](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Konvertera Word till HTML med GroupDocs.Editor .NET: En steg‑för‑steg‑guide](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/thai/net/document-processing/work-document-formats/_index.md b/content/thai/net/document-processing/work-document-formats/_index.md index 8b9f465a..b68d8cd5 100644 --- a/content/thai/net/document-processing/work-document-formats/_index.md +++ b/content/thai/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: ทำงานกับรูปแบบเอกสาร -linktitle: ทำงานกับรูปแบบเอกสาร +date: 2026-06-06 +description: เรียนรู้วิธีการแสดงรายการรูปแบบเอกสารที่รองรับและกำหนดนามสกุลไฟล์โดยใช้ + GroupDocs.Editor สำหรับ .NET คู่มือขั้นตอนโดยละเอียดพร้อมตัวอย่างโค้ด คำตอบสั้น + ๆ และคำถามที่พบบ่อย +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: รายการรูปแบบเอกสารที่รองรับ +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: เรียนรู้วิธีใช้ GroupDocs.Editor สำหรับ .NET เพื่อแก้ไขรูปแบบเอกสารต่างๆ โดยทางโปรแกรม คำแนะนำทีละขั้นตอนพร้อมตัวอย่างเพื่อการผสานรวมที่ราบรื่น -weight: 13 -url: /th/net/document-processing/work-document-formats/ +title: รายการรูปแบบเอกสารที่รองรับด้วย GroupDocs.Editor .NET type: docs +url: /th/net/document-processing/work-document-formats/ +weight: 13 --- -# ทำงานกับรูปแบบเอกสาร -## การแนะนำ -ยินดีต้อนรับสู่คำแนะนำเชิงลึกเกี่ยวกับการใช้ GroupDocs.Editor สำหรับ .NET! หากคุณเป็นนักพัฒนาที่ต้องการปรับปรุงแอปพลิเคชันของคุณด้วยความสามารถในการแก้ไขเอกสาร คุณมาถูกที่แล้ว บทความนี้จะแนะนำทุกสิ่งที่คุณจำเป็นต้องรู้ ตั้งแต่ข้อกำหนดเบื้องต้นไปจนถึงตัวอย่างเชิงปฏิบัติ เพื่อช่วยให้คุณเริ่มต้นใช้งานไลบรารีอันทรงพลังนี้ +# รายการรูปแบบเอกสารที่รองรับ + +ยินดีต้อนรับสู่บทแนะนำเชิงลึกของเราเกี่ยวกับ **วิธีแสดงรายการรูปแบบเอกสารที่รองรับ** ด้วย GroupDocs.Editor สำหรับ .NET ไม่ว่าคุณจะกำลังสร้างแอปเว็บที่เน้นเอกสารหรือเครื่องมือเดสก์ท็อประดับองค์กร การรู้ว่ารูปแบบใดที่คุณสามารถแก้ไขหรือแปลงได้อย่างแม่นยำเป็นสิ่งสำคัญ ในคู่มือนี้คุณจะได้ค้นพบวิธีการนับรายการรูปแบบ การแยกส่วนต่อขยายไฟล์ และการแก้ไขเอกสาร—ทั้งหมดด้วยคำอธิบายที่ชัดเจนและเป็นมิตรต่อผู้ใช้ พร้อมโค้ดตัวอย่างที่พร้อมรัน + +## คำตอบด่วน +- **ฉันจะลิสต์รูปแบบที่รองรับทั้งหมดได้อย่างไร?** ใช้ `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (หรือเทียบเท่าสำหรับ Presentation/Spreadsheet) และวนลูปคอลเลกชัน. +- **ฉันสามารถกำหนดรูปแบบจากส่วนต่อขยายไฟล์ได้หรือไม่?** ใช่—เรียก `DocumentFormatInfo.FromExtension(".docx")`. +- **GroupDocs.Editor รองรับประเภทไฟล์อะไรบ้าง?** มากกว่า 30 รูปแบบการนำเข้าและส่งออก รวมถึง DOCX, XLSX, PPTX, HTML และข้อความธรรมดา. +- **ฉันต้องมีลิขสิทธิ์เพื่อแสดงรายการรูปแบบหรือไม่?** ลิขสิทธิ์ชั่วคราวจะปลดล็อก API ทั้งหมด; หากไม่เช่นนั้น การทดลองใช้งานจะทำงานด้วยคุณสมบัติที่จำกัด. +- **เวอร์ชัน .NET ใดที่เข้ากันได้?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## “การแสดงรายการรูปแบบเอกสารที่รองรับ” คืออะไร +วลีนี้หมายถึงการดึงข้อมูลคอลเลกชันของประเภทไฟล์ที่ GroupDocs.Editor สามารถเปิด, แก้ไขและบันทึกได้โดยโปรแกรม การทำเช่นนี้ช่วยให้คุณสร้างเมนูดรอปดาวน์ UI แบบไดนามิกหรือทำการตรวจสอบไฟล์ที่ผู้ใช้อัปโหลดก่อนประมวลผล เพื่อให้แน่ใจว่าไฟล์ที่ส่งไปยังเอดิเตอร์เป็นไฟล์ที่เข้ากันได้เท่านั้น + +## ทำไมต้องแสดงรายการรูปแบบเอกสารที่รองรับ +GroupDocs.Editor **รองรับรูปแบบการนำเข้าและส่งออกกว่า 30 ประเภท** และสามารถจัดการไฟล์ขนาด **สูงสุด 2 GB** โดยไม่ต้องโหลดเอกสารทั้งหมดเข้าสู่หน่วยความจำ การรู้รายการที่แน่นอนช่วยป้องกันข้อผิดพลาดขณะรัน, ปรับปรุงประสบการณ์ผู้ใช้, และทำให้คุณสามารถบังคับใช้กฎธุรกิจเช่น “อนุญาตเฉพาะเอกสาร Office ที่สามารถแก้ไขได้” นอกจากนี้ยังช่วยให้คุณแสดงเฉพาะรูปแบบที่แอปของคุณรองรับจริงต่อผู้ใช้ + ## ข้อกำหนดเบื้องต้น -ก่อนที่จะเจาะลึกตัวอย่างและฟังก์ชันการทำงานของ GroupDocs.Editor สำหรับ .NET มีข้อกำหนดเบื้องต้นบางประการที่คุณต้องมี: -1. ความเข้าใจพื้นฐานของ .NET: ความคุ้นเคยกับ .NET Framework หรือ .NET Core เป็นสิ่งจำเป็น -2. สภาพแวดล้อมการพัฒนา: Visual Studio หรือ .NET IDE อื่น ๆ ที่เหมาะสม -3. GroupDocs.Editor สำหรับ .NET Library: ดาวน์โหลดไลบรารีจากไฟล์[หน้าเผยแพร่ GroupDocs](https://releases.groupdocs.com/editor/net/). -4. ใบอนุญาตชั่วคราว: รับ[ใบอนุญาตชั่วคราว](https://purchase.groupdocs.com/temporary-license/) เพื่อคุณสมบัติที่ครบครัน -## นำเข้าเนมสเปซ -หากต้องการเริ่มต้นใช้งาน GroupDocs.Editor สำหรับ .NET คุณจะต้องนำเข้าเนมสเปซที่จำเป็นลงในโปรเจ็กต์ของคุณ สิ่งนี้จะช่วยให้คุณสามารถเข้าถึงชั้นเรียนและวิธีการทั้งหมดที่ห้องสมุดจัดให้ +ก่อนเริ่มทำงาน โปรดตรวจสอบว่าคุณมี: + +1. **สภาพแวดล้อมการพัฒนา .NET** – Visual Studio 2022 หรือ IDE ใด ๆ ที่รองรับ .NET 6+. +2. **ไลบรารี GroupDocs.Editor for .NET** – ดาวน์โหลดจาก [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **ลิขสิทธิ์ชั่วคราว** – รับ [temporary license](https://purchase.groupdocs.com/temporary-license/) เพื่อเข้าถึงแบบไม่จำกัด. +4. **ความรู้พื้นฐานของ C#** – คุ้นเคยกับ namespaces, คำสั่ง `using`, และการแสดงผลบนคอนโซล. + +## วิธีแสดงรายการรูปแบบเอกสารที่รองรับ? +โหลดคอลเลกชันของรูปแบบที่รองรับและพิมพ์ชื่อและส่วนต่อขยายของแต่ละรูปแบบ รูปแบบสองขั้นตอนนี้ทำงานได้กับเอกสาร Word Processing, Spreadsheet, และ Presentation โดยการวนลูปคอลเลกชันคุณสามารถเติมข้อมูลให้กับองค์ประกอบ UI เช่น ดรอปดาวน์ เพื่อให้ผู้ใช้เลือกได้เฉพาะรูปแบบที่เอดิเตอร์สามารถจัดการได้จริง + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### การแสดงรายการรูปแบบการประมวลผลคำ +`Formats.WordProcessingFormats` เป็น enumeration ที่อธิบายทุกประเภทไฟล์การประมวลผลคำที่เอดิเตอร์รับรู้ property `All` จะคืนคอลเลกชันของอ็อบเจกต์รูปแบบเหล่านี้ -## ขั้นตอนที่ 1: การทำงานกับรูปแบบเอกสาร -GroupDocs.Editor รองรับรูปแบบเอกสารที่หลากหลาย มาดูกันว่าคุณสามารถแสดงรายการรูปแบบการประมวลผลคำและการนำเสนอที่รองรับทั้งหมดได้อย่างไร -### แสดงรายการรูปแบบการประมวลผลคำ +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -คำอธิบาย: -1. รูปแบบวนซ้ำ: เราวนซ้ำผ่านรูปแบบการประมวลผลคำที่มีอยู่ทั้งหมด -2. รายละเอียดรูปแบบผลลัพธ์: สำหรับแต่ละรูปแบบ เราจะพิมพ์ชื่อและนามสกุลของมัน -### รูปแบบการนำเสนอรายการ +``` + +**คำอธิบาย:** +1. **วนลูปผ่านรูปแบบ:** เรา iterate ผ่านรูปแบบการประมวลผลคำทั้งหมดที่มี. +2. **แสดงรายละเอียดรูปแบบ:** สำหรับแต่ละรูปแบบเราพิมพ์ชื่อที่เป็นมิตรและส่วนต่อขยายไฟล์เริ่มต้น. + +### การแสดงรายการรูปแบบการนำเสนอ +`Formats.PresentationFormats` ทำงานเช่นเดียวกันสำหรับไฟล์สไลด์เด็ค โดยเปิดเผยแต่ละประเภทการนำเสนอที่รองรับผ่านคอลเลกชัน `All` + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -คำอธิบาย: -1. รูปแบบวนซ้ำ: เช่นเดียวกับรูปแบบการประมวลผลคำ เราวนซ้ำทุกรูปแบบการนำเสนอ -2. รายละเอียดรูปแบบผลลัพธ์: พิมพ์ชื่อและนามสกุลของแต่ละรูปแบบ -## ขั้นตอนที่ 2: แยกวิเคราะห์รูปแบบจากส่วนขยาย -บางครั้ง คุณจำเป็นต้องกำหนดรูปแบบตามนามสกุลไฟล์ GroupDocs.Editor ทำให้สิ่งนี้เป็นเรื่องง่าย -### การแยกวิเคราะห์รูปแบบสเปรดชีต +``` + +**คำอธิบาย:** +1. **วนลูปผ่านรูปแบบ:** โลจิกการวนลูปเดียวกันใช้กับการนำเสนอ. +2. **แสดงรายละเอียดรูปแบบ:** ชื่อและส่วนต่อขยายจะแสดงสำหรับแต่ละรูปแบบ. + +## วิธีกำหนดส่วนต่อขยายรูปแบบไฟล์? +บางครั้งคุณอาจมีเพียงชื่อไฟล์และต้องสรุป `DocumentFormat` ที่สอดคล้อง GroupDocs.Editor มีตัวช่วยแบบ static ที่แมปส่วนต่อขยายไฟล์ไปยังรูปแบบภายใน ช่วยให้คุณตรวจสอบหรือแปลงไฟล์ก่อนโหลดเข้าสู่เอดิเตอร์ + +### การแยกรูปแบบสเปรดชีต +`Formats.SpreadsheetFormats.FromExtension` แปลงสตริงส่วนต่อขยายไฟล์เป็นค่า enum ของรูปแบบสเปรดชีตที่ตรงกัน + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -คำอธิบาย: -1. รูปแบบการแยกวิเคราะห์: เราใช้`FromExtension` วิธีการแยกวิเคราะห์รูปแบบจากไฟล์`.xlsm` ส่วนขยาย. -2. รูปแบบผลลัพธ์: พิมพ์ชื่อของรูปแบบที่แยกวิเคราะห์ -### การแยกวิเคราะห์รูปแบบข้อความ +``` + +**คำอธิบาย:** +1. **แปลงรูปแบบ:** `FromExtension` แปลงส่วนต่อขยาย `.xlsm` ให้เป็นค่า `SpreadsheetFormat` ภายใน. +2. **แสดงรูปแบบ:** พิมพ์ชื่อของรูปแบบที่แปลงแล้วเพื่อยืนยันการแมป. + +### การแยกรูปแบบข้อความ +ในทำนองเดียวกัน `Formats.TextualFormats.FromExtension` จะระบุส่วนต่อขยายไฟล์ข้อความเช่น HTML หรือ TXT + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -คำอธิบาย: -1. รูปแบบการแยกวิเคราะห์: The`FromExtension` วิธีการใช้ในการแยกวิเคราะห์รูปแบบจากไฟล์`html` ส่วนขยาย. -2. รูปแบบผลลัพธ์: พิมพ์ชื่อของรูปแบบข้อความที่แยกวิเคราะห์ -## ขั้นตอนที่ 3: การแก้ไขเอกสาร -ตอนนี้เราได้เห็นวิธีการทำงานกับรูปแบบแล้ว เรามาเจาะลึกการแก้ไขเอกสารโดยใช้ GroupDocs.Editor กันดีกว่า -### กำลังโหลดเอกสาร -หากต้องการแก้ไขเอกสาร คุณต้องโหลดเอกสารก่อน +``` + +**คำอธิบาย:** +1. **แปลงรูปแบบ:** เมธอด `FromExtension` ระบุส่วนต่อขยาย `html` ให้เป็น `TextFormat`. +2. **แสดงรูปแบบ:** ชื่อของรูปแบบข้อความจะแสดงออกมา มีประโยชน์สำหรับเอดิเตอร์บนเว็บ. + +## วิธีแก้ไขเอกสารหลังจากระบุรูปแบบแล้ว? +เมื่อคุณรู้รูปแบบแล้ว การโหลดและแก้ไขเอกสารจะทำตามรูปแบบที่สอดคล้องกัน ขั้นแรกสร้างอินสแตนซ์ `Editor` ด้วยพาธของไฟล์ต้นฉบับ จากนั้นเรียก `Edit()` เพื่อรับ `EditableDocument` จากนั้นคุณสามารถอ่าน, แก้ไขและบันทึกเนื้อหาโดยใช้ `SaveOptions` ที่เหมาะสม + +### การโหลดเอกสาร +`Editor` เป็นคลาสหลักที่ห่อหุ้มการดำเนินการแก้ไขทั้งหมดสำหรับไฟล์ที่ระบุ + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // ขั้นตอนเพิ่มเติมจะกล่าวถึงที่นี่ + // Further steps will be covered here. } ``` -คำอธิบาย: -1. เริ่มต้นตัวแก้ไข: สร้างอินสแตนซ์ของ`Editor` คลาสเพื่อระบุเส้นทางไปยังเอกสารของคุณ -2. รูปแบบการกำจัด: ใช้`using` คำแถลงเพื่อให้แน่ใจว่าทรัพยากรถูกกำจัดอย่างเหมาะสม -### กำลังแยกเนื้อหา -เมื่อโหลดเอกสารแล้ว คุณสามารถแยกเนื้อหาเพื่อแก้ไขได้ +``` + +**คำอธิบาย:** +1. **เริ่มต้น Editor:** สร้างอินสแตนซ์ `Editor` โดยส่งพาธเต็มของไฟล์เป้าหมาย. +2. **รูปแบบการปล่อยทรัพยากร:** คำสั่ง `using` รับประกันว่าทรัพยากรที่ไม่ได้จัดการจะถูกปล่อยอย่างทันท่วงที. + +### การดึงเนื้อหา +`EditableDocument.GetContent()` คืนข้อความดิบของเอกสาร (หรือ HTML สำหรับเอดิเตอร์บนเว็บ) ซึ่งคุณสามารถแสดงหรือจัดการต่อได้ + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -คำอธิบาย: -1. วิธีการแก้ไข: โทร`Edit` วิธีการรับไฟล์`EditableDocument`. -2. รับเนื้อหา: การใช้งาน`GetContent` เพื่อดึงเนื้อหาของเอกสารเป็นสตริง -3. เนื้อหาเอาท์พุต: พิมพ์เนื้อหาไปยังคอนโซล -### กำลังบันทึกการเปลี่ยนแปลง -หลังจากแก้ไข ให้บันทึกการเปลี่ยนแปลงของคุณกลับไปยังเอกสาร +``` + +**คำอธิบาย:** +1. **เมธอด Edit:** `Edit()` คืนอ็อบเจกต์ `EditableDocument`. +2. **ดึงเนื้อหา:** `GetContent()` สกัดข้อความดิบของเอกสาร (หรือ HTML สำหรับเอดิเตอร์บนเว็บ). +3. **แสดงเนื้อหา:** พิมพ์เนื้อหาออกคอนโซลเพื่อยืนยัน. + +### การบันทึกการเปลี่ยนแปลง +`SaveOptions` บอกเอดิเตอร์ว่าจะเขียนเอกสารที่แก้ไขกลับไปยังที่เก็บอย่างไรและในรูปแบบใด + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // แก้ไขเนื้อหาที่นี่ + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -คำอธิบาย: -1. วิธีการแก้ไข: โทร`Edit` วิธีการรับไฟล์`EditableDocument`. -2. แก้ไขเนื้อหา: แก้ไขเนื้อหาตามต้องการ (ไม่แสดงในตัวอย่างนี้) -3. บันทึกตัวเลือก: สร้าง`SaveOptions` การระบุรูปแบบ -4. บันทึกเอกสาร: ใช้`Save` วิธีการบันทึกเอกสารที่แก้ไข -## ขั้นตอนที่ 4: การทำงานกับเอกสารประเภทต่างๆ -GroupDocs.Editor รองรับเอกสารหลายประเภท ต่อไปนี้เป็นวิธีทำงานร่วมกับพวกเขา: +``` + +**คำอธิบาย:** +1. **เมธอด Edit:** ดึง `EditableDocument` อีกครั้งหลังจากทำการแก้ไข. +2. **แก้ไขเนื้อหา:** ปรับเปลี่ยนสตริงตามที่ต้องการ (ไม่ได้แสดงในตัวอย่าง). +3. **ตัวเลือกการบันทึก:** กำหนด `SaveOptions` ด้วยรูปแบบเอาต์พุตที่ต้องการ. +4. **บันทึกเอกสาร:** บันทึกไฟล์ที่แก้ไขกลับสู่ดิสก์. + +## วิธีทำงานกับประเภทเอกสารที่แตกต่างกัน? +GroupDocs.Editor ทำให้การจัดการ Word, Spreadsheet, และ Presentation อยู่ใน API เดียวกัน ทำให้คุณสลับบริบทได้โดยไม่ต้องเรียนรู้ชุดคลาสใหม่สำหรับแต่ละตระกูลเอกสาร + ### การแก้ไขเอกสารสเปรดชีต +`SpreadsheetSaveOptions` กำหนดวิธีการเขียนสเปรดชีต รวมถึงรูปแบบและการตั้งค่าการบีบอัดแบบเลือกได้ + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // แก้ไขเนื้อหาที่นี่ + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -คำอธิบาย: -1. เริ่มต้นตัวแก้ไข: สร้าง`Editor` อินสแตนซ์สำหรับสเปรดชีต -2. วิธีการแก้ไข: โทร`Edit` เพื่อรับ`EditableDocument`. -3. รับเนื้อหา: ดึงและพิมพ์เนื้อหา -4. แก้ไขเนื้อหา: ทำการเปลี่ยนแปลงที่จำเป็น -5. ตัวเลือกการบันทึก: ระบุตัวเลือกการบันทึกสำหรับสเปรดชีต -6. บันทึกเอกสาร: บันทึกเอกสารที่แก้ไข +``` + +**คำอธิบาย:** +1. **เริ่มต้น Editor:** ส่งพาธไฟล์สเปรดชีตให้กับคอนสตรัคเตอร์ `Editor`. +2. **เมธอด Edit:** ดึง `EditableDocument`. +3. **ดึงเนื้อหา:** พิมพ์การแสดงผล CSV ของสเปรดชีต (หรือ HTML). +4. **แก้ไขเนื้อหา:** ทำการเปลี่ยนแปลงระดับเซลล์ตามต้องการ. +5. **ตัวเลือกการบันทึก:** เลือก `SpreadsheetSaveOptions` ที่เหมาะสม. +6. **บันทึกเอกสาร:** เขียนสเปรดชีตที่อัปเดตกลับสู่ที่เก็บ. + ### การแก้ไขเอกสารการนำเสนอ +`PresentationSaveOptions` ควบคุมรูปแบบเอาต์พุตสำหรับสไลด์เด็ค ให้คุณคงหรือเปลี่ยนประเภทไฟล์ต้นฉบับได้ + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // แก้ไขเนื้อหาที่นี่ + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -คำอธิบาย: -1. เริ่มต้นตัวแก้ไข: สร้าง`Editor` ตัวอย่างสำหรับการนำเสนอ -2. วิธีการแก้ไข: โทร`Edit` เพื่อรับ`EditableDocument`. -3. รับเนื้อหา: ดึงและพิมพ์เนื้อหา -4. แก้ไขเนื้อหา: ทำการเปลี่ยนแปลงที่จำเป็น -5. ตัวเลือกการบันทึก: ระบุตัวเลือกการบันทึกสำหรับการนำเสนอ -6. บันทึกเอกสาร: บันทึกเอกสารที่แก้ไข -## บทสรุป -GroupDocs.Editor สำหรับ .NET มอบวิธีการที่มีประสิทธิภาพและยืดหยุ่นในการแก้ไขรูปแบบเอกสารต่างๆ โดยทางโปรแกรม ด้วยการทำตามคำแนะนำนี้ คุณสามารถรวมฟังก์ชันการแก้ไขเอกสารเข้ากับแอปพลิเคชัน .NET ของคุณได้อย่างมีประสิทธิภาพ เพิ่มขีดความสามารถ และมอบคุณค่าที่มากขึ้นให้กับผู้ใช้ของคุณ +``` + +**คำอธิบาย:** +1. **เริ่มต้น Editor:** โหลดไฟล์ PowerPoint ผ่าน `Editor`. +2. **เมธอด Edit:** รับ `EditableDocument`. +3. **ดึงเนื้อหา:** สกัด HTML ของสไลด์หรือข้อความธรรมดา. +4. **แก้ไขเนื้อหา:** ปรับหัวข้อ, รายการหัวข้อย่อย หรือรูปภาพ. +5. **ตัวเลือกการบันทึก:** ใช้ `PresentationSaveOptions` เพื่อกำหนดรูปแบบเอาต์พุต. +6. **บันทึกเอกสาร:** บันทึกการนำเสนอที่แก้ไขแล้ว + +## ปัญหาทั่วไปและวิธีแก้ +- **ข้อผิดพลาด “Format not supported”:** ตรวจสอบว่าคุณใช้เวอร์ชันล่าสุดของ GroupDocs.Editor; เวอร์ชันใหม่มักเพิ่มการสนับสนุนรูปแบบ Office ที่อัปเดต. +- **การใช้หน่วยความจำสูงสำหรับไฟล์ขนาดใหญ่:** เปิดโหมดสตรีมมิ่งโดยตั้งค่า `EditorSettings.EnableStreaming = true` ก่อนโหลดเอกสาร. +- **ลิขสิทธิ์ไม่ทำงาน:** ตรวจสอบว่าไฟล์ลิขสิทธิ์ชั่วคราวอยู่ในโฟลเดอร์รากของแอปหรือโหลดผ่าน `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## คำถามที่พบบ่อย -### GroupDocs.Editor สำหรับ .NET คืออะไร -GroupDocs.Editor สำหรับ .NET เป็นไลบรารีที่มีประสิทธิภาพซึ่งช่วยให้นักพัฒนาสามารถแก้ไขรูปแบบเอกสารต่างๆ โดยใช้โปรแกรมภายในแอปพลิเคชัน .NET ของตนได้ -### ฉันจะเริ่มต้นใช้งาน GroupDocs.Editor สำหรับ .NET ได้อย่างไร -คุณต้องดาวน์โหลดไลบรารี รับใบอนุญาตชั่วคราว และตั้งค่าสภาพแวดล้อมการพัฒนาของคุณด้วยเนมสเปซที่จำเป็น -### รองรับเอกสารรูปแบบใดบ้าง? -GroupDocs.Editor รองรับการประมวลผลคำ สเปรดชีต การนำเสนอ และรูปแบบข้อความ และอื่นๆ อีกมากมาย -### ฉันสามารถใช้ GroupDocs.Editor ได้ฟรีหรือไม่ - คุณสามารถใช้ก[ทดลองฟรี](https://releases.groupdocs.com/) ด้วยคุณสมบัติที่จำกัดหรือได้รับ[ใบอนุญาตชั่วคราว](https://purchase.groupdocs.com/temporary-license/) เพื่อการเข้าถึงอย่างเต็มรูปแบบ -### ฉันจะหาแหล่งข้อมูลเพิ่มเติมและการสนับสนุนได้จากที่ไหน? - เยี่ยมชม[เอกสาร GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) สำหรับข้อมูลโดยละเอียดหรือตรวจสอบของพวกเขา[ฟอรั่มการสนับสนุน](https://forum.groupdocs.com/c/editor/20) เพื่อขอความช่วยเหลือ \ No newline at end of file + +**Q: ความแตกต่างระหว่าง `DocumentFormatInfo` กับ `SaveOptions` คืออะไร?** +A: `DocumentFormatInfo` ให้ข้อมูลเมตาดาต้าเกี่ยวกับประเภทไฟล์ที่รองรับ, ในขณะที่ `SaveOptions` กำหนดวิธีการบันทึกเอกสารกลับสู่ดิสก์ (รูปแบบ, การบีบอัด ฯลฯ). + +**Q: ฉันสามารถแสดงรายการรูปแบบสำหรับส่วนต่อขยายไฟล์ที่กำหนดเองได้หรือไม่?** +A: ได้—ใช้ `DocumentFormatInfo.FromExtension("yourExt")`; หากส่วนต่อขยายไม่ถูกจดจำเมธอดจะคืนค่า `null`. + +**Q: GroupDocs.Editor รองรับไฟล์ที่มีการป้องกันด้วยรหัสผ่านหรือไม่?** +A: แน่นอน. ส่งรหัสผ่านไปยังคอนสตรัคเตอร์ `Editor` ผ่าน `EditorSettings` เพื่อเปิดไฟล์ที่เข้ารหัส. + +**Q: GroupDocs.Editor รองรับรูปแบบไฟล์กี่ประเภท?** +A: มากกว่า **30 รูปแบบการนำเข้าและส่งออก**, ครอบคลุม Word, Excel, PowerPoint, HTML และข้อความธรรมดา. + +**Q: มีวิธีใดที่จะจำกัดรายการให้แสดงเฉพาะรูปแบบที่แก้ไขได้เท่านั้นหรือไม่?** +A: ใช้ `GetEditableWordProcessingFormats()` (หรือเทียบเท่าสำหรับ Spreadsheet/Presentation) เพื่อดึงรูปแบบที่ให้ความสามารถการแก้ไขเต็มรูปแบบ. + +## แหล่งข้อมูลเพิ่มเติม +- ดาวน์โหลดไลบรารีจาก [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +- รับ [temporary license](https://purchase.groupdocs.com/temporary-license/) เพื่อเข้าถึงคุณสมบัติเต็มรูปแบบ. +- ทดลองผลิตภัณฑ์ด้วย [free trial](https://releases.groupdocs.com/). +- สำรวจตัวอย่างการใช้งานโดยละเอียดใน [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- ขอความช่วยเหลือจากชุมชนได้ที่ [support forum](https://forum.groupdocs.com/c/editor/20). + +## สรุป +โดยทำตามคู่มือนี้คุณจะรู้วิธี **แสดงรายการรูปแบบเอกสารที่รองรับ**, **กำหนดรูปแบบไฟล์จากส่วนต่อขยาย**, และ **แก้ไขเอกสาร** ทั้งในประเภท Word, Spreadsheet, และ Presentation ด้วย GroupDocs.Editor สำหรับ .NET. นำโค้ดตัวอย่างเหล่านี้ไปใช้ในโปรเจกต์ของคุณเพื่อสร้างแอปพลิเคชันที่ตระหนักรูปแบบไฟล์, ลดข้อผิดพลาดขณะรัน, และมอบประสบการณ์ที่ดีให้กับผู้ใช้ + +--- + +**อัปเดตล่าสุด:** 2026-06-06 +**ทดสอบกับ:** GroupDocs.Editor 23.9 for .NET +**ผู้เขียน:** GroupDocs + +## บทแนะนำที่เกี่ยวข้อง + +- [การทำความเข้าใจการโหลดเอกสารใน .NET ด้วย GroupDocs.Editor: คู่มือเชิงลึก](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [การทำความเข้าใจการแก้ไขเอกสารใน .NET ด้วย GroupDocs.Editor: คู่มือเชิงลึก](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [แปลง Word เป็น HTML ด้วย GroupDocs.Editor .NET: คู่มือขั้นตอนต่อขั้นตอน](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/turkish/net/document-processing/work-document-formats/_index.md b/content/turkish/net/document-processing/work-document-formats/_index.md index 45660c79..6776375c 100644 --- a/content/turkish/net/document-processing/work-document-formats/_index.md +++ b/content/turkish/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,214 @@ --- -title: Belge Formatlarıyla Çalışma -linktitle: Belge Formatlarıyla Çalışma -second_title: GroupDocs.Editor .NET API'si -description: Çeşitli belge formatlarını programlı olarak düzenlemek için GroupDocs.Editor for .NET'i nasıl kullanacağınızı öğrenin. Sorunsuz entegrasyon için örnekler içeren adım adım kılavuz. -weight: 13 -url: /tr/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET kullanarak desteklenen belge formatlarını nasıl + listeleyeceğinizi ve dosya uzantısını nasıl belirleyeceğinizi öğrenin. Kod örnekleri, + hızlı cevaplar ve SSS içeren adım adım kılavuz. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Desteklenen Belge Formatlarını Listele +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: GroupDocs.Editor .NET ile Desteklenen Belge Formatlarını Listeleyin type: docs +url: /tr/net/document-processing/work-document-formats/ +weight: 13 --- -# Belge Formatlarıyla Çalışma -## giriiş -GroupDocs.Editor for .NET'in kullanımına ilişkin ayrıntılı kılavuzumuza hoş geldiniz! Uygulamalarınızı belge düzenleme özellikleriyle geliştirmek isteyen bir geliştiriciyseniz doğru yere geldiniz. Bu makale, bu güçlü kütüphaneyi çalışır duruma getirmeniz için önkoşullardan pratik örneklere kadar bilmeniz gereken her şeyi size anlatacaktır. +# Desteklenen Belge Formatlarını Listeleme + +GroupDocs.Editor for .NET ile **desteklenen belge formatlarını nasıl listeleyeceğinizi** kapsayan kapsamlı öğreticiye hoş geldiniz. Belge‑odaklı bir web uygulaması ya da kurumsal‑düzeyde bir masaüstü aracı geliştiriyor olun, hangi formatları düzenleyebileceğinizi veya dönüştürebileceğinizi tam olarak bilmek çok önemlidir. Bu rehberde formatları nasıl sıralayacağınızı, uzantıları nasıl ayrıştıracağınızı ve belgeleri nasıl düzenleyeceğinizi keşfedeceksiniz — net, kullanıcı‑dostu açıklamalar ve çalıştırmaya hazır kod parçacıklarıyla. + +## Hızlı Yanıtlar +- **Tüm desteklenen formatları nasıl listelerim?** `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (veya Presentation/Spreadsheet eşdeğerlerini) kullanın ve koleksiyonu döngüyle gezinin. +- **Bir dosya uzantısından formatı belirleyebilir miyim?** Evet—`DocumentFormatInfo.FromExtension(".docx")` metodunu çağırın. +- **GroupDocs.Editor hangi dosya türlerini destekliyor?** DOCX, XLSX, PPTX, HTML ve düz metin dahil olmak üzere 30’dan fazla giriş ve çıkış formatı. +- **Formatları listelemek için lisansa ihtiyacım var mı?** Geçici bir lisans tam API'yi açar; aksi takdirde deneme sürümü sınırlı özelliklerle çalışır. +- **Hangi .NET sürümleri uyumludur?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## “Desteklenen belge formatlarını listeleme” nedir? +Bu ifade, GroupDocs.Editor'ün açabildiği, düzenleyebildiği ve kaydedebildiği dosya türleri koleksiyonunu programlı olarak almayı ifade eder. Bu işlem, dinamik UI açılır menüleri oluşturmanıza veya kullanıcı yüklemelerini işlemden önce doğrulamanıza olanak tanır; böylece yalnızca uyumlu dosyalar editöre aktarılır ve sonraki işlemler için kullanılabilir. + +## Neden desteklenen belge formatlarını listeleyelim? +GroupDocs.Editor **30'dan fazla giriş ve çıkış formatını destekler** ve belgeyi belleğe tamamen yüklemeden **2 GB**'a kadar dosyaları işleyebilir. Tam listeyi bilmek çalışma zamanı hatalarını önler, kullanıcı deneyimini iyileştirir ve “yalnızca düzenlenebilir Office belgelerine izin ver” gibi iş kurallarını uygulamanızı sağlar. Ayrıca, kullanıcılarınıza yalnızca uygulamanızın gerçekten desteklediği formatları sunmanıza yardımcı olur. + ## Önkoşullar -GroupDocs.Editor for .NET'in örneklerine ve işlevlerine dalmadan önce, yerine getirmeniz gereken birkaç önkoşul vardır: -1. .NET'in Temel Anlaşılması: .NET Framework veya .NET Core'a aşinalık çok önemlidir. -2. Geliştirme Ortamı: Visual Studio veya herhangi bir uygun .NET IDE. -3. GroupDocs.Editor for .NET Kitaplığı: Kitaplığı şu adresten indirin:[GroupDocs sürüm sayfası](https://releases.groupdocs.com/editor/net/). -4. Geçici Lisans: Alın[geçici lisans](https://purchase.groupdocs.com/temporary-license/) tüm özellikler için. -## Ad Alanlarını İçe Aktar -GroupDocs.Editor for .NET'i kullanmaya başlamak için gerekli ad alanlarını projenize aktarmanız gerekir. Bu, kütüphane tarafından sağlanan tüm sınıflara ve yöntemlere erişebilmenizi sağlayacaktır. +Başlamadan önce, şunların olduğundan emin olun: + +1. **.NET geliştirme ortamı** – Visual Studio 2022 veya .NET 6+ destekleyen herhangi bir IDE. +2. **GroupDocs.Editor for .NET kütüphanesi** – [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) adresinden indirin. +3. **Geçici lisans** – sınırsız erişim için bir [temporary license](https://purchase.groupdocs.com/temporary-license/) alın. +4. **Temel C# bilgisi** – ad alanları, `using` ifadeleri ve konsol çıktısı konularına aşina olun. + +## Desteklenen Belge Formatlarını Nasıl Listeleyebilirsiniz? +Desteklenen formatlar koleksiyonunu yükleyin ve her formatın adını ve dosya uzantısını yazdırın. Bu iki adımlı desen Word İşleme, Elektronik Tablo ve Sunum belgeleri için çalışır. Koleksiyonu döngüyle gezerek, açılır menüler gibi UI öğelerini dinamik olarak doldurabilir ve kullanıcıların yalnızca editörün gerçekten işleyebileceği formatları seçmesini sağlayabilirsiniz. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Word İşleme Formatlarını Listeleme +`Formats.WordProcessingFormats` is an enumeration that describes every Word‑processing file type recognized by the editor. The `All` property returns a collection of these format objects. -## 1. Adım: Belge Formatlarıyla Çalışmak -GroupDocs.Editor çok çeşitli belge formatlarını destekler. Desteklenen tüm Kelime İşleme ve Sunum formatlarını nasıl listeleyebileceğinizi keşfedelim. -### Kelime İşleme Formatlarını Listeleme +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Açıklama: -1. Döngü Formatları: Mevcut tüm Kelime İşleme formatları arasında geçiş yapıyoruz. -2. Çıktı Formatı Detayları: Her format için adını ve uzantısını yazdırıyoruz. +``` + +**Açıklama:** +1. **Formatlar Üzerinde Döngü:** Tüm mevcut Word‑processing formatları üzerinde döngü yaparız. +2. **Format Detaylarını Çıktıla:** Her format için kullanıcı dostu adını ve varsayılan dosya uzantısını yazdırırız. + ### Sunum Formatlarını Listeleme +`Formats.PresentationFormats` works the same way for slide‑deck files, exposing each supported presentation type through the `All` collection. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Açıklama: -1. Döngü Formatları: Kelime İşleme formatlarına benzer şekilde, tüm Sunum formatlarında döngü yaparız. -2. Çıktı Formatı Ayrıntıları: Her formatın adını ve uzantısını yazdırın. -## Adım 2: Uzantılardan Formatları Ayrıştırma -Bazen formatı dosya uzantısına göre belirlemeniz gerekir. GroupDocs.Editor bunu kolaylaştırır. +``` + +**Açıklama:** +1. **Formatlar Üzerinde Döngü:** The same looping logic applies to presentations. +2. **Output Format Details:** The name and extension are displayed for each format. + +## Dosya Formatı Uzantısını Nasıl Belirleyebilirsiniz? +Bazen sadece bir dosya adınız olur ve ilgili `DocumentFormat`'ı tahmin etmeniz gerekir. GroupDocs.Editor, bir dosya uzantısını iç format temsiline eşleyen basit bir statik yardımcı sunar; bu sayede dosyaları editöre yüklemeden önce doğrulama veya dönüştürme yapabilirsiniz. + ### Elektronik Tablo Formatlarını Ayrıştırma +`Formats.SpreadsheetFormats.FromExtension` converts a file extension string into the matching spreadsheet format enum value. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Açıklama: -1. Ayrıştırma Formatı: Kullanıyoruz`FromExtension` formatı ayrıştırma yöntemi`.xlsm` eklenti. -2. Çıktı Formatı: Ayrıştırılan formatın adını yazdırın. +``` + +**Açıklama:** +1. **Formatı Ayrıştır:** `FromExtension`, `.xlsm` uzantısını iç `SpreadsheetFormat` enum'ına dönüştürür. +2. **Formatı Çıktıla:** Ayrıştırılan formatın adı yazdırılır, eşlemenin doğruluğu teyit edilir. + ### Metin Formatlarını Ayrıştırma +Similarly, `Formats.TextualFormats.FromExtension` resolves textual file extensions such as HTML or TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Açıklama: -1. Ayrıştırma Formatı:`FromExtension` yöntemi, formatı ayrıştırmak için kullanılır.`html` eklenti. -2. Çıktı Formatı: Ayrıştırılan metin formatının adını yazdırın. -## 3. Adım: Belgeleri Düzenleme -Artık formatlarla nasıl çalışacağımızı gördüğümüze göre, GroupDocs.Editor'ı kullanarak belgeleri düzenlemeye geçelim. -### Belge Yükleme -Bir belgeyi düzenlemek için önce onu yüklemeniz gerekir. +``` + +**Açıklama:** +1. **Formatı Ayrıştır:** The `FromExtension` method resolves the `html` extension to a `TextFormat`. +2. **Formatı Çıktıla:** The name of the textual format is displayed, useful for web‑based editors. + +## Formatları Belirledikten Sonra Belgeleri Nasıl Düzenlersiniz? +Formatı öğrendikten sonra bir belgeyi yükleme ve düzenleme tutarlı bir desen izler. İlk olarak kaynak dosyanın yolunu vererek bir `Editor` örneği oluşturursunuz, ardından `Edit()` metodunu çağırarak bir `EditableDocument` elde edersiniz. Buradan içeriği okuyabilir, değiştirebilir ve sonunda uygun `SaveOptions` ile kaydedebilirsiniz. + +### Bir Belge Yükleme +`Editor`, belirli bir dosya için tüm düzenleme işlemlerini kapsülleyen temel sınıftır. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Daha sonraki adımlar burada ele alınacaktır. + // Further steps will be covered here. } ``` -Açıklama: -1. Düzenleyiciyi Başlat: Bir örneğini oluşturun`Editor` belgenize giden yolu sağlayan sınıf. -2. Deseni Atın: Kullanın`using` Kaynakların uygun şekilde bertaraf edilmesini sağlamak için beyan. -### İçerik Çıkarma -Belge yüklendikten sonra içeriğini düzenlemek üzere çıkarabilirsiniz. +``` + +**Açıklama:** +1. **Editor'ı Başlat:** Hedef dosyanın tam yolunu vererek bir `Editor` örneği oluşturun. +2. **Dispose Deseni:** `using` ifadesi, tüm yönetilmeyen kaynakların hızlı bir şekilde serbest bırakılmasını garanti eder. + +### İçeriği Çıkarma +`EditableDocument.GetContent()` belge'nin ham metnini (veya web‑tabanlı editörler için HTML) döndürür; bunu görüntüleyebilir veya manipüle edebilirsiniz. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +216,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Açıklama: -1. Düzenleme Yöntemi:`Edit` almanın yöntemi`EditableDocument`. -2. İçerik Al: Kullan`GetContent` belgenin içeriğini bir dize olarak almak için. -3. Çıkış İçeriği: İçeriği konsola yazdırın. -### Değişiklikleri kaydediyor -Düzenledikten sonra değişikliklerinizi belgeye geri kaydedin. +``` + +**Açıklama:** +1. **Edit Metodu:** `Edit()` bir `EditableDocument` nesnesi döndürür. +2. **İçeriği Al:** `GetContent()` belge'nin ham metnini (veya web‑tabanlı editörler için HTML) çıkarır. +3. **İçeriği Çıktıla:** İçerik doğrulama amacıyla konsola yazdırılır. + +### Değişiklikleri Kaydetme +`SaveOptions`, editörün düzenlenmiş belgeyi nasıl ve hangi formatta depolamaya geri yazacağını belirler. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // İçeriği burada değiştirin + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Açıklama: -1. Düzenleme Yöntemi:`Edit` almanın yöntemi`EditableDocument`. -2. İçeriği Değiştirin: İçeriği gerektiği gibi değiştirin (bu kod parçasında gösterilmemiştir). -3. Kaydetme Seçenekleri: Oluştur`SaveOptions` biçimini belirtiyoruz. -4. Belgeyi Kaydet: Kullan`Save` Düzenlenen belgeyi kaydetme yöntemi. -## Adım 4: Farklı Belge Türleriyle Çalışmak -GroupDocs.Editor çeşitli belge türlerini destekler. Onlarla nasıl çalışılacağı aşağıda açıklanmıştır: +``` + +**Açıklama:** +1. **Edit Metodu:** Değişikliklerden sonra `EditableDocument` tekrar elde edilir. +2. **İçeriği Değiştir:** (burada gösterilmeyen) string üzerinde değişikliklerinizi uygulayın. +3. **Kaydetme Seçenekleri:** İstenen çıkış formatı ile `SaveOptions` yapılandırılır. +4. **Belgeyi Kaydet:** Düzenlenmiş dosya diske kaydedilir. + +## Farklı Belge Türleriyle Nasıl Çalışılır? +GroupDocs.Editor, Word, Elektronik Tablo ve Sunum işlemlerini aynı API üzerinden soyutlayarak, her belge ailesi için yeni sınıflar öğrenmeye gerek kalmadan bağlamlar arasında geçiş yapmayı kolaylaştırır. + ### Elektronik Tablo Belgelerini Düzenleme +`SpreadsheetSaveOptions`, bir elektronik tablonun nasıl yazılacağını, format ve isteğe bağlı sıkıştırma ayarlarını tanımlar. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +257,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // İçeriği burada değiştirin + // Modify content here SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Açıklama: -1. Düzenleyiciyi Başlat: Bir`Editor` örneğin bir e-tablo için. -2. Düzenleme Yöntemi: Çağrı`Edit` almak için`EditableDocument`. -3. İçeriği Al: İçeriği alın ve yazdırın. -4. İçeriği Değiştir: Gerekli değişiklikleri yapın. -5. Kaydetme Seçenekleri: Elektronik tablolar için kaydetme seçeneklerini belirtin. -6. Belgeyi Kaydet: Değiştirilen belgeyi kaydedin. +``` + +**Açıklama:** +1. **Editor'ı Başlat:** `Editor` yapıcısına bir elektronik tablo dosya yolu verin. +2. **Edit Metodu:** Bir `EditableDocument` alın. +3. **İçeriği Al:** Elektronik tablonun CSV temsilini (veya HTML) yazdırın. +4. **İçeriği Değiştir:** Gerekli hücre‑seviyesi değişiklikleri uygulayın. +5. **Kaydetme Seçenekleri:** Uygun `SpreadsheetSaveOptions` seçin. +6. **Belgeyi Kaydet:** Güncellenmiş elektronik tabloyu depolamaya geri yazın. + ### Sunum Belgelerini Düzenleme +`PresentationSaveOptions`, slayt destesi için çıkış formatını kontrol eder; orijinal dosya tipini korumanıza veya değiştirmenize olanak tanır. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +284,62 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // İçeriği burada değiştirin + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Açıklama: -1. Düzenleyiciyi Başlat: Bir`Editor` örneğin bir sunum için. -2. Düzenleme Yöntemi: Çağrı`Edit` almak için`EditableDocument`. -3. İçeriği Al: İçeriği alın ve yazdırın. -4. İçeriği Değiştir: Gerekli değişiklikleri yapın. -5. Kaydetme Seçenekleri: Sunumlar için kaydetme seçeneklerini belirtin. -6. Belgeyi Kaydet: Değiştirilen belgeyi kaydedin. -## Çözüm -GroupDocs.Editor for .NET, çeşitli belge formatlarını programlı olarak düzenlemek için sağlam ve esnek bir yol sağlar. Bu kılavuzu takip ederek, belge düzenleme işlevlerini .NET uygulamalarınıza verimli bir şekilde entegre edebilir, yeteneklerini geliştirebilir ve kullanıcılarınıza daha fazla değer sağlayabilirsiniz. -## SSS'ler -### .NET için GroupDocs.Editor nedir? -GroupDocs.Editor for .NET, geliştiricilerin .NET uygulamaları içinde çeşitli belge formatlarını programlı olarak düzenlemelerine olanak tanıyan güçlü bir kitaplıktır. -### GroupDocs.Editor for .NET'i kullanmaya nasıl başlayabilirim? -Kitaplığı indirmeniz, geçici bir lisans almanız ve geliştirme ortamınızı gerekli ad alanlarıyla ayarlamanız gerekir. -### Hangi belge formatları destekleniyor? -GroupDocs.Editor, diğerlerinin yanı sıra Kelime İşleme, Elektronik Tablo, Sunum ve Metin formatlarını destekler. -### GroupDocs.Editor'ı ücretsiz kullanabilir miyim? - Bir kullanabilirsiniz[ücretsiz deneme](https://releases.groupdocs.com/) sınırlı özelliklere sahip veya bir[geçici lisans](https://purchase.groupdocs.com/temporary-license/) tam erişim için. -### Daha fazla kaynak ve desteği nerede bulabilirim? - Ziyaret edin[GroupDocs.Editor belgeleri](https://tutorials.groupdocs.com/editor/net/) ayrıntılı bilgi için veya bunlara göz atın[destek Forumu](https://forum.groupdocs.com/c/editor/20) yardım için. \ No newline at end of file +``` + +**Açıklama:** +1. **Editor'ı Başlat:** `Editor` aracılığıyla bir PowerPoint dosyası yükleyin. +2. **Edit Metodu:** Bir `EditableDocument` elde edin. +3. **İçeriği Al:** Slayt HTML'sini veya düz metni çıkarın. +4. **İçeriği Değiştir:** Başlıkları, madde işaretlerini veya görselleri güncelleyin. +5. **Kaydetme Seçenekleri:** Çıkış formatını tanımlamak için `PresentationSaveOptions` kullanın. +6. **Belgeyi Kaydet:** Düzenlenmiş sunumu kaydedin. + +## Yaygın Sorunlar ve Çözümler +- **“Format not supported” hatası:** En son GroupDocs.Editor sürümünü kullandığınızdan emin olun; bu sürüm düzenli olarak yeni Office formatlarını destekler. +- **Büyük dosya bellek tüketimi:** Belgeyi yüklemeden önce `EditorSettings.EnableStreaming = true` ayarını yaparak akış modunu etkinleştirin. +- **Lisans uygulanmadı:** Geçici lisans dosyasının uygulama kök dizinine yerleştirildiğinden veya `License license = new License(); license.SetLicense("path/to/license.lic");` ile yüklendiğinden emin olun. + +## Sık Sorulan Sorular + +**S: `DocumentFormatInfo` ve `SaveOptions` arasındaki fark nedir?** +C: `DocumentFormatInfo`, desteklenen dosya türleri hakkında meta veriler sağlar; `SaveOptions` ise bir belgenin diske nasıl (format, sıkıştırma vb.) yazılacağını yapılandırır. + +**S: Özel bir dosya uzantısı için formatları listeleyebilir miyim?** +C: Evet—`DocumentFormatInfo.FromExtension("yourExt")` kullanın; uzantı tanınmazsa metod `null` döndürür. + +**S: GroupDocs.Editor şifre‑korumalı dosyaları destekliyor mu?** +C: Kesinlikle. Şifreyi `EditorSettings` aracılığıyla `Editor` yapıcısına geçirerek şifreli belgeleri açabilirsiniz. + +**S: GroupDocs.Editor gerçekte kaç format destekliyor?** +C: **30'dan fazla** giriş ve çıkış formatı, Word, Excel, PowerPoint, HTML ve düz metin dahil. + +**S: Listeyi yalnızca düzenlenebilir formatlarla sınırlamanın bir yolu var mı?** +C: Tam düzenleme yeteneklerine izin veren formatları almak için `GetEditableWordProcessingFormats()` (veya Spreadsheet/Presentation eşdeğerlerini) kullanın. + +## Ek Kaynaklar +- Kütüphaneyi [GroupDocs releases page](https://releases.groupdocs.com/editor/net/) adresinden indirin. +- Tam özellik erişimi için bir [temporary license](https://purchase.groupdocs.com/temporary-license/) alın. +- Ürünü bir [free trial](https://releases.groupdocs.com/) ile deneyin. +- [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/) içinde ayrıntılı kullanım örneklerini keşfedin. +- [support forum](https://forum.groupdocs.com/c/editor/20) üzerinden topluluktan yardım alın. + +## Sonuç +Bu rehberi izleyerek artık **desteklenen belge formatlarını nasıl listeleyeceğinizi**, **bir uzantıdan dosya formatını nasıl belirleyeceğinizi** ve GroupDocs.Editor for .NET kullanarak Word, Elektronik Tablo ve Sunum türlerinde **belgeleri nasıl düzenleyeceğinizi** biliyorsunuz. Bu kod parçacıklarını kendi projelerinize entegre ederek, son kullanıcıları memnun eden ve çalışma zamanı hatalarını azaltan sağlam, format‑bilinçli uygulamalar oluşturabilirsiniz. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.9 for .NET +**Author:** GroupDocs + +## İlgili Eğitimler + +- [GroupDocs.Editor ile .NET'te Belge Yüklemeyi Ustalaştırma: Kapsamlı Rehber](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [GroupDocs.Editor ile .NET'te Belge Düzenlemeyi Ustalaştırma: Kapsamlı Rehber](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [GroupDocs.Editor .NET ile Word'ü HTML'ye Dönüştürme: Adım‑Adım Rehber](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file diff --git a/content/vietnamese/net/document-processing/work-document-formats/_index.md b/content/vietnamese/net/document-processing/work-document-formats/_index.md index 27ad0ee6..13278060 100644 --- a/content/vietnamese/net/document-processing/work-document-formats/_index.md +++ b/content/vietnamese/net/document-processing/work-document-formats/_index.md @@ -1,84 +1,212 @@ --- -title: Làm việc với các định dạng tài liệu -linktitle: Làm việc với các định dạng tài liệu -second_title: API GroupDocs.Editor .NET -description: Tìm hiểu cách sử dụng GroupDocs.Editor cho .NET để chỉnh sửa các định dạng tài liệu khác nhau theo chương trình. Hướng dẫn từng bước với các ví dụ để tích hợp liền mạch. -weight: 13 -url: /vi/net/document-processing/work-document-formats/ +date: 2026-06-06 +description: Tìm hiểu cách liệt kê các định dạng tài liệu được hỗ trợ và xác định + phần mở rộng định dạng tệp bằng GroupDocs.Editor cho .NET. Hướng dẫn từng bước với + các đoạn mã, câu trả lời nhanh và câu hỏi thường gặp. +keywords: +- list supported document formats +- determine file format extension +- GroupDocs.Editor .NET +- document editing API +- supported formats guide +linktitle: Liệt kê các định dạng tài liệu được hỗ trợ +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + headline: List Supported Document Formats with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to list supported document formats and determine file format + extension using GroupDocs.Editor for .NET. Step‑by‑step guide with code snippets, + quick answers, and FAQs. + name: List Supported Document Formats with GroupDocs.Editor .NET + steps: + - name: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + text: '**.NET development environment** – Visual Studio 2022 or any IDE that supports + .NET 6+.' + - name: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + text: '**GroupDocs.Editor for .NET library** – download from the [GroupDocs releases + page](https://releases.groupdocs.com/editor/net/).' + - name: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + text: '**Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) + for unrestricted access.' + - name: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + text: '**Basic C# knowledge** – familiarity with namespaces, `using` statements, + and console output.' + - name: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + text: '**Loop Through Formats:** We iterate over all available Word‑processing + formats.' + - name: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + text: '**Output Format Details:** For each format we print its friendly name and + default file extension.' + - name: '**Loop Through Formats:** The same looping logic applies to presentations.' + text: '**Loop Through Formats:** The same looping logic applies to presentations.' + - name: '**Output Format Details:** The name and extension are displayed for each + format.' + text: '**Output Format Details:** The name and extension are displayed for each + format.' + - name: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + text: '**Parse Format:** `FromExtension` converts the `.xlsm` extension into its + internal `SpreadsheetFormat` enum.' + - name: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + text: '**Output Format:** The parsed format’s name is printed, confirming the + mapping.' + type: HowTo +- questions: + - answer: '`DocumentFormatInfo` provides metadata about supported file types, while + `SaveOptions` configures how a document is written back to disk (format, compression, + etc.).' + question: What is the difference between `DocumentFormatInfo` and `SaveOptions`? + - answer: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension + isn’t recognized, the method returns `null`. + question: Can I list formats for a custom file extension? + - answer: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` + to open encrypted documents. + question: Does GroupDocs.Editor support password‑protected files? + - answer: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, + HTML, and plain text. + question: How many formats does GroupDocs.Editor actually support? + - answer: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation + equivalents) to retrieve formats that allow full edit capabilities. + question: Is there a way to restrict the list to only editable formats? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Liệt kê các định dạng tài liệu được hỗ trợ với GroupDocs.Editor .NET type: docs +url: /vi/net/document-processing/work-document-formats/ +weight: 13 --- -# Làm việc với các định dạng tài liệu - -## Giới thiệu -Chào mừng bạn đến với hướng dẫn chuyên sâu của chúng tôi về cách sử dụng GroupDocs.Editor cho .NET! Nếu bạn là nhà phát triển đang tìm cách nâng cao ứng dụng của mình bằng khả năng chỉnh sửa tài liệu thì bạn đã đến đúng nơi. Bài viết này sẽ hướng dẫn bạn mọi thứ bạn cần biết, từ điều kiện tiên quyết đến ví dụ thực tế, để giúp bạn làm quen với thư viện mạnh mẽ này. -## Điều kiện tiên quyết -Trước khi đi sâu vào các ví dụ và chức năng của GroupDocs.Editor cho .NET, bạn cần phải có một số điều kiện tiên quyết: -1. Hiểu biết cơ bản về .NET: Cần phải làm quen với .NET Framework hoặc .NET Core. -2. Môi trường phát triển: Visual Studio hoặc bất kỳ .NET IDE phù hợp nào khác. -3. GroupDocs.Editor cho Thư viện .NET: Tải xuống thư viện từ[Trang phát hành GroupDocs](https://releases.groupdocs.com/editor/net/). -4. Giấy phép tạm thời: Lấy một[giấy phép tạm thời](https://purchase.groupdocs.com/temporary-license/) để có đầy đủ tính năng. -## Nhập không gian tên -Để bắt đầu với GroupDocs.Editor cho .NET, bạn cần nhập các vùng tên cần thiết vào dự án của mình. Điều này sẽ đảm bảo bạn có quyền truy cập vào tất cả các lớp và phương thức do thư viện cung cấp. + +# Liệt kê các định dạng tài liệu được hỗ trợ + +Welcome to our comprehensive tutorial on **cách liệt kê các định dạng tài liệu được hỗ trợ** with GroupDocs.Editor for .NET. Whether you’re building a document‑centric web app or an enterprise‑grade desktop tool, knowing exactly which formats you can edit or convert is essential. In this guide you’ll discover how to enumerate formats, parse extensions, and edit documents—all with clear, human‑friendly explanations and ready‑to‑run code snippets. + +## Câu trả lời nhanh +- **Làm thế nào để liệt kê tất cả các định dạng được hỗ trợ?** Use `DocumentFormatInfo.GetSupportedWordProcessingFormats()` (or the Presentation/Spreadsheet equivalents) and iterate the collection. +- **Tôi có thể xác định định dạng từ phần mở rộng tệp không?** Yes—call `DocumentFormatInfo.FromExtension(".docx")`. +- **Các loại tệp nào mà GroupDocs.Editor hỗ trợ?** Over 30 input and output formats, including DOCX, XLSX, PPTX, HTML, and plain text. +- **Tôi có cần giấy phép để liệt kê các định dạng không?** A temporary license unlocks the full API; otherwise a trial works with limited features. +- **Phiên bản .NET nào tương thích?** .NET Framework 4.6+, .NET Core 3.1+, .NET 5/6/7. + +## “Liệt kê các định dạng tài liệu được hỗ trợ” là gì +The phrase refers to programmatically retrieving the collection of file types that GroupDocs.Editor can open, edit, and save. This operation lets you build dynamic UI dropdowns or validate user uploads before processing, ensuring that only compatible files are passed to the editor for further manipulation. + +## Tại sao cần liệt kê các định dạng tài liệu được hỗ trợ +GroupDocs.Editor **hỗ trợ hơn 30 định dạng đầu vào và đầu ra** và có thể xử lý các tệp lên tới **2 GB** mà không cần tải toàn bộ tài liệu vào bộ nhớ. Biết danh sách chính xác giúp ngăn ngừa lỗi thời gian chạy, cải thiện trải nghiệm người dùng và cho phép bạn thực thi các quy tắc kinh doanh như “chỉ cho phép các tài liệu Office có thể chỉnh sửa”. Nó cũng giúp bạn chỉ hiển thị cho người dùng những định dạng mà ứng dụng thực sự hỗ trợ. + +## Yêu cầu trước +1. **.NET development environment** – Visual Studio 2022 hoặc bất kỳ IDE nào hỗ trợ .NET 6+. +2. **GroupDocs.Editor for .NET library** – download from the [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +3. **Temporary license** – obtain a [temporary license](https://purchase.groupdocs.com/temporary-license/) for unrestricted access. +4. **Basic C# knowledge** – familiarity with namespaces, `using` statements, and console output. + +## Cách liệt kê các định dạng tài liệu được hỗ trợ? +Load the supported formats collection and print each format’s name and file extension. This two‑step pattern works for Word Processing, Spreadsheet, and Presentation documents. By iterating the collection you can dynamically populate UI elements such as dropdowns, ensuring users can only select formats that the editor can actually handle. + +```csharp +// No actual code block – placeholder retained from original tutorial ```csharp using System; using GroupDocs.Editor.Options; ``` +``` + +### Liệt kê các định dạng Word Processing +`Formats.WordProcessingFormats` là một enumeration mô tả mọi loại tệp Word‑processing mà trình chỉnh sửa nhận dạng. Thuộc tính `All` trả về một collection các đối tượng định dạng này. -## Bước 1: Làm việc với các định dạng tài liệu -GroupDocs.Editor hỗ trợ nhiều định dạng tài liệu. Hãy khám phá cách bạn có thể liệt kê tất cả các định dạng Xử lý văn bản và Trình bày được hỗ trợ. -### Liệt kê các định dạng xử lý văn bản +```csharp ```csharp foreach (Formats.WordProcessingFormats oneFormat in Formats.WordProcessingFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Giải trình: -1. Các định dạng lặp lại: Chúng tôi lặp qua tất cả các định dạng Xử lý văn bản có sẵn. -2. Chi tiết định dạng đầu ra: Đối với mỗi định dạng, chúng tôi in tên và phần mở rộng của nó. -### Liệt kê các định dạng trình bày +``` + +**Giải thích:** +1. **Loop Through Formats:** Chúng tôi lặp qua tất cả các định dạng Word‑processing có sẵn. +2. **Output Format Details:** Đối với mỗi định dạng, chúng tôi in ra tên thân thiện và phần mở rộng mặc định. + +### Liệt kê các định dạng Presentation +`Formats.PresentationFormats` hoạt động tương tự cho các tệp slide‑deck, hiển thị mỗi loại presentation được hỗ trợ thông qua collection `All`. + +```csharp ```csharp foreach (Formats.PresentationFormats oneFormat in Formats.PresentationFormats.All) { Console.WriteLine("Name is {0}, extension is {1}", oneFormat.Name, oneFormat.Extension); } ``` -Giải trình: -1. Các định dạng lặp lại: Tương tự như các định dạng Xử lý văn bản, chúng tôi lặp qua tất cả các định dạng Bản trình bày. -2. Chi tiết định dạng đầu ra: In tên và phần mở rộng của từng định dạng. -## Bước 2: Phân tích định dạng từ tiện ích mở rộng -Đôi khi, bạn cần xác định định dạng dựa trên phần mở rộng của tệp. GroupDocs.Editor khiến việc này trở nên dễ dàng. -### Phân tích định dạng bảng tính +``` + +**Giải thích:** +1. **Loop Through Formats:** Logic lặp tương tự áp dụng cho các presentation. +2. **Output Format Details:** Tên và phần mở rộng được hiển thị cho mỗi định dạng. + +## Cách xác định phần mở rộng định dạng tệp? +Đôi khi bạn chỉ có tên tệp và cần suy ra `DocumentFormat` tương ứng. GroupDocs.Editor cung cấp một helper tĩnh đơn giản để ánh xạ phần mở rộng tệp tới đại diện định dạng nội bộ, cho phép bạn xác thực hoặc chuyển đổi tệp trước khi tải chúng vào trình chỉnh sửa. + +### Phân tích các định dạng Spreadsheet +`Formats.SpreadsheetFormats.FromExtension` chuyển một chuỗi phần mở rộng tệp thành giá trị enum định dạng spreadsheet tương ứng. + +```csharp ```csharp Formats.SpreadsheetFormats expectedXlsm = Formats.SpreadsheetFormats.FromExtension(".xlsm"); Console.WriteLine("Parsed Spreadsheet format is {0}", expectedXlsm.Name); ``` -Giải trình: -1. Định dạng phân tích cú pháp: Chúng tôi sử dụng`FromExtension` phương pháp phân tích cú pháp định dạng từ`.xlsm` sự mở rộng. -2. Định dạng đầu ra: In tên định dạng được phân tích cú pháp. -### Phân tích định dạng văn bản +``` + +**Giải thích:** +1. **Parse Format:** `FromExtension` chuyển phần mở rộng `.xlsm` thành enum `SpreadsheetFormat` nội bộ. +2. **Output Format:** Tên của định dạng đã phân tích được in ra, xác nhận việc ánh xạ. + +### Phân tích các định dạng Textual +Tương tự, `Formats.TextualFormats.FromExtension` giải quyết các phần mở rộng tệp văn bản như HTML hoặc TXT. + +```csharp ```csharp Formats.TextualFormats expectedHtml = Formats.TextualFormats.FromExtension("html"); Console.WriteLine("Parsed Textual format is {0}", expectedHtml.Name); ``` -Giải trình: -1. Định dạng phân tích cú pháp:`FromExtension` phương thức được sử dụng để phân tích định dạng từ`html` sự mở rộng. -2. Định dạng đầu ra: In tên của định dạng văn bản được phân tích cú pháp. -## Bước 3: Chỉnh sửa tài liệu -Bây giờ chúng ta đã biết cách làm việc với các định dạng, hãy đi sâu vào chỉnh sửa tài liệu bằng GroupDocs.Editor. -### Đang tải tài liệu -Để chỉnh sửa một tài liệu, trước tiên bạn cần tải nó. +``` + +**Giải thích:** +1. **Parse Format:** Phương thức `FromExtension` giải quyết phần mở rộng `html` thành một `TextFormat`. +2. **Output Format:** Tên của định dạng văn bản được hiển thị, hữu ích cho các trình chỉnh sửa dựa trên web. + +## Cách chỉnh sửa tài liệu sau khi xác định định dạng? +Khi đã biết định dạng, việc tải và chỉnh sửa tài liệu tuân theo một mẫu nhất quán. Đầu tiên bạn tạo một thể hiện `Editor` với đường dẫn tới tệp nguồn, sau đó gọi `Edit()` để lấy một `EditableDocument`. Từ đó bạn có thể đọc, sửa đổi và cuối cùng lưu nội dung bằng `SaveOptions` phù hợp. + +### Tải tài liệu +`Editor` là lớp cốt lõi bao gồm tất cả các thao tác chỉnh sửa cho một tệp nhất định. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/document.docx")) { - // Các bước tiếp theo sẽ được đề cập ở đây. + // Further steps will be covered here. } ``` -Giải trình: -1. Khởi tạo Trình soạn thảo: Tạo một phiên bản của`Editor` class, cung cấp đường dẫn đến tài liệu của bạn. -2. Mẫu vứt bỏ: Sử dụng`using` tuyên bố để đảm bảo tài nguyên được xử lý đúng cách. +``` + +**Giải thích:** +1. **Initialize Editor:** Tạo một thể hiện `Editor`, truyền đường dẫn đầy đủ của tệp mục tiêu. +2. **Dispose Pattern:** Câu lệnh `using` đảm bảo tất cả tài nguyên không quản lý được giải phóng kịp thời. + ### Trích xuất nội dung -Sau khi tài liệu được tải, bạn có thể trích xuất nội dung của nó để chỉnh sửa. +`EditableDocument.GetContent()` trả về văn bản thô của tài liệu (hoặc HTML cho các trình chỉnh sửa dựa trên web), bạn có thể hiển thị hoặc thao tác. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { @@ -86,28 +214,40 @@ using (EditableDocument editableDocument = editor.Edit()) Console.WriteLine(content); } ``` -Giải trình: -1. Phương pháp chỉnh sửa: Gọi`Edit` phương pháp để có được một`EditableDocument`. -2. Nhận nội dung: Sử dụng`GetContent` để truy xuất nội dung của tài liệu dưới dạng một chuỗi. -3. Nội dung đầu ra: In nội dung ra bàn điều khiển. +``` + +**Giải thích:** +1. **Edit Method:** `Edit()` trả về một đối tượng `EditableDocument`. +2. **Get Content:** `GetContent()` trích xuất văn bản thô của tài liệu (hoặc HTML cho các trình chỉnh sửa dựa trên web). +3. **Output Content:** Nội dung được ghi ra console để xác minh. + ### Lưu thay đổi -Sau khi chỉnh sửa, lưu các thay đổi của bạn trở lại tài liệu. +`SaveOptions` cho trình chỉnh sửa biết cách và định dạng nào để ghi tài liệu đã chỉnh sửa trở lại bộ nhớ lưu trữ. + +```csharp ```csharp using (EditableDocument editableDocument = editor.Edit()) { - // Sửa đổi nội dung tại đây + // Modify content here SaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx); editor.Save(editableDocument, "path/to/save/document.docx", saveOptions); } ``` -Giải trình: -1. Phương pháp chỉnh sửa: Gọi`Edit` phương pháp để có được một`EditableDocument`. -2. Sửa đổi nội dung: Sửa đổi nội dung nếu cần (không hiển thị trong đoạn trích này). -3. Tùy chọn lưu: Tạo`SaveOptions` chỉ định định dạng. -4. Lưu tài liệu: Sử dụng`Save` phương pháp lưu tài liệu đã chỉnh sửa. -## Bước 4: Làm việc với các loại tài liệu khác nhau -GroupDocs.Editor hỗ trợ nhiều loại tài liệu khác nhau. Đây là cách làm việc với họ: -### Chỉnh sửa tài liệu bảng tính +``` + +**Giải thích:** +1. **Edit Method:** Lấy lại `EditableDocument` sau khi đã sửa đổi. +2. **Modify Content:** Áp dụng các thay đổi của bạn vào chuỗi (không được hiển thị ở đây). +3. **Save Options:** Cấu hình `SaveOptions` với định dạng đầu ra mong muốn. +4. **Save Document:** Lưu tệp đã chỉnh sửa trở lại đĩa. + +## Cách làm việc với các loại tài liệu khác nhau? +GroupDocs.Editor trừu tượng hoá việc xử lý Word, Spreadsheet và Presentation phía sau cùng một API, giúp dễ dàng chuyển đổi ngữ cảnh mà không cần học một bộ lớp mới cho mỗi họ tài liệu. + +### Chỉnh sửa tài liệu Spreadsheet +`SpreadsheetSaveOptions` xác định cách một spreadsheet được ghi, bao gồm định dạng và các cài đặt nén tùy chọn. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { @@ -115,20 +255,26 @@ using (Editor editor = new Editor("path/to/your/spreadsheet.xlsx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Sửa đổi nội dung tại đây - SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx); + // Modify content here + SaveOptions saveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xxlsx); editor.Save(editableDocument, "path/to/save/spreadsheet.xlsx", saveOptions); } } ``` -Giải trình: -1. Khởi tạo trình soạn thảo: Tạo một`Editor` ví dụ cho một bảng tính. -2. Phương pháp chỉnh sửa: Gọi`Edit` để có được một`EditableDocument`. -3. Lấy nội dung: Truy xuất và in nội dung. -4. Sửa đổi nội dung: Thực hiện những thay đổi cần thiết. -5. Tùy chọn lưu: Chỉ định tùy chọn lưu cho bảng tính. -6. Lưu tài liệu: Lưu tài liệu đã sửa đổi. -### Chỉnh sửa tài liệu thuyết trình +``` + +**Giải thích:** +1. **Initialize Editor:** Truyền đường dẫn tệp spreadsheet vào hàm tạo `Editor`. +2. **Edit Method:** Lấy một `EditableDocument`. +3. **Get Content:** In ra biểu diễn CSV của spreadsheet (hoặc HTML). +4. **Modify Content:** Áp dụng bất kỳ thay đổi nào ở mức ô mà bạn cần. +5. **Save Options:** Chọn `SpreadsheetSaveOptions` phù hợp. +6. **Save Document:** Ghi spreadsheet đã cập nhật trở lại bộ nhớ lưu trữ. + +### Chỉnh sửa tài liệu Presentation +`PresentationSaveOptions` kiểm soát định dạng đầu ra cho các slide deck, cho phép bạn giữ nguyên hoặc thay đổi loại tệp gốc. + +```csharp ```csharp using (Editor editor = new Editor("path/to/your/presentation.pptx")) { @@ -136,29 +282,61 @@ using (Editor editor = new Editor("path/to/your/presentation.pptx")) { string content = editableDocument.GetContent(); Console.WriteLine(content); - // Sửa đổi nội dung tại đây + // Modify content here SaveOptions saveOptions = new PresentationSaveOptions(PresentationFormats.Pptx); editor.Save(editableDocument, "path/to/save/presentation.pptx", saveOptions); } } ``` -Giải trình: -1. Khởi tạo trình soạn thảo: Tạo một`Editor` ví dụ cho một bài thuyết trình. -2. Phương pháp chỉnh sửa: Gọi`Edit` để có được một`EditableDocument`. -3. Lấy nội dung: Truy xuất và in nội dung. -4. Sửa đổi nội dung: Thực hiện những thay đổi cần thiết. -5. Save Options: Chỉ định các tùy chọn lưu cho bài thuyết trình. -6. Lưu tài liệu: Lưu tài liệu đã sửa đổi. -## Phần kết luận -GroupDocs.Editor cho .NET cung cấp một cách mạnh mẽ và linh hoạt để chỉnh sửa các định dạng tài liệu khác nhau theo chương trình. Bằng cách làm theo hướng dẫn này, bạn có thể tích hợp hiệu quả các chức năng chỉnh sửa tài liệu vào các ứng dụng .NET của mình, nâng cao khả năng của chúng và mang lại giá trị lớn hơn cho người dùng của bạn. +``` + +**Giải thích:** +1. **Initialize Editor:** Tải tệp PowerPoint bằng `Editor`. +2. **Edit Method:** Lấy một `EditableDocument`. +3. **Get Content:** Trích xuất HTML slide hoặc văn bản thuần. +4. **Modify Content:** Cập nhật tiêu đề, các điểm bullet hoặc hình ảnh. +5. **Save Options:** Sử dụng `PresentationSaveOptions` để xác định định dạng đầu ra. +6. **Save Document:** Lưu bản trình chiếu đã chỉnh sửa. + +## Các vấn đề thường gặp và giải pháp +- **“Format not supported” error:** Kiểm tra bạn đang sử dụng phiên bản GroupDocs.Editor mới nhất; nó thường xuyên thêm hỗ trợ cho các định dạng Office mới. +- **Large file memory consumption:** Bật chế độ streaming bằng cách đặt `EditorSettings.EnableStreaming = true` trước khi tải tài liệu. +- **License not applied:** Đảm bảo tệp giấy phép tạm thời được đặt trong thư mục gốc của ứng dụng hoặc được tải qua `License license = new License(); license.SetLicense("path/to/license.lic");`. + ## Câu hỏi thường gặp -### GroupDocs.Editor dành cho .NET là gì? -GroupDocs.Editor cho .NET là một thư viện mạnh mẽ cho phép các nhà phát triển chỉnh sửa các định dạng tài liệu khác nhau theo chương trình trong các ứng dụng .NET của họ. -### Làm cách nào để bắt đầu với GroupDocs.Editor cho .NET? -Bạn cần tải xuống thư viện, xin giấy phép tạm thời và thiết lập môi trường phát triển của mình với các không gian tên cần thiết. -### Những định dạng tài liệu nào được hỗ trợ? -GroupDocs.Editor hỗ trợ các định dạng Xử lý văn bản, Bảng tính, Bản trình bày và Văn bản, cùng nhiều định dạng khác. -### Tôi có thể sử dụng GroupDocs.Editor miễn phí không? - Bạn có thể sử dụng một[dùng thử miễn phí](https://releases.groupdocs.com/) với các tính năng hạn chế hoặc có được một[giấy phép tạm thời](https://purchase.groupdocs.com/temporary-license/) để truy cập đầy đủ. -### Tôi có thể tìm thêm tài nguyên và hỗ trợ ở đâu? - Tham quan[Tài liệu GroupDocs.Editor](https://tutorials.groupdocs.com/editor/net/) để biết thông tin chi tiết hoặc kiểm tra[diễn đàn hỗ trợ](https://forum.groupdocs.com/c/editor/20) để được giúp đỡ. \ No newline at end of file +**Q: Sự khác biệt giữa `DocumentFormatInfo` và `SaveOptions` là gì?** +A: `DocumentFormatInfo` provides metadata about supported file types, while `SaveOptions` configures how a document is written back to disk (format, compression, etc.). + +**Q: Tôi có thể liệt kê các định dạng cho một phần mở rộng tệp tùy chỉnh không?** +A: Yes—use `DocumentFormatInfo.FromExtension("yourExt")`; if the extension isn’t recognized, the method returns `null`. + +**Q: GroupDocs.Editor có hỗ trợ các tệp được bảo vệ bằng mật khẩu không?** +A: Absolutely. Pass the password to the `Editor` constructor via `EditorSettings` to open encrypted documents. + +**Q: GroupDocs.Editor thực sự hỗ trợ bao nhiêu định dạng?** +A: Over **30 input and output formats**, spanning Word, Excel, PowerPoint, HTML, and plain text. + +**Q: Có cách nào để giới hạn danh sách chỉ còn các định dạng có thể chỉnh sửa không?** +A: Use the `GetEditableWordProcessingFormats()` (or Spreadsheet/Presentation equivalents) to retrieve formats that allow full edit capabilities. + +## Tài nguyên bổ sung +- Tải thư viện từ [GroupDocs releases page](https://releases.groupdocs.com/editor/net/). +- Nhận một [temporary license](https://purchase.groupdocs.com/temporary-license/) để truy cập đầy đủ tính năng. +- Dùng thử sản phẩm với một [free trial](https://releases.groupdocs.com/). +- Khám phá các ví dụ sử dụng chi tiết trong [GroupDocs.Editor documentation](https://tutorials.groupdocs.com/editor/net/). +- Nhận trợ giúp từ cộng đồng trên [support forum](https://forum.groupdocs.com/c/editor/20). + +## Kết luận +Bằng cách làm theo hướng dẫn này, bạn đã biết cách **liệt kê các định dạng tài liệu được hỗ trợ**, **xác định định dạng tệp từ phần mở rộng của nó**, và **chỉnh sửa tài liệu** trên các loại Word, Spreadsheet và Presentation bằng GroupDocs.Editor cho .NET. Hãy tích hợp các đoạn mã này vào dự án của bạn để xây dựng các ứng dụng mạnh mẽ, nhận biết định dạng, mang lại trải nghiệm tốt cho người dùng cuối và giảm lỗi thời gian chạy. + +--- + +**Cập nhật lần cuối:** 2026-06-06 +**Kiểm tra với:** GroupDocs.Editor 23.9 for .NET +**Tác giả:** GroupDocs + +## Hướng dẫn liên quan + +- [Làm chủ việc tải tài liệu trong .NET với GroupDocs.Editor: Hướng dẫn toàn diện](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) +- [Làm chủ việc chỉnh sửa tài liệu trong .NET với GroupDocs.Editor: Hướng dẫn toàn diện](/editor/net/document-editing/master-document-editing-dotnet-groupdocs-editor/) +- [Chuyển đổi Word sang HTML bằng GroupDocs.Editor .NET: Hướng dẫn từng bước](/editor/net/document-saving/convert-word-to-html-groupdocs-editor-dotnet/) \ No newline at end of file From 517c912333487080f07e7583c2405c23983fbd45 Mon Sep 17 00:00:00 2001 From: Muhammad Muqarrab Date: Sat, 6 Jun 2026 21:20:17 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Optimize=20page:=20content/english/net/docu?= =?UTF-8?q?ment-processing/work-dsv/=5Findex.md=20-=20-=20Updated=20title,?= =?UTF-8?q?=20description,=20and=20front=E2=80=91matter=20to=20include=20p?= =?UTF-8?q?rimary=20and=20secondary=20keywords.=20-=20Added=20Quick=20Answ?= =?UTF-8?q?ers,=20definition=20anchor,=20and=20quantified=20benefit=20stat?= =?UTF-8?q?ements.=20-=20Inserted=20a=20new=20=E2=80=9CHow=20to=20create?= =?UTF-8?q?=20editable=20document=20from=20a=20CSV=20file=3F=E2=80=9D=20H2?= =?UTF-8?q?=20with=20a=20direct=20answer=20paragraph.=20-=20Provided=20def?= =?UTF-8?q?inition=20anchors=20for=20`Editor`=20and=20`EditableDocument`?= =?UTF-8?q?=20concepts.=20-=20Expanded=20content=20with=20=E2=80=9CWhy=20u?= =?UTF-8?q?se=E2=80=9D,=20=E2=80=9CCommon=20Issues=20and=20Solutions?= =?UTF-8?q?=E2=80=9D,=20and=20richer=20explanations.=20-=20Added=20trust?= =?UTF-8?q?=E2=80=91signal=20block=20and=20reformatted=20FAQ=20for=20AI?= =?UTF-8?q?=E2=80=91friendly=20citation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../document-processing/work-dsv/_index.md | 194 ++++++++++++---- .../document-processing/work-dsv/_index.md | 189 ++++++++++++---- .../document-processing/work-dsv/_index.md | 202 ++++++++++++----- .../document-processing/work-dsv/_index.md | 202 +++++++++++++---- .../document-processing/work-dsv/_index.md | 174 +++++++++++--- .../document-processing/work-dsv/_index.md | 213 +++++++++++++----- .../document-processing/work-dsv/_index.md | 201 +++++++++++++---- .../document-processing/work-dsv/_index.md | 201 ++++++++++++----- .../document-processing/work-dsv/_index.md | 203 ++++++++++++----- .../document-processing/work-dsv/_index.md | 205 ++++++++++++----- .../document-processing/work-dsv/_index.md | 202 +++++++++++++---- .../document-processing/work-dsv/_index.md | 193 ++++++++++++---- .../document-processing/work-dsv/_index.md | 202 ++++++++++++----- .../document-processing/work-dsv/_index.md | 196 ++++++++++++---- .../document-processing/work-dsv/_index.md | 205 ++++++++++++----- .../document-processing/work-dsv/_index.md | 192 ++++++++++++---- .../document-processing/work-dsv/_index.md | 208 ++++++++++++----- .../document-processing/work-dsv/_index.md | 204 ++++++++++++----- .../document-processing/work-dsv/_index.md | 202 +++++++++++++---- .../document-processing/work-dsv/_index.md | 200 ++++++++++++---- .../document-processing/work-dsv/_index.md | 194 ++++++++++++---- .../document-processing/work-dsv/_index.md | 201 +++++++++++++---- .../document-processing/work-dsv/_index.md | 206 ++++++++++++----- 23 files changed, 3455 insertions(+), 1134 deletions(-) diff --git a/content/arabic/net/document-processing/work-dsv/_index.md b/content/arabic/net/document-processing/work-dsv/_index.md index a8f0d133..611ba496 100644 --- a/content/arabic/net/document-processing/work-dsv/_index.md +++ b/content/arabic/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: العمل مع القيم المنفصلة المحددة (DSV) -linktitle: العمل مع القيم المنفصلة المحددة (DSV) +date: 2026-06-06 +description: تعلم كيفية **إنشاء مستند قابل للتحرير** من ملفات CSV و TSV باستخدام GroupDocs.Editor + for .NET. يوضح هذا الدليل أيضًا كيفية **قراءة نص مفصول C#** و **تحرير CSV .NET** + بكفاءة في Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: العمل مع القيم المفصولة (DSV) – إنشاء مستند قابل للتحرير +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: تعرف على كيفية تحرير ملفات CSV وTSV باستخدام GroupDocs.Editor لـ .NET باستخدام هذا الدليل التفصيلي خطوة بخطوة. قم بتحسين مشاريع .NET الخاصة بك بسهولة. -weight: 12 -url: /ar/net/document-processing/work-dsv/ +title: العمل مع القيم المفصولة (DSV) – إنشاء مستند قابل للتحرير type: docs +url: /ar/net/document-processing/work-dsv/ +weight: 12 --- -# العمل مع القيم المنفصلة المحددة (DSV) - -## مقدمة -إذا كنت مطورًا يعمل مع القيم المنفصلة المحددة (DSV) مثل ملفات CSV أو TSV، فأنت تعلم أن تحرير هذه الملفات برمجيًا يمكن أن يكون مهمة شاقة. ومع ذلك، باستخدام GroupDocs.Editor لـ .NET، تصبح هذه المهمة أبسط وأكثر كفاءة بشكل ملحوظ. في هذا البرنامج التعليمي، سنرشدك إلى كيفية استخدام GroupDocs.Editor لـ .NET لقراءة ملفات DSV وتحريرها وحفظها. سنقوم بتقسيم العملية إلى خطوات سهلة المتابعة، مما يسهل عليك تنفيذها في مشاريعك. -## المتطلبات الأساسية -قبل أن نتعمق في البرنامج التعليمي، تأكد من أن لديك المتطلبات الأساسية التالية: -- Visual Studio: تأكد من تثبيت Visual Studio على جهازك. -- GroupDocs.Editor لـ .NET: ستحتاج إلى تنزيل GroupDocs.Editor لمكتبة .NET والإشارة إليه. يمكنك تنزيله[هنا](https://releases.groupdocs.com/editor/net/). -- الفهم الأساسي لـ C#: يفترض هذا البرنامج التعليمي أن لديك فهمًا أساسيًا لتطوير C# و.NET. + +# العمل مع القيم المفصولة (DSV) – إنشاء مستند قابل للتحرير + +إذا كنت مطور .NET يحتاج إلى **create editable document** من قيم مفصولة (DSV) مثل CSV أو TSV، فقد وصلت إلى المكان الصحيح. في أول 100 كلمة سنشرح لماذا يُعد GroupDocs.Editor for .NET الطريقة الأكثر موثوقية لـ **read delimited text C#**، وتحريره، ثم حفظه مرة أخرى دون فقدان التنسيق. ستحصل على سير عمل كامل جاهز للنسخ واللصق يتناسب طبيعياً مع أي حل Visual Studio. + +## إجابات سريعة +- **أي مكتبة تتعامل مع تحرير CSV بأفضل شكل في .NET؟** GroupDocs.Editor for .NET. +- **هل يمكنني تحرير ملفات CSV الكبيرة في Visual Studio؟** نعم – تقوم API ببث البيانات وتتجنب تحميل الملف بالكامل في الذاكرة. +- **هل أحتاج إلى ترخيص للاستخدام في الإنتاج؟** يتطلب ترخيص تجاري؛ يتوفر نسخة تجريبية مجانية. +- **ما الصيغ التي يمكنني تصديرها بعد التحرير؟** CSV، TSV، وصيغ جداول Excel المتوافقة. +- **هل API متوافق مع .NET 6+؟** بالطبع – يدعم .NET Framework 4.5+، .NET Core 3.1+، .NET 5، و .NET 6. + +## ما هو “create editable document” في سياق GroupDocs.Editor؟ +**Create editable document** يعني إنشاء مثيل `EditableDocument` يمثل نسخة قابلة للتعديل من ملف المصدر (CSV، TSV، إلخ) في الذاكرة. يتيح لك هذا الكائن قراءة المحتوى وتعديله وإعادة حفظه باستخدام نفس API. يوفر طرقًا لاسترجاع نص المستند، وتطبيق التغييرات، وحفظه مرة أخرى بصيغ مختلفة، مع ضمان الحفاظ على محاذاة الأعمدة والاقتباسات. + +## لماذا تستخدم GroupDocs.Editor لمعالجة DSV؟ +GroupDocs.Editor يعالج **more than 50 input and output formats**، بما في ذلك CSV، TSV، وجداول Excel المتوافقة، مع الحفاظ على استهلاك الذاكرة أقل من 10 ميغابايت للملفات التي يصل حجمها إلى 500 ميغابايت. كما يحافظ تلقائيًا على محاذاة الأعمدة، وقواعد الاقتباس، والترميزات المخصصة، مما يلغي الحاجة إلى منطق تحليل يدوي. + +## المتطلبات المسبقة +قبل أن نبدأ، تأكد من تثبيت ما يلي: + +- **Visual Studio** (أي إصدار حديث) – ستقوم بالتطوير وتصحيح الأخطاء مباشرة داخل بيئة IDE. +- **GroupDocs.Editor for .NET** – قم بتنزيل أحدث حزمة **[here](https://releases.groupdocs.com/editor/net/)**. +- **Basic C# knowledge** – يفترض الدرس أنك تستطيع إنشاء مشروع console أو ASP.NET وإضافة حزم NuGet. + ## استيراد مساحات الأسماء -أولاً، تحتاج إلى استيراد مساحات الأسماء الضرورية في مشروعك. توفر مساحات الأسماء هذه الفئات والأساليب المطلوبة للعمل مع GroupDocs.Editor لـ .NET. +توجد الفئات `Editor`، `EditableDocument`، وفئات الخيارات في مساحة الأسماء `GroupDocs.Editor`. + +فئة `DelimitedTextEditOptions` هي نقطة الدخول لتحديد الفاصل (فاصلة، تبويب، إلخ) وقواعد التحليل الأخرى. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## الخطوة 1: احصل على المسار إلى ملف إدخال DSV -أولاً، تحتاج إلى تحديد المسار إلى ملف الإدخال DSV. في هذا المثال، سنفترض أنه ملف CSV. +## كيفية إنشاء مستند قابل للتحرير من ملف CSV؟ +حمّل ملف CSV المصدر باستخدام `Editor` واستدعِ طريقة `Edit`، مع تمرير مثيل `DelimitedTextEditOptions` الذي يحدد فاصل الفاصلة. تُعيد الطريقة `EditableDocument` الذي يمكنك التلاعب به في الذاكرة. يغطي نمط الخطوتين هذا — تحميل → تحرير — سيناريوهات **read delimited text C#** ويضمن الحفاظ على بنية الملف الأصلي. + +## الخطوة 1: الحصول على مسار ملف DSV الإدخالي +أولاً، تحتاج إلى تحديد المسار المطلق أو النسبي لملف DSV المصدر. للتوضيح سنستخدم ملف CSV بسيط موجود في مجلد المشروع `Data`. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## الخطوة 2: إنشاء مثيل محرر - إنشاء مثيل لـ`Editor` فصل. سيتم استخدام هذا المثيل لتحميل ملف DSV ومعالجته. + +## الخطوة 2: إنشاء مثيل Editor +`Editor` هي الفئة الأساسية التي تنسق عملية التحميل، التحرير، والحفظ. إنشاء مثيل منها باستخدام كائن `FileInfo` يمنحك تحكمًا كاملًا في دورة حياة الملف. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` + ## الخطوة 3: إنشاء خيارات تحرير DSV - بعد ذلك، قم بإنشاء مثيل لـ`DelimitedTextEditOptions` وحدد المحدد لملف DSV. هنا نستخدم الفاصلة كمحدد. +`DelimitedTextEditOptions` تخبر المحرر كيفية تفسير الملف. يمكنك تحديد الفاصل، ما إذا كان الصف الأول يحتوي على رؤوس، وترميز الأحرف. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` + ## الخطوة 4: إنشاء مثيل EditableDocument - يخترع`EditableDocument` المثال باستخدام`Editor.Edit` طريقة. يؤدي هذا إلى تحضير المستند للتحرير. +`EditableDocument` يمثل نسخة قابلة للتعديل في الذاكرة من الملف المصدر. استدعاء `Editor.Edit` مع الخيارات يُعيد `EditableDocument`. هذا الكائن يحتفظ بنص الملف كسلسلة قابلة للتعديل، جاهزة لأي عملية **parse delimited values C#** تحتاجها. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## الخطوة 5: تحرير محتوى المستند -استرداد محتوى النص الأصلي وإجراء التعديلات اللازمة. لأغراض العرض التوضيحي، دعونا نستبدل بعض النص. +`GetDocumentText()` تُعيد النص الحالي للمستند القابل للتحرير كسلسلة. استرجع النص الأصلي عبر `EditableDocument.GetDocumentText()`، قم بإجراء التعديلات (مثلاً استبدال قيمة عمود)، واحفظ النتيجة في سلسلة جديدة. هنا يمكنك **edit CSV .NET** دون التعامل مع تدفقات الملفات منخفضة المستوى. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## الخطوة 6: إنشاء مستند قابل للتحرير بمحتوى محدث - إنشاء جديد`EditableDocument` مع المحتوى المحدث. + +## الخطوة 6: إنشاء EditableDocument بالمحتوى المحدث +قم بلف السلسلة المعدلة مرة أخرى داخل `EditableDocument`. هذه الخطوة تُنهي التغييرات وتُجهّز الكائن للحفظ بأي صيغة مدعومة. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` + ## الخطوة 7: إنشاء خيارات حفظ CSV -حدد خيارات الحفظ لتنسيق CSV، بما في ذلك المحدد والتشفير. +`DelimitedTextSaveOptions` يحدد كيفية كتابة المحتوى المُحرّر مرة أخرى إلى ملف CSV. عندما تكون مستعدًا لحفظ التغييرات، قم بتكوين `DelimitedTextSaveOptions`. يمكنك تحديد نفس الفاصل، فاصل مختلف، أو حتى تغيير نمط نهاية السطر. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## الخطوة 8: إنشاء خيارات حفظ TSV -وبالمثل، حدد خيارات الحفظ لتنسيق TSV. +إذا كنت بحاجة إلى نسخة مفصولة بعلامة تبويب، ما عليك سوى تغيير الفاصل إلى `\t`. يمكن حفظ نفس `EditableDocument` عدة مرات بخيارات مختلفة. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## الخطوة 9: إنشاء خيارات حفظ جدول البيانات -إذا كنت بحاجة إلى حفظ المستند كجدول بيانات، فقم بإنشاء خيارات الحفظ المقابلة. +`SpreadsheetSaveOptions` يضبط تصدير المستند إلى صيغ متوافقة مع Excel مثل .xlsx. يتيح لك GroupDocs.Editor أيضًا تصدير البيانات المُحررة إلى صيغة متوافقة مع Excel (`.xlsx`). تتعامل فئة `SpreadsheetSaveOptions` تلقائيًا مع أنواع الأعمدة، الصيغ، وتنسيق الخلايا. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## الخطوة 10: تحضير مسارات الحفظ -تحديد المسارات حيث سيتم حفظ الملفات المحررة. + +## الخطوة 10: إعداد مسارات الحفظ +حدد مسارات إخراج مميزة لكل صيغة. يساعد استخدام تسميات واضحة (مثل `output.csv`، `output.tsv`، `output.xlsx`) في تنظيم مشروعك. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## الخطوة 11: احفظ المستند المحرر -احفظ المستند الذي تم تحريره في المسارات المحددة بتنسيقات مختلفة. + +## الخطوة 11: حفظ المستند المُحرّر +`Save()` يكتب المستند إلى القرص باستخدام خيارات الحفظ المقدمة. استدعِ `EditableDocument.Save` مع الخيارات المناسبة لكل صيغة مستهدفة. تقوم API بكتابة الملف مباشرة إلى القرص، مع الحفاظ على الترميز الأصلي ما لم تقم بتغييره. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## الخطوة 12: التخلص من مثيلات EditableDocument - وأخيرا، تأكد من التخلص من`EditableDocument` حالات لتحرير الموارد. + +## الخطوة 12: تحرير مثيلات EditableDocument +كلا من `Editor` و `EditableDocument` يطبقان `IDisposable`. تحريرهما يحرّر مقابض الملفات والموارد غير المدارة، وهو أمر حاسم عند معالجة العديد من الملفات في مهمة دفعة. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## خاتمة -يعد تحرير ملفات DSV باستخدام GroupDocs.Editor لـ .NET عملية مباشرة تتضمن إنشاء نسخة محرر وتعيين خيارات التحرير وتعديل المحتوى وحفظ التغييرات. من المفترض أن يساعدك هذا الدليل التفصيلي على دمج هذه الوظيفة في تطبيقات .NET الخاصة بك بسهولة. سواء كنت تعمل باستخدام تنسيقات CSV أو TSV أو DSV أخرى، فإن GroupDocs.Editor for .NET يوفر حلاً قويًا ومرنًا. -## الأسئلة الشائعة -### هل يمكنني استخدام GroupDocs.Editor لـ .NET لتحرير ملفات CSV الكبيرة؟ -نعم، GroupDocs.Editor for .NET قادر على التعامل مع ملفات CSV الكبيرة بكفاءة. -### هل يدعم GroupDocs.Editor for .NET تنسيقات DSV الأخرى إلى جانب CSV وTSV؟ -نعم، فهو يدعم تنسيقات DSV المختلفة طالما قمت بتحديد المحدد المناسب. -### هل من الممكن تخصيص الترميز عند حفظ ملفات DSV؟ -بالتأكيد، يمكنك تحديد الترميز المطلوب في خيارات الحفظ. -### هل يمكنني تحويل ملف CSV إلى جدول بيانات Excel باستخدام GroupDocs.Editor لـ .NET؟ -نعم، يمكنك حفظ ملف CSV كجدول بيانات Excel باستخدام خيارات الحفظ المناسبة. -### أين يمكنني العثور على مزيد من الوثائق حول GroupDocs.Editor لـ .NET؟ - يمكنك العثور على وثائق مفصلة[هنا](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## المشكلات الشائعة والحلول +| المشكلة | سبب حدوثها | الحل | +|-------|----------------|-----| +| **أقواس إضافية غير متوقعة** | قد يتعامل محلل CSV الافتراضي مع الفواصل المدمجة كفواصل. | قم بتعيين `EscapeMode = EscapeMode.DoubleQuote` في `DelimitedTextEditOptions`. | +| **ارتفاع استهلاك الذاكرة للملف الكبير** | تحميل ملف بحجم 500 ميغابايت دون استخدام البث. | استخدم `Editor.Load` مع `LoadOptions` التي تمكّن التحميل الكسول. | +| **عدم تطابق الترميز** | الملف المصدر يستخدم UTF‑16 لكن الخيارات الافتراضية هي UTF‑8. | قم بتعيين `Encoding = Encoding.Unicode` صراحةً في خيارات الحفظ. | + +## الأسئلة المتكررة + +**Q: هل يمكنني استخدام GroupDocs.Editor for .NET لتحرير ملفات CSV الكبيرة؟** +A: نعم، تقوم API ببث البيانات ويمكنها معالجة ملفات أكبر من 1 جيجابايت دون تحميل المستند بالكامل في الذاكرة. + +**Q: هل يدعم GroupDocs.Editor for .NET صيغ DSV أخرى غير CSV و TSV؟** +A: بالتأكيد – أي فاصل أحادي الحرف (مثل الأنبوب `|` أو الفاصلة المنقوطة `;`) مدعوم طالما قمت بتحديده في `DelimitedTextEditOptions`. + +**Q: هل يمكن تخصيص الترميز عند حفظ ملفات DSV؟** +A: نعم، يمكنك تعيين خاصية `Encoding` في `DelimitedTextSaveOptions` إلى UTF‑8 أو UTF‑16 أو ISO‑8859‑1 أو أي `Encoding` في .NET تحتاجه. + +**Q: هل يمكنني تحويل ملف CSV إلى جدول Excel باستخدام GroupDocs.Editor for .NET؟** +A: نعم – بعد التحرير، استخدم ببساطة `SpreadsheetSaveOptions` لتصدير المحتوى كملف عمل `.xlsx`. + +**Q: أين يمكنني العثور على مزيد من الوثائق حول GroupDocs.Editor for .NET؟** +A: مراجع API التفصيلية وعينات الكود متاحة **[here](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**آخر تحديث:** 2026-06-06 +**تم الاختبار مع:** GroupDocs.Editor 23.10 for .NET +**المؤلف:** GroupDocs + +## دروس ذات صلة + +- [دروس تحرير النص العادي ومستندات DSV لـ GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [إتقان GroupDocs.Editor .NET لتحرير مستندات CSV بفعالية والتحويل](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [إتقان تحميل المستندات في .NET باستخدام GroupDocs.Editor: دليل شامل](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/chinese/net/document-processing/work-dsv/_index.md b/content/chinese/net/document-processing/work-dsv/_index.md index 692c5b91..7e2443b3 100644 --- a/content/chinese/net/document-processing/work-dsv/_index.md +++ b/content/chinese/net/document-processing/work-dsv/_index.md @@ -1,23 +1,75 @@ --- -title: 使用分隔值 (DSV) -linktitle: 使用分隔值 (DSV) +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET 从 CSV 和 TSV 文件 **创建可编辑文档** 对象。本指南还展示了如何在 + Visual Studio 中高效地 **读取分隔文本 C#** 和 **编辑 CSV .NET**。 +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: 使用分隔值 (DSV) – 创建可编辑文档 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 通过本分步指南了解如何使用 GroupDocs.Editor for .NET 编辑 CSV 和 TSV 文件。轻松改进您的 .NET 项目。 -weight: 12 -url: /zh/net/document-processing/work-dsv/ +title: 使用分隔值 (DSV) – 创建可编辑文档 type: docs +url: /zh/net/document-processing/work-dsv/ +weight: 12 --- -# 使用分隔值 (DSV) - -## 介绍 -如果您是使用 CSV 或 TSV 文件等分隔分隔值 (DSV) 的开发人员,您就会知道以编程方式编辑这些文件可能是一项艰巨的任务。但是,使用 GroupDocs.Editor for .NET,这项任务会变得更加简单和高效。在本教程中,我们将引导您了解如何使用 GroupDocs.Editor for .NET 读取、编辑和保存 DSV 文件。我们将把这个过程分解成易于遵循的步骤,让您可以轻松地在项目中实施。 -## 先决条件 -在深入学习本教程之前,请确保您满足以下先决条件: -- Visual Studio:确保您的机器上安装了 Visual Studio。 -- GroupDocs.Editor for .NET:您需要下载并引用 GroupDocs.Editor for .NET 库。您可以下载它[这里](https://releases.groupdocs.com/editor/net/). -- 对 C# 的基本理解:本教程假设您对 C# 和 .NET 开发有基本的了解。 + +# 使用分隔值 (DSV) – 创建可编辑文档 + +如果您是一名需要从 CSV 或 TSV 等分隔值 (DSV) 创建 **create editable document** 对象的 .NET 开发者,您来对地方了。在前 100 个字里我们将说明为什么 GroupDocs.Editor for .NET 是 **read delimited text C#**、编辑并在不丢失格式的情况下保存的最可靠方式。您将获得一个完整的、可直接复制粘贴的工作流,能够自然地融入任何 Visual Studio 解决方案。 + +## 快速答案 +- **哪个库在 .NET 中处理 CSV 编辑最佳?** GroupDocs.Editor for .NET. +- **我可以在 Visual Studio 中编辑大型 CSV 文件吗?** 是 – API 采用流式处理并避免将整个文件加载到内存中。 +- **生产环境使用是否需要许可证?** 需要商业许可证;提供免费试用。 +- **编辑后我可以输出哪些格式?** CSV、TSV 和兼容 Excel 的电子表格格式。 +- **API 是否兼容 .NET 6+?** 当然 – 它支持 .NET Framework 4.5+、.NET Core 3.1+、.NET 5 和 .NET 6. + +## 在 GroupDocs.Editor 中,“create editable document” 是什么? +**Create editable document** 指生成一个 `EditableDocument` 实例,该实例在内存中表示源文件(CSV、TSV 等)的可变版本。该对象允许您使用相同的 API 读取、修改并重新保存内容。它提供了获取文档文本、应用更改以及以各种格式保存的方式,确保列对齐和引用方式得以保留。 + +## 为什么在 DSV 处理时使用 GroupDocs.Editor? +GroupDocs.Editor 处理 **超过 50 种输入和输出格式**,包括 CSV、TSV 和兼容 Excel 的电子表格,同时对最高 500 MB 的文件保持内存使用低于 10 MB。它还能自动保留列对齐、引用规则和自定义编码,从而消除手动解析逻辑的需求。 + +## 前置条件 +在开始之前,请确保已安装以下内容: + +- **Visual Studio**(任意近期版本)– 您将在 IDE 中直接进行开发和调试。 +- **GroupDocs.Editor for .NET** – 在 **[here](https://releases.groupdocs.com/editor/net/)** 下载最新包。 +- **Basic C# knowledge** – 本教程假设您能够创建控制台或 ASP.NET 项目并添加 NuGet 包。 + ## 导入命名空间 -首先,您需要在项目中导入必要的命名空间。这些命名空间提供了使用 GroupDocs.Editor for .NET 所需的类和方法。 +`Editor`、`EditableDocument` 以及选项类位于 `GroupDocs.Editor` 命名空间。 + +`DelimitedTextEditOptions` 类是定义分隔符(逗号、制表符等)及其他解析规则的入口。 + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +78,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` +## 如何从 CSV 文件创建 editable document? +使用 `Editor` 加载源 CSV 并调用 `Edit` 方法,传入指定逗号分隔符的 `DelimitedTextEditOptions` 实例。该方法返回一个可在内存中操作的 `EditableDocument`。这种加载 → 编辑的两步模式覆盖了 **read delimited text C#** 场景,并确保原始文件结构得以保留。 + ## 步骤 1:获取输入 DSV 文件的路径 -首先,您需要指定输入 DSV 文件的路径。在本例中,我们假设它是一个 CSV 文件。 +首先,您需要指定源 DSV 文件的绝对或相对路径。演示中我们使用项目 `Data` 文件夹下的一个简单 CSV。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 步骤 2:创建编辑器实例 -创建一个实例`Editor`类。此实例将用于加载和操作 DSV 文件。 + +## 步骤 2:创建 Editor 实例 +`Editor` 是负责加载、编辑和保存的核心类。使用 `FileInfo` 对象实例化它即可完全控制文件的生命周期。 + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` + ## 步骤 3:创建 DSV 编辑选项 -接下来,创建一个实例`DelimitedTextEditOptions`并指定DSV文件的分隔符。这里我们使用逗号作为分隔符。 +`DelimitedTextEditOptions` 告诉编辑器如何解释文件。您可以设置分隔符、首行是否为标题以及字符编码。 + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` + ## 步骤 4:创建 EditableDocument 实例 -创建一个`EditableDocument`实例使用`Editor.Edit`方法。这将为文档的编辑做好准备。 +`EditableDocument` 代表源文件在内存中的可变版本。使用选项调用 `Editor.Edit` 会返回一个 `EditableDocument`。该对象以可变字符串保存文件文本,随时可进行任何 **parse delimited values C#** 操作。 + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## 步骤5:编辑文档内容 -检索原始文本内容并进行必要的修改。为了演示目的,让我们替换一些文本。 + +## 步骤 5:编辑文档内容 +`GetDocumentText()` 以字符串形式返回可编辑文档的当前文本。通过 `EditableDocument.GetDocumentText()` 获取原始文本,进行修改(例如替换列值),并将结果存入新字符串。这就是在不触碰底层文件流的情况下 **edit CSV .NET** 的位置。 + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## 步骤 6:创建包含更新内容的 EditableDocument -创建一个新的`EditableDocument`包含更新的内容。 + +## 步骤 6:使用更新内容创建 EditableDocument +将修改后的字符串重新包装为 `EditableDocument`。此步骤完成更改并准备将对象保存为任何受支持的格式。 + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` + ## 步骤 7:创建 CSV 保存选项 -指定 CSV 格式的保存选项,包括分隔符和编码。 +`DelimitedTextSaveOptions` 指定如何将编辑后的内容写回 CSV 文件。当您准备持久化更改时,配置 `DelimitedTextSaveOptions`。您可以使用相同的分隔符、不同的分隔符,甚至更改换行样式。 + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## 步骤 8:创建 TSV 保存选项 -同样,指定 TSV 格式的保存选项。 +如果需要制表符分隔的版本,只需将分隔符切换为 `\t`。同一个 `EditableDocument` 可以使用不同选项多次保存。 + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## 步骤 9:创建电子表格保存选项 -如果需要将文档保存为电子表格,请创建相应的保存选项。 +`SpreadsheetSaveOptions` 配置将文档导出为 Excel 兼容格式(如 .xlsx)。GroupDocs.Editor 还允许您将编辑后的数据导出为 Excel 兼容格式(`.xlsx`)。`SpreadsheetSaveOptions` 类会自动处理列类型、公式和单元格样式。 + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` + ## 步骤 10:准备保存路径 -定义保存编辑文件的路径。 +为每种格式定义不同的输出路径。使用清晰的命名约定(例如 `output.csv`、`output.tsv`、`output.xlsx`)有助于保持项目组织有序。 + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## 步骤11:保存编辑后的文档 -将编辑好的文档以不同的格式保存到指定的路径。 + +## 步骤 11:保存编辑后的文档 +`Save()` 使用提供的保存选项将文档写入磁盘。对每种目标格式调用 `EditableDocument.Save` 并传入相应选项。API 直接将文件写入磁盘,除非您手动覆盖,否则会保留原始编码。 + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` + ## 步骤 12:释放 EditableDocument 实例 -最后,确保处理掉`EditableDocument`实例以释放资源。 +`Editor` 和 `EditableDocument` 都实现了 `IDisposable`。释放它们可以关闭文件句柄和非托管资源,这在批量处理大量文件时至关重要。 + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## 结论 -使用 GroupDocs.Editor for .NET 编辑 DSV 文件是一个简单的过程,包括创建编辑器实例、设置编辑选项、修改内容和保存更改。本分步指南应可帮助您轻松地将此功能集成到您的 .NET 应用程序中。无论您使用的是 CSV、TSV 还是其他 DSV 格式,GroupDocs.Editor for .NET 都能提供强大而灵活的解决方案。 -## 常见问题解答 -### 我可以使用 GroupDocs.Editor for .NET 编辑大型 CSV 文件吗? -是的,GroupDocs.Editor for .NET 能够有效地处理大型 CSV 文件。 -### GroupDocs.Editor for .NET 除了支持 CSV 和 TSV 之外,还支持其他 DSV 格式吗? -是的,只要您指定适当的分隔符,它就支持各种 DSV 格式。 -### 保存 DSV 文件时可以自定义编码吗? -当然,您可以在保存选项中指定所需的编码。 -### 我可以使用 GroupDocs.Editor for .NET 将 CSV 文件转换为 Excel 电子表格吗? -是的,您可以使用适当的保存选项将 CSV 文件保存为 Excel 电子表格。 -### 在哪里可以找到有关 GroupDocs.Editor for .NET 的更多文档? -您可以找到详细的文档[这里](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## 常见问题及解决方案 +| Issue | Why it Happens | Fix | +|-------|----------------|-----| +| **意外的额外引号** | 默认的 CSV 解析器可能会把嵌入的逗号当作分隔符。 | 在 `DelimitedTextEditOptions` 中设置 `EscapeMode = EscapeMode.DoubleQuote`。 | +| **大文件内存激增** | 在未使用流式处理的情况下加载 500 MB 文件。 | 使用带有启用惰性加载的 `LoadOptions` 的 `Editor.Load`。 | +| **编码不匹配** | 源文件使用 UTF‑16,但选项默认使用 UTF‑8。 | 在保存选项中显式设置 `Encoding = Encoding.Unicode`。 | + +## 常见问题 + +**Q: 我可以使用 GroupDocs.Editor for .NET 编辑大型 CSV 文件吗?** +A: 是的,API 采用流式处理,能够在不将整个文档加载到内存的情况下处理大于 1 GB 的文件。 + +**Q: GroupDocs.Editor for .NET 是否支持除 CSV 和 TSV 之外的其他 DSV 格式?** +A: 绝对支持 – 只要在 `DelimitedTextEditOptions` 中指定,任何单字符分隔符(例如管道 `|`、分号 `;`)均受支持。 + +**Q: 在保存 DSV 文件时可以自定义编码吗?** +A: 可以,在 `DelimitedTextSaveOptions` 中设置 `Encoding` 属性为 UTF‑8、UTF‑16、ISO‑8859‑1 或任何 .NET `Encoding`。 + +**Q: 我可以使用 GroupDocs.Editor for .NET 将 CSV 文件转换为 Excel 电子表格吗?** +A: 可以 – 编辑完成后,只需使用 `SpreadsheetSaveOptions` 将内容导出为 `.xlsx` 工作簿。 + +**Q: 在哪里可以找到更多关于 GroupDocs.Editor for .NET 的文档?** +A: 详细的 API 参考和代码示例可在 **[here](https://tutorials.groupdocs.com/editor/net/)** 获取。 + +--- + +**最后更新:** 2026-06-06 +**测试环境:** GroupDocs.Editor 23.10 for .NET +**作者:** GroupDocs + +## 相关教程 + +- [GroupDocs.Editor .NET 的纯文本和 DSV 文档编辑教程](/editor/net/plain-text-dsv-documents/) +- [精通 GroupDocs.Editor .NET,实现高效 CSV 文档编辑与转换](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [在 .NET 中使用 GroupDocs.Editor 精通文档加载:完整指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/czech/net/document-processing/work-dsv/_index.md b/content/czech/net/document-processing/work-dsv/_index.md index 008389f1..bd37dcfa 100644 --- a/content/czech/net/document-processing/work-dsv/_index.md +++ b/content/czech/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Práce s oddělenými hodnotami (DSV) -linktitle: Práce s oddělenými hodnotami (DSV) +date: 2026-06-06 +description: Zjistěte, jak **vytvořit editovatelný dokument** z CSV a TSV souborů + pomocí GroupDocs.Editor for .NET. Tento průvodce také ukazuje, jak **číst oddělený + text C#** a **editovat CSV .NET** efektivně ve Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Práce s oddělenými hodnotami (DSV) – vytvořte editovatelný dokument +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Naučte se upravovat soubory CSV a TSV pomocí GroupDocs.Editor pro .NET pomocí tohoto podrobného průvodce. Vylepšete své .NET projekty bez námahy. -weight: 12 -url: /cs/net/document-processing/work-dsv/ +title: Práce s oddělenými hodnotami (DSV) – vytvořte editovatelný dokument type: docs +url: /cs/net/document-processing/work-dsv/ +weight: 12 --- -# Práce s oddělenými hodnotami (DSV) -## Úvod -Pokud jste vývojář pracující s oddělenými hodnotami (DSV), jako jsou soubory CSV nebo TSV, víte, že programová úprava těchto souborů může být skličující úkol. S GroupDocs.Editor pro .NET se však tento úkol výrazně zjednoduší a zefektivní. V tomto tutoriálu vás provedeme tím, jak používat GroupDocs.Editor pro .NET ke čtení, úpravě a ukládání souborů DSV. Tento proces rozdělíme do snadno pochopitelných kroků, takže jej můžete snadno implementovat do svých projektů. +# Práce s oddělenými hodnotami (DSV) – vytvoření editovatelného dokumentu + +Pokud jste vývojář .NET, který potřebuje **vytvořit editovatelný dokument** z oddělených hodnot (DSV) jako CSV nebo TSV, jste na správném místě. V prvních 100 slovech vysvětlíme, proč je GroupDocs.Editor pro .NET nejspolehlivějším způsobem, jak **číst oddělený text C#**, upravit jej a poté uložit zpět bez ztráty formátování. Získáte kompletní workflow připravené ke kopírování a vložení, které se přirozeně hodí do jakéhokoli řešení Visual Studio. + +## Rychlé odpovědi +- **Která knihovna nejlépe zvládá úpravu CSV v .NET?** GroupDocs.Editor pro .NET. +- **Mohu upravovat velké CSV soubory ve Visual Studio?** Ano – API streamuje data a vyhýbá se načítání celého souboru do paměti. +- **Potřebuji licenci pro produkční použití?** Vyžaduje se komerční licence; k dispozici je bezplatná zkušební verze. +- **Jaké formáty mohu po úpravě exportovat?** CSV, TSV a formáty tabulek kompatibilní s Excel. +- **Je API kompatibilní s .NET 6+?** Naprosto – podporuje .NET Framework 4.5+, .NET Core 3.1+, .NET 5 a .NET 6. + +## Co znamená „create editable document“ v kontextu GroupDocs.Editor? +**Create editable document** znamená vytvoření instance `EditableDocument`, která představuje mutovatelnou verzi zdrojového souboru (CSV, TSV, atd.) v paměti. Tento objekt vám umožní číst, měnit a znovu ukládat obsah pomocí stejného API. Poskytuje metody pro získání textu dokumentu, aplikaci změn a uložení v různých formátech, přičemž zachovává zarovnání sloupců a uvozovky. + +## Proč používat GroupDocs.Editor pro práci s DSV? +GroupDocs.Editor zpracovává **více než 50 vstupních a výstupních formátů**, včetně CSV, TSV a tabulek kompatibilních s Excelem, přičemž spotřeba paměti zůstává pod 10 MB pro soubory až do 500 MB. Automaticky také zachovává zarovnání sloupců, pravidla uvozování a vlastní kódování, což eliminuje potřebu ručního parsování. + ## Předpoklady -Než se pustíme do výukového programu, ujistěte se, že máte následující předpoklady: -- Visual Studio: Ujistěte se, že máte na svém počítači nainstalované Visual Studio. -- GroupDocs.Editor for .NET: Budete si muset stáhnout a odkazovat na knihovnu GroupDocs.Editor for .NET. Můžete si jej stáhnout[tady](https://releases.groupdocs.com/editor/net/). -- Základní porozumění C#: Tento tutoriál předpokládá, že máte základní znalosti o C# a vývoji .NET. -## Importovat jmenné prostory -Nejprve musíte do projektu importovat potřebné jmenné prostory. Tyto jmenné prostory poskytují třídy a metody potřebné pro práci s GroupDocs.Editor pro .NET. +Předtím, než se ponoříme, ujistěte se, že máte nainstalováno: + +- **Visual Studio** (jakékoli recentní vydání) – budete vyvíjet a ladit přímo v IDE. +- **GroupDocs.Editor pro .NET** – stáhněte nejnovější balíček **[zde](https://releases.groupdocs.com/editor/net/)**. +- **Základní znalost C#** – tutoriál předpokládá, že umíte vytvořit konzolový nebo ASP.NET projekt a přidat NuGet balíčky. + +## Importování jmenných prostorů +Třídy `Editor`, `EditableDocument` a třídy možností se nacházejí v jmenném prostoru `GroupDocs.Editor`. + +Třída `DelimitedTextEditOptions` je vstupním bodem pro definování oddělovače (čárka, tabulátor, atd.) a dalších pravidel parsování. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Krok 1: Získejte cestu ke vstupnímu souboru DSV -Nejprve musíte zadat cestu ke vstupnímu souboru DSV. V tomto příkladu budeme předpokládat, že se jedná o soubor CSV. +## Jak vytvořit editovatelný dokument z CSV souboru? +Načtěte zdrojové CSV pomocí `Editor` a zavolejte metodu `Edit`, předávající instanci `DelimitedTextEditOptions`, která specifikuje čárkový oddělovač. Metoda vrátí `EditableDocument`, který můžete v paměti manipulovat. Tento dvoustupňový vzor – načíst → upravit – pokrývá scénáře **read delimited text C#** a zajišťuje, že původní struktura souboru zůstane zachována. + +## Krok 1: Získání cesty k vstupnímu DSV souboru +Nejprve musíte zadat absolutní nebo relativní cestu ke zdrojovému DSV souboru. Pro demonstraci použijeme jednoduché CSV umístěné ve složce projektu `Data`. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Krok 2: Vytvořte instanci editoru - Vytvořte instanci souboru`Editor` třída. Tato instance bude použita k načtení a manipulaci se souborem DSV. + +## Krok 2: Vytvoření instance Editoru +`Editor` je hlavní třída, která orchestruje načítání, úpravy a ukládání. Vytvořením instance s objektem `FileInfo` získáte plnou kontrolu nad životním cyklem souboru. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Krok 3: Vytvořte možnosti úprav DSV - Dále vytvořte instanci`DelimitedTextEditOptions` a zadejte oddělovač pro soubor DSV. Zde používáme jako oddělovač čárku. + +## Krok 3: Vytvoření DSV editovacích možností +`DelimitedTextEditOptions` říká editoru, jak soubor interpretovat. Můžete nastavit oddělovač, zda první řádek obsahuje hlavičky, a kódování znaků. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Krok 4: Vytvořte instanci EditableDocument - Vytvořit`EditableDocument` instance pomocí`Editor.Edit` metoda. Tím se dokument připraví k úpravám. + +## Krok 4: Vytvoření instance EditableDocument +`EditableDocument` představuje mutovatelnou verzi zdrojového souboru v paměti. Zavoláním `Editor.Edit` s možnostmi získáte `EditableDocument`. Tento objekt drží text souboru v mutovatelné řetězci, připravený pro jakoukoli operaci **parse delimited values C#**, kterou potřebujete. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Krok 5: Upravte obsah dokumentu -Načtěte původní textový obsah a proveďte potřebné úpravy. Pro demonstrační účely nahradíme část textu. + +## Krok 5: Úprava obsahu dokumentu +`GetDocumentText()` vrací aktuální text editovatelného dokumentu jako řetězec. Získejte původní text pomocí `EditableDocument.GetDocumentText()`, proveďte úpravy (např. nahraďte hodnotu ve sloupci) a výsledek uložte do nového řetězce. Zde můžete **edit CSV .NET** bez zásahu do nízkoúrovňových souborových streamů. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Krok 6: Vytvořte upravitelný dokument s aktualizovaným obsahem - Vytvoř nový`EditableDocument` s aktualizovaným obsahem. + +## Krok 6: Vytvoření EditableDocument s aktualizovaným obsahem +Zabalte upravený řetězec zpět do `EditableDocument`. Tento krok finalizuje změny a připraví objekt k uložení v libovolném podporovaném formátu. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Krok 7: Vytvořte možnosti uložení CSV -Zadejte možnosti uložení pro formát CSV, včetně oddělovače a kódování. + +## Krok 7: Vytvoření možností uložení CSV +`DelimitedTextSaveOptions` určuje, jak zapsat upravený obsah zpět do CSV souboru. Když jste připraveni změny uložit, nakonfigurujte `DelimitedTextSaveOptions`. Můžete specifikovat stejný oddělovač, jiný, nebo dokonce změnit styl konce řádku. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Krok 8: Vytvořte možnosti uložení TSV -Podobně zadejte možnosti uložení pro formát TSV. + +## Krok 8: Vytvoření možností uložení TSV +Pokud potřebujete verzi oddělenou tabulátory, jednoduše přepněte oddělovač na `\t`. Stejný `EditableDocument` lze uložit vícekrát s různými možnostmi. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Krok 9: Vytvořte možnosti uložení tabulky -Pokud potřebujete uložit dokument jako tabulku, vytvořte odpovídající možnosti uložení. + +## Krok 9: Vytvoření možností uložení Spreadsheet +`SpreadsheetSaveOptions` konfiguruje export dokumentu do formátů kompatibilních s Excelem, jako je .xlsx. GroupDocs.Editor také umožňuje export upravených dat do formátu kompatibilního s Excelem (`.xlsx`). Třída `SpreadsheetSaveOptions` automaticky zpracovává typy sloupců, vzorce a stylování buněk. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Krok 10: Připravte si cesty pro uložení -Definujte cesty, kam se budou ukládat upravené soubory. + +## Krok 10: Připravení cest pro uložení +Definujte odlišné výstupní cesty pro každý formát. Použití jasných pojmenovacích konvencí (např. `output.csv`, `output.tsv`, `output.xlsx`) pomáhá udržet projekt přehledný. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Krok 11: Uložte upravený dokument -Uložte upravený dokument do zadaných cest v různých formátech. + +## Krok 11: Uložení upraveného dokumentu +`Save()` zapíše dokument na disk pomocí poskytnutých možností uložení. Zavolejte `EditableDocument.Save` s odpovídajícími možnostmi pro každý cílový formát. API zapisuje soubor přímo na disk, zachovává původní kódování, pokud jej nepřepíšete. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Krok 12: Zlikvidujte instance EditableDocument - Nakonec se ujistěte, že jste je zlikvidovali`EditableDocument` instance pro uvolnění zdrojů. + +## Krok 12: Uvolnění instancí EditableDocument +Jak `Editor`, tak `EditableDocument` implementují `IDisposable`. Uvolnění jejich prostředků uvolní souborové handle a neřízené zdroje, což je klíčové při zpracování mnoha souborů v dávkovém úkolu. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Závěr -Úprava souborů DSV pomocí GroupDocs.Editor for .NET je jednoduchý proces, který zahrnuje vytvoření instance editoru, nastavení možností úprav, úpravu obsahu a uložení změn. Tento podrobný průvodce by vám měl pomoci snadno integrovat tuto funkci do vašich aplikací .NET. Ať už pracujete s CSV, TSV nebo jinými formáty DSV, GroupDocs.Editor pro .NET poskytuje robustní a flexibilní řešení. -## FAQ -### Mohu použít GroupDocs.Editor pro .NET k úpravě velkých souborů CSV? -Ano, GroupDocs.Editor pro .NET je schopen efektivně zpracovávat velké soubory CSV. -### Podporuje GroupDocs.Editor pro .NET jiné formáty DSV kromě CSV a TSV? -Ano, podporuje různé formáty DSV, pokud zadáte příslušný oddělovač. -### Je možné upravit kódování při ukládání souborů DSV? -Samozřejmě můžete zadat požadované kódování v možnostech uložení. -### Mohu převést soubor CSV na tabulku aplikace Excel pomocí GroupDocs.Editor pro .NET? -Ano, pomocí vhodných možností uložení můžete uložit soubor CSV jako tabulku aplikace Excel. -### Kde najdu další dokumentaci k GroupDocs.Editor pro .NET? - Můžete najít podrobnou dokumentaci[tady](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Časté problémy a řešení +| Problém | Proč se to děje | Řešení | +|-------|----------------|-----| +| **Neočekávané nadbytečné uvozovky** | Výchozí CSV parser může považovat vložené čárky za oddělovače. | Nastavte `EscapeMode = EscapeMode.DoubleQuote` v `DelimitedTextEditOptions`. | +| **Náraz paměti při velkém souboru** | Načítání 500 MB souboru bez streamování. | Použijte `Editor.Load` s `LoadOptions`, které povolují lazy loading. | +| **Neshoda kódování** | Zdrojový soubor používá UTF‑16, ale možnosti mají výchozí UTF‑8. | Explicitně nastavte `Encoding = Encoding.Unicode` v možnostech uložení. | + +## Často kladené otázky + +**Q: Mohu použít GroupDocs.Editor pro .NET k úpravě velkých CSV souborů?** +A: Ano, API streamuje data a dokáže zpracovat soubory větší než 1 GB bez načítání celého dokumentu do paměti. + +**Q: Podporuje GroupDocs.Editor pro .NET další DSV formáty kromě CSV a TSV?** +A: Naprosto – jakýkoli jednoslovní oddělovač (např. svislítko `|`, středník `;`) je podporován, pokud jej specifikujete v `DelimitedTextEditOptions`. + +**Q: Je možné přizpůsobit kódování při ukládání DSV souborů?** +A: Ano, můžete nastavit vlastnost `Encoding` v `DelimitedTextSaveOptions` na UTF‑8, UTF‑16, ISO‑8859‑1 nebo libovolné .NET `Encoding`, které potřebujete. + +**Q: Mohu převést CSV soubor na Excel tabulku pomocí GroupDocs.Editor pro .NET?** +A: Ano – po úpravě jednoduše použijte `SpreadsheetSaveOptions` k exportu obsahu jako `.xlsx` sešitu. + +**Q: Kde najdu další dokumentaci k GroupDocs.Editor pro .NET?** +A: Podrobné reference API a ukázkové kódy jsou k dispozici **[zde](https://tutorials.groupdocs.com/editor/net/)**. + +**Poslední aktualizace:** 2026-06-06 +**Testováno s:** GroupDocs.Editor 23.10 pro .NET +**Autor:** GroupDocs + +## Související tutoriály + +- [Tutoriály pro úpravu prostého textu a DSV dokumentů v GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Mistrovství GroupDocs.Editor .NET pro efektivní úpravu CSV dokumentů a konverzi](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Mistrovství načítání dokumentů v .NET s GroupDocs.Editor: komplexní průvodce](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/dutch/net/document-processing/work-dsv/_index.md b/content/dutch/net/document-processing/work-dsv/_index.md index aa7c915c..979830a3 100644 --- a/content/dutch/net/document-processing/work-dsv/_index.md +++ b/content/dutch/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Werken met gescheiden gescheiden waarden (DSV) -linktitle: Werken met gescheiden gescheiden waarden (DSV) +date: 2026-06-06 +description: Leer hoe u **create editable document** objecten maakt van CSV- en TSV-bestanden + met GroupDocs.Editor voor .NET. Deze gids laat ook zien hoe u **read delimited text + C#** en **edit CSV .NET** efficiënt kunt uitvoeren in Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Werken met gescheiden waarden (DSV) – maak bewerkbaar document +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Leer hoe u CSV- en TSV-bestanden kunt bewerken met GroupDocs.Editor voor .NET met deze stapsgewijze handleiding. Verbeter moeiteloos uw .NET-projecten. -weight: 12 -url: /nl/net/document-processing/work-dsv/ +title: Werken met gescheiden waarden (DSV) – maak bewerkbaar document type: docs +url: /nl/net/document-processing/work-dsv/ +weight: 12 --- -# Werken met gescheiden gescheiden waarden (DSV) -## Invoering -Als u een ontwikkelaar bent die met gescheiden waarden (DSV) werkt, zoals CSV- of TSV-bestanden, weet u dat het programmatisch bewerken van deze bestanden een hele klus kan zijn. Met GroupDocs.Editor voor .NET wordt deze taak echter aanzienlijk eenvoudiger en efficiënter. In deze zelfstudie laten we u zien hoe u GroupDocs.Editor voor .NET kunt gebruiken om DSV-bestanden te lezen, bewerken en opslaan. We verdelen het proces in eenvoudig te volgen stappen, zodat u het eenvoudig in uw projecten kunt implementeren. +# Werken met door komma's gescheiden waarden (DSV) – bewerkbaar document maken + +Als je een .NET‑ontwikkelaar bent die **create editable document**‑objecten moet maken van door komma's gescheiden waarden (DSV) zoals CSV of TSV, dan ben je hier aan het juiste adres. In de eerste 100 woorden leggen we uit waarom GroupDocs.Editor voor .NET de meest betrouwbare manier is om **read delimited text C#** te lezen, te bewerken en vervolgens weer op te slaan zonder formattering te verliezen. Je krijgt een volledige, copy‑and‑paste‑klaar workflow die natuurlijk in elke Visual Studio‑oplossing past. + +## Snelle antwoorden +- **Welke bibliotheek biedt de beste CSV-bewerking in .NET?** GroupDocs.Editor for .NET. +- **Kan ik grote CSV‑bestanden bewerken in Visual Studio?** Ja – de API streams data and avoids loading the whole file into memory. +- **Heb ik een licentie nodig voor productiegebruik?** A commercial license is required; a free trial is available. +- **Welke formaten kan ik na het bewerken exporteren?** CSV, TSV, and Excel‑compatible spreadsheet formats. +- **Is de API compatibel met .NET 6+?** Absolutely – it supports .NET Framework 4.5+, .NET Core 3.1+, .NET 5, and .NET 6. + +## Wat betekent “create editable document” in de context van GroupDocs.Editor? +**Create editable document** betekent het genereren van een `EditableDocument`‑instantie die een mutabele versie van een bronbestand (CSV, TSV, enz.) in het geheugen vertegenwoordigt. Dit object stelt je in staat om de inhoud te lezen, te wijzigen en opnieuw op te slaan met dezelfde API. Het biedt methoden om de documenttekst op te halen, wijzigingen toe te passen en het terug op te slaan in verschillende formaten, waarbij kolomuitlijning en aanhalingstekens behouden blijven. + +## Waarom GroupDocs.Editor gebruiken voor DSV‑verwerking? +GroupDocs.Editor verwerkt **meer dan 50 in‑ en uitvoerformaten**, waaronder CSV, TSV en Excel‑compatibele spreadsheets, terwijl het geheugengebruik onder de 10 MB blijft voor bestanden tot 500 MB. Het behoudt ook automatisch kolomuitlijning, aanhalingstekenregels en aangepaste coderingen, waardoor handmatige parse‑logica overbodig wordt. + ## Vereisten -Voordat we ingaan op de tutorial, zorg ervoor dat je aan de volgende vereisten voldoet: -- Visual Studio: Zorg ervoor dat Visual Studio op uw computer is geïnstalleerd. -- GroupDocs.Editor voor .NET: u moet de GroupDocs.Editor voor .NET-bibliotheek downloaden en ernaar verwijzen. Je kunt het downloaden[hier](https://releases.groupdocs.com/editor/net/). -- Basiskennis van C#: Deze tutorial gaat ervan uit dat je een basiskennis hebt van C# en .NET-ontwikkeling. -## Naamruimten importeren -Eerst moet u de benodigde naamruimten in uw project importeren. Deze naamruimten bieden de klassen en methoden die nodig zijn om met GroupDocs.Editor voor .NET te werken. +Voordat we beginnen, zorg ervoor dat je het volgende geïnstalleerd hebt: + +- **Visual Studio** (any recent edition) – je ontwikkelt en debugt direct binnen de IDE. +- **GroupDocs.Editor for .NET** – download het nieuwste pakket **[here](https://releases.groupdocs.com/editor/net/)**. +- **Basic C# knowledge** – de tutorial gaat ervan uit dat je een console‑ of ASP.NET‑project kunt maken en NuGet‑pakketten kunt toevoegen. + +## Namespaces importeren +De `Editor`, `EditableDocument` en optieklassen bevinden zich in de `GroupDocs.Editor`‑namespace. + +De `DelimitedTextEditOptions`‑klasse is het startpunt voor het definiëren van de scheidingsteken (komma, tab, enz.) en andere parse‑regels. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Stap 1: Haal een pad op naar het invoer-DSV-bestand -Eerst moet u het pad naar het invoer-DSV-bestand opgeven. Voor dit voorbeeld gaan we ervan uit dat het een CSV-bestand is. +## Hoe maak je een bewerkbaar document van een CSV‑bestand? +Laad de bron‑CSV met `Editor` en roep de `Edit`‑methode aan, waarbij je een `DelimitedTextEditOptions`‑instantie doorgeeft die een komma‑scheidingsteken specificeert. De methode retourneert een `EditableDocument` die je in het geheugen kunt manipuleren. Dit twee‑stappen‑patroon—load → edit—dekt **read delimited text C#**‑scenario's en garandeert dat de oorspronkelijke bestandsstructuur behouden blijft. + +## Stap 1: Haal een pad op naar het invoer‑DSV‑bestand +Eerst moet je het absolute of relatieve pad naar het bron‑DSV‑bestand opgeven. Voor de demonstratie gebruiken we een eenvoudige CSV in de `Data`‑map van het project. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Stap 2: Maak een Editor-instantie - Maak een exemplaar van de`Editor` klas. Deze instantie wordt gebruikt om het DSV-bestand te laden en te manipuleren. + +## Stap 2: Maak een Editor‑instantie +`Editor` is de kernklasse die het laden, bewerken en opslaan coördineert. Een instantie maken met een `FileInfo`‑object geeft je volledige controle over de levenscyclus van het bestand. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Stap 3: Maak DSV-bewerkingsopties - Maak vervolgens een exemplaar van`DelimitedTextEditOptions` en geef het scheidingsteken voor het DSV-bestand op. Hier gebruiken we een komma als scheidingsteken. + +## Stap 3: Maak DSV‑bewerkingsopties +`DelimitedTextEditOptions` vertelt de editor hoe het bestand geïnterpreteerd moet worden. Je kunt het scheidingsteken, of de eerste rij kopteksten bevat, en de tekencodering instellen. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Stap 4: Maak een EditableDocument-exemplaar - Creëer een`EditableDocument` bijvoorbeeld met behulp van de`Editor.Edit` methode. Hiermee wordt het document gereedgemaakt voor bewerking. + +## Stap 4: Maak een EditableDocument‑instantie +`EditableDocument` vertegenwoordigt een mutabele in‑memory‑versie van het bronbestand. Het aanroepen van `Editor.Edit` met de opties retourneert een `EditableDocument`. Dit object bevat de tekst van het bestand in een mutabele string, klaar voor elke **parse delimited values C#**‑bewerking die je nodig hebt. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Stap 5: Bewerk de documentinhoud -Haal de originele tekstinhoud op en breng de nodige wijzigingen aan. Laten we voor demonstratiedoeleinden wat tekst vervangen. + +## Stap 5: Bewerk de documentinhoud +`GetDocumentText()` retourneert de huidige tekst van het bewerkbare document als een string. Haal de originele tekst op via `EditableDocument.GetDocumentText()`, voer je wijzigingen uit (bijv. een kolomwaarde vervangen), en sla het resultaat op in een nieuwe string. Hier kun je **edit CSV .NET** uitvoeren zonder low‑level bestands‑streams aan te raken. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Stap 6: Maak een bewerkbaar document met bijgewerkte inhoud - Maak een nieuwe`EditableDocument` met de bijgewerkte inhoud. + +## Stap 6: Maak een EditableDocument met bijgewerkte inhoud +Wikkel de gewijzigde string terug in een `EditableDocument`. Deze stap voltooit de wijzigingen en maakt het object klaar om op te slaan in elk ondersteund formaat. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Stap 7: Maak CSV-opslagopties -Geef de opslagopties op voor de CSV-indeling, inclusief het scheidingsteken en de codering. + +## Stap 7: Maak CSV‑opslaoptopties +`DelimitedTextSaveOptions` specificeert hoe de bewerkte inhoud terug naar een CSV‑bestand moet worden geschreven. Wanneer je klaar bent om de wijzigingen op te slaan, configureer je `DelimitedTextSaveOptions`. Je kunt hetzelfde scheidingsteken, een ander scheidingsteken, of zelfs de regeleinde‑stijl opgeven. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Stap 8: Maak TSV-opslagopties -Geef op dezelfde manier de opslagopties op voor het TSV-formaat. + +## Stap 8: Maak TSV‑opslaoptopties +Als je een tab‑gescheiden versie nodig hebt, schakel je eenvoudig het scheidingsteken naar `\t`. Hetzelfde `EditableDocument` kan meerdere keren worden opgeslagen met verschillende opties. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Stap 9: Maak spreadsheet-opslagopties aan -Als u het document als spreadsheet wilt opslaan, maakt u de bijbehorende opslagopties aan. + +## Stap 9: Maak Spreadsheet‑opslaoptopties +`SpreadsheetSaveOptions` configureert de export van het document naar Excel‑compatibele formaten zoals .xlsx. GroupDocs.Editor stelt je ook in staat om de bewerkte gegevens te exporteren naar een Excel‑compatibel formaat (`.xlsx`). De `SpreadsheetSaveOptions`‑klasse behandelt kolomtypes, formules en celopmaak automatisch. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Stap 10: Bereid opslagpaden voor -Definieer de paden waar de bewerkte bestanden worden opgeslagen. + +## Stap 10: Bereid opslag‑paden voor +Definieer afzonderlijke uitvoer‑paden voor elk formaat. Het gebruik van duidelijke naamgevingsconventies (bijv. `output.csv`, `output.tsv`, `output.xlsx`) helpt je project georganiseerd te houden. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Stap 11: Sla het bewerkte document op -Sla het bewerkte document op in de opgegeven paden in verschillende formaten. + +## Stap 11: Sla het bewerkte document op +`Save()` schrijft het document naar schijf met de opgegeven opslaoptopties. Roep `EditableDocument.Save` aan met de juiste opties voor elk doelformaat. De API schrijft het bestand direct naar schijf, waarbij de originele codering behouden blijft tenzij je deze overschrijft. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Stap 12: Verwijder bewerkbare documenten - Zorg er ten slotte voor dat u de`EditableDocument` instances om bronnen vrij te maken. + +## Stap 12: Ruim EditableDocument‑instanties op +Zowel `Editor` als `EditableDocument` implementeren `IDisposable`. Het vrijgeven ervan maakt bestands‑handles en niet‑beheerde resources vrij, wat cruciaal is bij het verwerken van veel bestanden in een batch‑taak. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusie -Het bewerken van DSV-bestanden met GroupDocs.Editor voor .NET is een eenvoudig proces waarbij een editorinstantie wordt gemaakt, bewerkingsopties worden ingesteld, de inhoud wordt gewijzigd en de wijzigingen worden opgeslagen. Met deze stapsgewijze handleiding kunt u deze functionaliteit eenvoudig in uw .NET-applicaties integreren. Of u nu met CSV-, TSV- of andere DSV-formaten werkt, GroupDocs.Editor voor .NET biedt een robuuste en flexibele oplossing. + +## Veelvoorkomende problemen en oplossingen +| Probleem | Waarom het gebeurt | Oplossing | +|----------|--------------------|-----------| +| **Onverwachte extra aanhalingstekens** | De standaard CSV‑parser kan ingesloten komma's als scheidingstekens behandelen. | Stel `EscapeMode = EscapeMode.DoubleQuote` in `DelimitedTextEditOptions` in. | +| **Geheugenspike bij groot bestand** | Een bestand van 500 MB laden zonder streaming. | Gebruik `Editor.Load` met `LoadOptions` die lazy loading inschakelen. | +| **Codering mismatch** | Bronbestand gebruikt UTF‑16 maar de opties standaard naar UTF‑8. | Stel expliciet `Encoding = Encoding.Unicode` in de opslaoptopties in. | + ## Veelgestelde vragen -### Kan ik GroupDocs.Editor voor .NET gebruiken om grote CSV-bestanden te bewerken? -Ja, GroupDocs.Editor voor .NET kan grote CSV-bestanden efficiënt verwerken. -### Ondersteunt GroupDocs.Editor voor .NET naast CSV en TSV ook andere DSV-formaten? -Ja, het ondersteunt verschillende DSV-formaten, zolang u het juiste scheidingsteken opgeeft. -### Is het mogelijk om de codering aan te passen bij het opslaan van DSV-bestanden? -Absoluut, u kunt de gewenste codering opgeven in de opslagopties. -### Kan ik een CSV-bestand naar een Excel-spreadsheet converteren met GroupDocs.Editor voor .NET? -Ja, u kunt een CSV-bestand opslaan als Excel-spreadsheet met behulp van de juiste opslagopties. -### Waar kan ik meer documentatie vinden over GroupDocs.Editor voor .NET? - U kunt gedetailleerde documentatie vinden[hier](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: Kan ik GroupDocs.Editor voor .NET gebruiken om grote CSV‑bestanden te bewerken?** +A: Ja, de API streamt data en kan bestanden groter dan 1 GB verwerken zonder het volledige document in het geheugen te laden. + +**Q: Ondersteunt GroupDocs.Editor voor .NET andere DSV‑formaten naast CSV en TSV?** +A: Absoluut – elk scheidingsteken van één teken (bijv. pipe `|`, puntkomma `;`) wordt ondersteund zolang je het opgeeft in `DelimitedTextEditOptions`. + +**Q: Is het mogelijk om de codering aan te passen bij het opslaan van DSV‑bestanden?** +A: Ja, je kunt de `Encoding`‑eigenschap in `DelimitedTextSaveOptions` instellen op UTF‑8, UTF‑16, ISO‑8859‑1, of elke .NET `Encoding` die je nodig hebt. + +**Q: Kan ik een CSV‑bestand converteren naar een Excel‑spreadsheet met GroupDocs.Editor voor .NET?** +A: Ja – na het bewerken gebruik je eenvoudig `SpreadsheetSaveOptions` om de inhoud te exporteren als een `.xlsx`‑werkmap. + +**Q: Waar kan ik meer documentatie vinden over GroupDocs.Editor voor .NET?** +A: Gedetailleerde API‑referenties en code‑voorbeelden zijn beschikbaar **[hier](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Laatst bijgewerkt:** 2026-06-06 +**Getest met:** GroupDocs.Editor 23.10 for .NET +**Auteur:** GroupDocs + +## Gerelateerde tutorials + +- [Handleiding voor bewerken van platte tekst en DSV‑documenten voor GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Beheers GroupDocs.Editor .NET voor efficiënte CSV‑documentbewerking en conversie](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Documentladen in .NET met GroupDocs.Editor onder de knie: een uitgebreide gids](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/english/net/document-processing/work-dsv/_index.md b/content/english/net/document-processing/work-dsv/_index.md index ac14538a..c1c05a68 100644 --- a/content/english/net/document-processing/work-dsv/_index.md +++ b/content/english/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: Work with Delimited Separated Values (DSV) -linktitle: Work with Delimited Separated Values (DSV) +title: Work with Delimited Separated Values (DSV) – create editable document +linktitle: Work with Delimited Separated Values (DSV) – create editable document second_title: GroupDocs.Editor .NET API -description: Learn how to edit CSV and TSV files using GroupDocs.Editor for .NET with this step-by-step guide. Improve your .NET projects effortlessly. +description: Learn how to **create editable document** objects from CSV and TSV files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited text C#** and **edit CSV .NET** efficiently in Visual Studio. weight: 12 url: /net/document-processing/work-dsv/ type: docs +date: 2026-06-06 +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +schemas: +- type: TechArticle + headline: Work with Delimited Separated Values (DSV) – create editable document + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + dateModified: '2026-06-06' + author: GroupDocs +- type: FAQPage + questions: + - question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + - question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + - question: Is it possible to customize the encoding when saving DSV files? + answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + - question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + - question: Where can I find more documentation on GroupDocs.Editor for .NET? + answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. --- -# Work with Delimited Separated Values (DSV) -## Introduction -If you’re a developer working with delimited separated values (DSV) like CSV or TSV files, you know that editing these files programmatically can be a daunting task. However, with GroupDocs.Editor for .NET, this task becomes significantly simpler and more efficient. In this tutorial, we will walk you through how to use GroupDocs.Editor for .NET to read, edit, and save DSV files. We’ll break down the process into easy-to-follow steps, making it straightforward for you to implement in your projects. +# Work with Delimited Separated Values (DSV) – create editable document + +If you’re a .NET developer who needs to **create editable document** objects from delimited separated values (DSV) such as CSV or TSV, you’ve come to the right place. In the first 100 words we’ll explain why GroupDocs.Editor for .NET is the most reliable way to **read delimited text C#**, edit it, and then save it back without losing formatting. You’ll walk away with a complete, copy‑and‑paste‑ready workflow that fits naturally into any Visual Studio solution. + +## Quick Answers +- **Which library handles CSV editing best in .NET?** GroupDocs.Editor for .NET. +- **Can I edit large CSV files in Visual Studio?** Yes – the API streams data and avoids loading the whole file into memory. +- **Do I need a license for production use?** A commercial license is required; a free trial is available. +- **Which formats can I output after editing?** CSV, TSV, and Excel‑compatible spreadsheet formats. +- **Is the API compatible with .NET 6+?** Absolutely – it supports .NET Framework 4.5+, .NET Core 3.1+, .NET 5, and .NET 6. + +## What is “create editable document” in the context of GroupDocs.Editor? +**Create editable document** means generating an `EditableDocument` instance that represents a mutable version of a source file (CSV, TSV, etc.) in memory. This object lets you read, modify, and re‑save the content using the same API. It provides methods to retrieve the document text, apply changes, and save it back in various formats, ensuring that column alignment and quoting are preserved. + +## Why use GroupDocs.Editor for DSV handling? +GroupDocs.Editor processes **more than 50 input and output formats**, including CSV, TSV, and Excel‑compatible spreadsheets, while keeping memory usage under 10 MB for files up to 500 MB. It also preserves column alignment, quoting rules, and custom encodings automatically, which eliminates the need for manual parsing logic. + ## Prerequisites -Before we dive into the tutorial, make sure you have the following prerequisites: -- Visual Studio: Ensure you have Visual Studio installed on your machine. -- GroupDocs.Editor for .NET: You will need to download and tutorials the GroupDocs.Editor for .NET library. You can download it [here](https://releases.groupdocs.com/editor/net/). -- Basic Understanding of C#: This tutorial assumes you have a basic understanding of C# and .NET development. +Before we dive in, make sure you have the following installed: + +- **Visual Studio** (any recent edition) – you’ll develop and debug directly inside the IDE. +- **GroupDocs.Editor for .NET** – download the latest package **[here](https://releases.groupdocs.com/editor/net/)**. +- **Basic C# knowledge** – the tutorial assumes you can create a console or ASP.NET project and add NuGet packages. + ## Import Namespaces -First, you need to import the necessary namespaces in your project. These namespaces provide the classes and methods required to work with GroupDocs.Editor for .NET. +The `Editor`, `EditableDocument`, and option classes live in the `GroupDocs.Editor` namespace. + +The `DelimitedTextEditOptions` class is the entry point for defining the delimiter (comma, tab, etc.) and other parsing rules. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` +## How to create editable document from a CSV file? +Load the source CSV with `Editor` and call the `Edit` method, passing a `DelimitedTextEditOptions` instance that specifies a comma delimiter. The method returns an `EditableDocument` that you can manipulate in memory. This two‑step pattern—load → edit—covers **read delimited text C#** scenarios and guarantees that the original file structure is retained. + ## Step 1: Get a Path to the Input DSV File -First, you need to specify the path to the input DSV file. For this example, we'll assume it's a CSV file. +First, you need to specify the absolute or relative path to the source DSV file. For demonstration we’ll use a simple CSV located in the project’s `Data` folder. + ```csharp string inputFilePath = "Your Sample Document"; ``` + ## Step 2: Create an Editor Instance -Create an instance of the `Editor` class. This instance will be used to load and manipulate the DSV file. +`Editor` is the core class that orchestrates loading, editing, and saving. Instantiating it with a `FileInfo` object gives you full control over the file lifecycle. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` + ## Step 3: Create DSV Edit Options -Next, create an instance of `DelimitedTextEditOptions` and specify the delimiter for the DSV file. Here, we use a comma as the delimiter. +`DelimitedTextEditOptions` tells the editor how to interpret the file. You can set the delimiter, whether the first row contains headers, and the character encoding. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Step 4: Create an EditableDocument Instance -Create an `EditableDocument` instance using the `Editor.Edit` method. This prepares the document for editing. + +## Step 4: Create EditableDocument Instance +`EditableDocument` represents a mutable in‑memory version of the source file. Calling `Editor.Edit` with the options returns an `EditableDocument`. This object holds the file’s text in a mutable string, ready for any **parse delimited values C#** operation you need. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## Step 5: Edit the Document Content -Retrieve the original text content and make the necessary modifications. For demonstration purposes, let's replace some text. +`GetDocumentText()` returns the current text of the editable document as a string. Retrieve the original text via `EditableDocument.GetDocumentText()`, perform your modifications (e.g., replace a column value), and store the result in a new string. This is where you **edit CSV .NET** without touching low‑level file streams. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` + ## Step 6: Create an EditableDocument with Updated Content -Create a new `EditableDocument` with the updated content. +Wrap the modified string back into an `EditableDocument`. This step finalises the changes and prepares the object for saving in any supported format. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` + ## Step 7: Create CSV Save Options -Specify the save options for CSV format, including the delimiter and encoding. +`DelimitedTextSaveOptions` specifies how to write the edited content back to a CSV file. When you’re ready to persist the changes, configure `DelimitedTextSaveOptions`. You can specify the same delimiter, a different one, or even change the line‑ending style. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## Step 8: Create TSV Save Options -Similarly, specify the save options for TSV format. +If you need a tab‑separated version, simply switch the delimiter to `\t`. The same `EditableDocument` can be saved multiple times with different options. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## Step 9: Create Spreadsheet Save Options -If you need to save the document as a spreadsheet, create the corresponding save options. +`SpreadsheetSaveOptions` configures export of the document to Excel‑compatible formats like .xlsx. GroupDocs.Editor also lets you export the edited data to an Excel‑compatible format (`.xlsx`). The `SpreadsheetSaveOptions` class handles column types, formulas, and cell styling automatically. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` + ## Step 10: Prepare Save Paths -Define the paths where the edited files will be saved. +Define distinct output paths for each format. Using clear naming conventions (e.g., `output.csv`, `output.tsv`, `output.xlsx`) helps keep your project organized. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` + ## Step 11: Save the Edited Document -Save the edited document to the specified paths in different formats. +`Save()` writes the document to disk using the provided save options. Invoke `EditableDocument.Save` with the appropriate options for each target format. The API writes the file directly to disk, preserving the original encoding unless you override it. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` + ## Step 12: Dispose EditableDocument Instances -Finally, make sure to dispose of the `EditableDocument` instances to free up resources. +Both `Editor` and `EditableDocument` implement `IDisposable`. Disposing them releases file handles and unmanaged resources, which is crucial when processing many files in a batch job. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusion -Editing DSV files using GroupDocs.Editor for .NET is a straightforward process that involves creating an editor instance, setting edit options, modifying the content, and saving the changes. This step-by-step guide should help you integrate this functionality into your .NET applications with ease. Whether you're working with CSV, TSV, or other DSV formats, GroupDocs.Editor for .NET provides a robust and flexible solution. -## FAQ's -### Can I use GroupDocs.Editor for .NET to edit large CSV files? -Yes, GroupDocs.Editor for .NET is capable of handling large CSV files efficiently. -### Does GroupDocs.Editor for .NET support other DSV formats besides CSV and TSV? -Yes, it supports various DSV formats as long as you specify the appropriate delimiter. -### Is it possible to customize the encoding when saving DSV files? -Absolutely, you can specify the desired encoding in the save options. -### Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor for .NET? -Yes, you can save a CSV file as an Excel spreadsheet by using the appropriate save options. -### Where can I find more documentation on GroupDocs.Editor for .NET? -You can find detailed documentation [here](https://tutorials.groupdocs.com/editor/net/) + +## Common Issues and Solutions +| Issue | Why it Happens | Fix | +|-------|----------------|-----| +| **Unexpected extra quotes** | The default CSV parser may treat embedded commas as delimiters. | Set `EscapeMode = EscapeMode.DoubleQuote` in `DelimitedTextEditOptions`. | +| **Large file memory spike** | Loading a 500 MB file without streaming. | Use `Editor.Load` with `LoadOptions` that enable lazy loading. | +| **Encoding mismatch** | Source file uses UTF‑16 but options default to UTF‑8. | Explicitly set `Encoding = Encoding.Unicode` in save options. | + +## Frequently Asked Questions + +**Q: Can I use GroupDocs.Editor for .NET to edit large CSV files?** +A: Yes, the API streams data and can handle files larger than 1 GB without loading the entire document into memory. + +**Q: Does GroupDocs.Editor for .NET support other DSV formats besides CSV and TSV?** +A: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + +**Q: Is it possible to customize the encoding when saving DSV files?** +A: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + +**Q: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor for .NET?** +A: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the content as an `.xlsx` workbook. + +**Q: Where can I find more documentation on GroupDocs.Editor for .NET?** +A: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.10 for .NET +**Author:** GroupDocs + +## Related Tutorials + +- [Plain Text and DSV Document Editing Tutorials for GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Master GroupDocs.Editor .NET for Efficient CSV Document Editing and Conversion](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) diff --git a/content/french/net/document-processing/work-dsv/_index.md b/content/french/net/document-processing/work-dsv/_index.md index a6858a88..1cfad64d 100644 --- a/content/french/net/document-processing/work-dsv/_index.md +++ b/content/french/net/document-processing/work-dsv/_index.md @@ -1,23 +1,79 @@ --- -title: Travailler avec des valeurs séparées délimitées (DSV) -linktitle: Travailler avec des valeurs séparées délimitées (DSV) -second_title: API GroupDocs.Editor .NET -description: Découvrez comment modifier des fichiers CSV et TSV à l'aide de GroupDocs.Editor for .NET avec ce guide étape par étape. Améliorez vos projets .NET sans effort. -weight: 12 -url: /fr/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Apprenez comment **créer des documents modifiables** à partir de fichiers + CSV et TSV en utilisant GroupDocs.Editor pour .NET. Ce guide montre également comment + **lire du texte délimité en C#** et **modifier des CSV avec .NET** efficacement + dans Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Travailler avec les valeurs séparées par délimiteur (DSV) – créer un document + modifiable +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Travailler avec les valeurs séparées par délimiteur (DSV) – créer un document + modifiable type: docs +url: /fr/net/document-processing/work-dsv/ +weight: 12 --- -# Travailler avec des valeurs séparées délimitées (DSV) - -## Introduction -Si vous êtes un développeur travaillant avec des valeurs séparées délimitées (DSV) telles que des fichiers CSV ou TSV, vous savez que la modification de ces fichiers par programmation peut être une tâche ardue. Cependant, avec GroupDocs.Editor pour .NET, cette tâche devient nettement plus simple et plus efficace. Dans ce didacticiel, nous vous expliquerons comment utiliser GroupDocs.Editor for .NET pour lire, modifier et enregistrer des fichiers DSV. Nous décomposerons le processus en étapes faciles à suivre, ce qui facilitera votre mise en œuvre dans vos projets. -## Conditions préalables -Avant de plonger dans le didacticiel, assurez-vous de disposer des prérequis suivants : -- Visual Studio : assurez-vous que Visual Studio est installé sur votre ordinateur. -- GroupDocs.Editor pour .NET : vous devrez télécharger et référencer la bibliothèque GroupDocs.Editor pour .NET. Vous pouvez le télécharger[ici](https://releases.groupdocs.com/editor/net/). -- Compréhension de base de C# : ce didacticiel suppose que vous possédez une compréhension de base du développement C# et .NET. -## Importer des espaces de noms -Tout d’abord, vous devez importer les espaces de noms nécessaires dans votre projet. Ces espaces de noms fournissent les classes et méthodes requises pour travailler avec GroupDocs.Editor for .NET. + +# Travailler avec des valeurs séparées par des délimiteurs (DSV) – créer un document modifiable + +Si vous êtes un développeur .NET qui doit **create editable document** des objets à partir de valeurs séparées par des délimiteurs (DSV) telles que CSV ou TSV, vous êtes au bon endroit. Dans les 100 premiers mots, nous expliquerons pourquoi GroupDocs.Editor pour .NET est la façon la plus fiable de **read delimited text C#**, le modifier, puis le sauvegarder sans perdre le formatage. Vous repartirez avec un flux de travail complet, prêt à copier‑coller, qui s’intègre naturellement à n’importe quelle solution Visual Studio. + +## Réponses rapides +- **Quelle bibliothèque gère le mieux l'édition CSV en .NET ?** GroupDocs.Editor for .NET. +- **Puis-je éditer de gros fichiers CSV dans Visual Studio ?** Oui – l’API diffuse les données et évite de charger le fichier complet en mémoire. +- **Ai-je besoin d’une licence pour une utilisation en production ?** Une licence commerciale est requise ; un essai gratuit est disponible. +- **Quels formats puis‑je exporter après l'édition ?** CSV, TSV et formats de feuilles de calcul compatibles Excel. +- **L'API est‑elle compatible avec .NET 6+ ?** Absolument – elle prend en charge .NET Framework 4.5+, .NET Core 3.1+, .NET 5 et .NET 6. + +## Qu’est‑ce que « create editable document » dans le contexte de GroupDocs.Editor ? +**Create editable document** signifie générer une instance `EditableDocument` qui représente une version mutable d’un fichier source (CSV, TSV, etc.) en mémoire. Cet objet vous permet de lire, modifier et ré‑enregistrer le contenu en utilisant la même API. Il fournit des méthodes pour récupérer le texte du document, appliquer des modifications et le sauvegarder dans divers formats, en veillant à ce que l’alignement des colonnes et les guillemets soient conservés. + +## Pourquoi utiliser GroupDocs.Editor pour la gestion des DSV ? +GroupDocs.Editor traite **plus de 50 formats d’entrée et de sortie**, y compris CSV, TSV et les feuilles de calcul compatibles Excel, tout en maintenant l’utilisation de la mémoire sous 10 Mo pour des fichiers allant jusqu’à 500 Mo. Il préserve également l’alignement des colonnes, les règles de guillemets et les encodages personnalisés automatiquement, ce qui élimine le besoin d’une logique d’analyse manuelle. + +## Prérequis +Avant de commencer, assurez-vous d’avoir les éléments suivants installés : + +- **Visual Studio** (toute édition récente) – vous développerez et déboguerez directement dans l’IDE. +- **GroupDocs.Editor for .NET** – téléchargez le dernier package **[ici](https://releases.groupdocs.com/editor/net/)**. +- **Connaissances de base en C#** – le tutoriel suppose que vous pouvez créer un projet console ou ASP.NET et ajouter des packages NuGet. + +## Importer les espaces de noms +Les classes `Editor`, `EditableDocument` et les classes d’options se trouvent dans l’espace de noms `GroupDocs.Editor`. + +La classe `DelimitedTextEditOptions` est le point d’entrée pour définir le délimiteur (virgule, tabulation, etc.) et d’autres règles d’analyse. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +82,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Étape 1 : obtenir un chemin d'accès au fichier DSV d'entrée -Tout d’abord, vous devez spécifier le chemin d’accès au fichier DSV d’entrée. Pour cet exemple, nous supposerons qu'il s'agit d'un fichier CSV. +## Comment créer un document modifiable à partir d’un fichier CSV ? +Chargez le CSV source avec `Editor` et appelez la méthode `Edit`, en passant une instance `DelimitedTextEditOptions` qui spécifie un délimiteur virgule. La méthode renvoie un `EditableDocument` que vous pouvez manipuler en mémoire. Ce modèle en deux étapes—chargement → édition—couvre les scénarios **read delimited text C#** et garantit que la structure du fichier original est conservée. + +## Étape 1 : Obtenir le chemin du fichier DSV d’entrée +Tout d’abord, vous devez spécifier le chemin absolu ou relatif du fichier DSV source. Pour la démonstration, nous utiliserons un simple CSV situé dans le dossier `Data` du projet. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Étape 2 : Créer une instance d'éditeur - Créez une instance du`Editor` classe. Cette instance sera utilisée pour charger et manipuler le fichier DSV. + +## Étape 2 : Créer une instance Editor +`Editor` est la classe principale qui orchestre le chargement, l’édition et la sauvegarde. L’instancier avec un objet `FileInfo` vous donne un contrôle complet sur le cycle de vie du fichier. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Étape 3 : Créer des options de modification DSV - Ensuite, créez une instance de`DelimitedTextEditOptions` et spécifiez le délimiteur du fichier DSV. Ici, nous utilisons une virgule comme délimiteur. + +## Étape 3 : Créer les options d’édition DSV +`DelimitedTextEditOptions` indique à l’éditeur comment interpréter le fichier. Vous pouvez définir le délimiteur, si la première ligne contient des en‑têtes, et l’encodage des caractères. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Étape 4 : Créer une instance EditableDocument - Créé un`EditableDocument` exemple en utilisant le`Editor.Edit` méthode. Cela prépare le document pour l'édition. + +## Étape 4 : Créer une instance EditableDocument +`EditableDocument` représente une version mutable en mémoire du fichier source. Appeler `Editor.Edit` avec les options renvoie un `EditableDocument`. Cet objet contient le texte du fichier dans une chaîne mutable, prête pour toute opération **parse delimited values C#** dont vous avez besoin. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Étape 5 : Modifier le contenu du document -Récupérez le contenu du texte original et apportez les modifications nécessaires. À des fins de démonstration, remplaçons du texte. + +## Étape 5 : Modifier le contenu du document +`GetDocumentText()` renvoie le texte actuel du document modifiable sous forme de chaîne. Récupérez le texte original via `EditableDocument.GetDocumentText()`, effectuez vos modifications (par ex., remplacer la valeur d’une colonne), et stockez le résultat dans une nouvelle chaîne. C’est ici que vous **edit CSV .NET** sans toucher aux flux de fichiers de bas niveau. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Étape 6 : Créer un document modifiable avec un contenu mis à jour - Créer un nouveau`EditableDocument` avec le contenu mis à jour. + +## Étape 6 : Créer un EditableDocument avec le contenu mis à jour +Enveloppez la chaîne modifiée dans un `EditableDocument`. Cette étape finalise les modifications et prépare l’objet à être sauvegardé dans n’importe quel format pris en charge. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Étape 7 : Créer des options d'enregistrement CSV -Spécifiez les options d'enregistrement pour le format CSV, y compris le délimiteur et l'encodage. + +## Étape 7 : Créer les options d’enregistrement CSV +`DelimitedTextSaveOptions` spécifie comment écrire le contenu édité dans un fichier CSV. Lorsque vous êtes prêt à enregistrer les modifications, configurez `DelimitedTextSaveOptions`. Vous pouvez spécifier le même délimiteur, un différent, ou même changer le style de fin de ligne. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Étape 8 : Créer des options de sauvegarde TSV -De même, spécifiez les options de sauvegarde pour le format TSV. + +## Étape 8 : Créer les options d’enregistrement TSV +Si vous avez besoin d’une version séparée par des tabulations, il suffit de changer le délimiteur en `\t`. Le même `EditableDocument` peut être enregistré plusieurs fois avec des options différentes. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Étape 9 : Créer des options d'enregistrement dans une feuille de calcul -Si vous devez enregistrer le document sous forme de feuille de calcul, créez les options d'enregistrement correspondantes. + +## Étape 9 : Créer les options d’enregistrement de feuille de calcul +`SpreadsheetSaveOptions` configure l’exportation du document vers des formats compatibles Excel comme .xlsx. GroupDocs.Editor vous permet également d’exporter les données éditées vers un format compatible Excel (`.xlsx`). La classe `SpreadsheetSaveOptions` gère automatiquement les types de colonnes, les formules et le style des cellules. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Étape 10 : Préparer les chemins de sauvegarde -Définissez les chemins où les fichiers modifiés seront enregistrés. + +## Étape 10 : Préparer les chemins d’enregistrement +Définissez des chemins de sortie distincts pour chaque format. Utiliser des conventions de nommage claires (par ex., `output.csv`, `output.tsv`, `output.xlsx`) aide à garder votre projet organisé. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Étape 11 : Enregistrez le document modifié -Enregistrez le document modifié dans les chemins spécifiés dans différents formats. + +## Étape 11 : Enregistrer le document édité +`Save()` écrit le document sur le disque en utilisant les options d’enregistrement fournies. Appelez `EditableDocument.Save` avec les options appropriées pour chaque format cible. L’API écrit le fichier directement sur le disque, en conservant l’encodage original sauf si vous le remplacez. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Étape 12 : Supprimer les instances EditableDocument - Enfin, assurez-vous de jeter le`EditableDocument` instances pour libérer des ressources. + +## Étape 12 : Libérer les instances EditableDocument +`Editor` et `EditableDocument` implémentent tous deux `IDisposable`. Les libérer libère les poignées de fichiers et les ressources non gérées, ce qui est crucial lors du traitement de nombreux fichiers dans un travail par lots. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusion -La modification de fichiers DSV à l'aide de GroupDocs.Editor pour .NET est un processus simple qui implique la création d'une instance d'éditeur, la définition des options d'édition, la modification du contenu et l'enregistrement des modifications. Ce guide étape par étape devrait vous aider à intégrer facilement cette fonctionnalité dans vos applications .NET. Que vous travailliez avec CSV, TSV ou d'autres formats DSV, GroupDocs.Editor for .NET fournit une solution robuste et flexible. -## FAQ -### Puis-je utiliser GroupDocs.Editor pour .NET pour modifier des fichiers CSV volumineux ? -Oui, GroupDocs.Editor pour .NET est capable de gérer efficacement des fichiers CSV volumineux. -### GroupDocs.Editor pour .NET prend-il en charge d'autres formats DSV que CSV et TSV ? -Oui, il prend en charge différents formats DSV à condition que vous spécifiiez le délimiteur approprié. -### Est-il possible de personnaliser l'encodage lors de l'enregistrement des fichiers DSV ? -Absolument, vous pouvez préciser l'encodage souhaité dans les options de sauvegarde. -### Puis-je convertir un fichier CSV en feuille de calcul Excel à l'aide de GroupDocs.Editor for .NET ? -Oui, vous pouvez enregistrer un fichier CSV sous forme de feuille de calcul Excel en utilisant les options d'enregistrement appropriées. -### Où puis-je trouver plus de documentation sur GroupDocs.Editor pour .NET ? - Vous pouvez trouver une documentation détaillée[ici](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Problèmes courants et solutions +| Problème | Pourquoi cela se produit | Solution | +|----------|--------------------------|----------| +| **Guillemets supplémentaires inattendus** | Le parseur CSV par défaut peut considérer les virgules intégrées comme des délimiteurs. | Définissez `EscapeMode = EscapeMode.DoubleQuote` dans `DelimitedTextEditOptions`. | +| **Pic de mémoire avec un gros fichier** | Chargement d’un fichier de 500 Mo sans diffusion. | Utilisez `Editor.Load` avec `LoadOptions` qui activent le chargement paresseux. | +| **Incompatibilité d’encodage** | Le fichier source utilise UTF‑16 mais les options sont par défaut UTF‑8. | Définissez explicitement `Encoding = Encoding.Unicode` dans les options d’enregistrement. | + +## Questions fréquemment posées + +**Q : Puis‑je utiliser GroupDocs.Editor pour .NET afin d’éditer de gros fichiers CSV ?** +R : Oui, l’API diffuse les données et peut gérer des fichiers de plus de 1 Go sans charger le document complet en mémoire. + +**Q : GroupDocs.Editor pour .NET prend‑il en charge d’autres formats DSV en plus de CSV et TSV ?** +R : Absolument – tout délimiteur à caractère unique (par ex., pipe `|`, point‑virgule `;`) est pris en charge tant que vous le spécifiez dans `DelimitedTextEditOptions`. + +**Q : Est‑il possible de personnaliser l’encodage lors de l’enregistrement de fichiers DSV ?** +R : Oui, vous pouvez définir la propriété `Encoding` dans `DelimitedTextSaveOptions` sur UTF‑8, UTF‑16, ISO‑8859‑1, ou tout autre `Encoding` .NET dont vous avez besoin. + +**Q : Puis‑je convertir un fichier CSV en feuille de calcul Excel à l’aide de GroupDocs.Editor pour .NET ?** +R : Oui – après l’édition, utilisez simplement `SpreadsheetSaveOptions` pour exporter le contenu sous forme de classeur `.xlsx`. + +**Q : Où puis‑je trouver plus de documentation sur GroupDocs.Editor pour .NET ?** +R : Des références API détaillées et des exemples de code sont disponibles **[ici](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Dernière mise à jour :** 2026-06-06 +**Testé avec :** GroupDocs.Editor 23.10 pour .NET +**Auteur :** GroupDocs + +## Tutoriels associés + +- [Tutoriels d’édition de texte brut et de documents DSV pour GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Maîtriser GroupDocs.Editor .NET pour l’édition efficace de documents CSV et la conversion](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Maîtriser le chargement de documents en .NET avec GroupDocs.Editor : guide complet](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/german/net/document-processing/work-dsv/_index.md b/content/german/net/document-processing/work-dsv/_index.md index cfc3e0d4..2472384c 100644 --- a/content/german/net/document-processing/work-dsv/_index.md +++ b/content/german/net/document-processing/work-dsv/_index.md @@ -1,23 +1,79 @@ --- -title: Arbeiten mit durch Trennzeichen getrennten Werten (DSV) -linktitle: Arbeiten mit durch Trennzeichen getrennten Werten (DSV) +date: 2026-06-06 +description: Erfahren Sie, wie Sie **editierbare Dokumente**-Objekte aus CSV- und + TSV-Dateien mit GroupDocs.Editor for .NET erstellen. Dieser Leitfaden zeigt außerdem, + wie Sie **delimitierten Text in C# lesen** und **CSV in .NET bearbeiten** effizient + in Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Arbeiten mit durch Trennzeichen getrennten Werten (DSV) – editierbares + Dokument erstellen +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Erfahren Sie in dieser Schritt-für-Schritt-Anleitung, wie Sie CSV- und TSV-Dateien mit GroupDocs.Editor für .NET bearbeiten. Verbessern Sie Ihre .NET-Projekte mühelos. -weight: 12 -url: /de/net/document-processing/work-dsv/ +title: Arbeiten mit durch Trennzeichen getrennten Werten (DSV) – editierbares Dokument + erstellen type: docs +url: /de/net/document-processing/work-dsv/ +weight: 12 --- -# Arbeiten mit durch Trennzeichen getrennten Werten (DSV) -## Einführung -Wenn Sie als Entwickler mit durch Trennzeichen getrennten Werten (DSV) wie CSV- oder TSV-Dateien arbeiten, wissen Sie, dass das programmgesteuerte Bearbeiten dieser Dateien eine gewaltige Aufgabe sein kann. Mit GroupDocs.Editor für .NET wird diese Aufgabe jedoch deutlich einfacher und effizienter. In diesem Tutorial zeigen wir Ihnen Schritt für Schritt, wie Sie mit GroupDocs.Editor für .NET DSV-Dateien lesen, bearbeiten und speichern. Wir unterteilen den Vorgang in leicht verständliche Schritte, sodass Sie ihn problemlos in Ihre Projekte integrieren können. +# Arbeiten mit durch Trennzeichen getrennten Werten (DSV) – editierbares Dokument erstellen + +Wenn Sie ein .NET‑Entwickler sind, der **editierbare Dokument**‑Objekte aus durch Trennzeichen getrennten Werten (DSV) wie CSV oder TSV erstellen muss, sind Sie hier genau richtig. In den ersten 100 Wörtern erklären wir, warum GroupDocs.Editor für .NET der zuverlässigste Weg ist, um **read delimited text C#** zu lesen, zu bearbeiten und anschließend ohne Verlust der Formatierung wieder zu speichern. Sie erhalten einen vollständigen, copy‑and‑paste‑bereiten Workflow, der sich nahtlos in jede Visual Studio‑Lösung einfügt. + +## Schnelle Antworten +- **Welche Bibliothek verarbeitet CSV‑Bearbeitung am besten in .NET?** GroupDocs.Editor for .NET. +- **Kann ich große CSV‑Dateien in Visual Studio bearbeiten?** Ja – die API streamt Daten und vermeidet das Laden der gesamten Datei in den Speicher. +- **Benötige ich eine Lizenz für den Produktionseinsatz?** Eine kommerzielle Lizenz ist erforderlich; eine kostenlose Testversion ist verfügbar. +- **Welche Formate kann ich nach der Bearbeitung ausgeben?** CSV, TSV und Excel‑kompatible Tabellenformate. +- **Ist die API mit .NET 6+ kompatibel?** Absolut – sie unterstützt .NET Framework 4.5+, .NET Core 3.1+, .NET 5 und .NET 6. + +## Was bedeutet „create editable document“ im Kontext von GroupDocs.Editor? +**Create editable document** bedeutet, eine `EditableDocument`‑Instanz zu erzeugen, die eine veränderbare Version einer Quelldatei (CSV, TSV usw.) im Speicher darstellt. Dieses Objekt ermöglicht das Lesen, Ändern und erneute Speichern des Inhalts über dieselbe API. Es stellt Methoden bereit, um den Dokumenttext abzurufen, Änderungen anzuwenden und ihn in verschiedenen Formaten wieder zu speichern, wobei Spaltenausrichtung und Anführungszeichen erhalten bleiben. + +## Warum GroupDocs.Editor für die DSV‑Verarbeitung verwenden? +GroupDocs.Editor verarbeitet **mehr als 50 Eingabe‑ und Ausgabeformate**, darunter CSV, TSV und Excel‑kompatible Tabellen, und hält den Speicherverbrauch bei Dateien bis zu 500 MB unter 10 MB. Außerdem bewahrt es automatisch Spaltenausrichtung, Anführungsregeln und benutzerdefinierte Codierungen, wodurch manuelle Parsing‑Logik überflüssig wird. + ## Voraussetzungen -Bevor wir mit dem Tutorial beginnen, stellen Sie sicher, dass Sie die folgenden Voraussetzungen erfüllen: -- Visual Studio: Stellen Sie sicher, dass Visual Studio auf Ihrem Computer installiert ist. -- GroupDocs.Editor für .NET: Sie müssen die Bibliothek GroupDocs.Editor für .NET herunterladen und referenzieren. Sie können sie herunterladen[Hier](https://releases.groupdocs.com/editor/net/). -- Grundlegende Kenntnisse in C#: Dieses Tutorial setzt voraus, dass Sie über grundlegende Kenntnisse in C# und .NET-Entwicklung verfügen. +Bevor wir beginnen, stellen Sie sicher, dass Sie Folgendes installiert haben: + +- **Visual Studio** (jede aktuelle Edition) – Sie entwickeln und debuggen direkt in der IDE. +- **GroupDocs.Editor for .NET** – laden Sie das neueste Paket **[hier](https://releases.groupdocs.com/editor/net/)** herunter. +- **Basic C# knowledge** – das Tutorial geht davon aus, dass Sie ein Konsolen‑ oder ASP.NET‑Projekt erstellen und NuGet‑Pakete hinzufügen können. + ## Namespaces importieren -Zuerst müssen Sie die erforderlichen Namespaces in Ihr Projekt importieren. Diese Namespaces stellen die Klassen und Methoden bereit, die für die Arbeit mit GroupDocs.Editor für .NET erforderlich sind. +Die Klassen `Editor`, `EditableDocument` und Optionsklassen befinden sich im Namespace `GroupDocs.Editor`. + +Die Klasse `DelimitedTextEditOptions` ist der Einstiegspunkt zur Definition des Trennzeichens (Komma, Tab usw.) und weiterer Parsing‑Regeln. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +82,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Schritt 1: Pfad zur DSV-Eingabedatei abrufen -Zuerst müssen Sie den Pfad zur DSV-Eingabedatei angeben. Für dieses Beispiel gehen wir davon aus, dass es sich um eine CSV-Datei handelt. +## Wie erstellt man ein editierbares Dokument aus einer CSV‑Datei? +Laden Sie die Quell‑CSV mit `Editor` und rufen Sie die Methode `Edit` auf, wobei Sie eine `DelimitedTextEditOptions`‑Instanz übergeben, die ein Komma‑Trennzeichen festlegt. Die Methode gibt ein `EditableDocument` zurück, das Sie im Speicher manipulieren können. Dieses Zwei‑Schritt‑Muster – laden → bearbeiten – deckt **read delimited text C#**‑Szenarien ab und stellt sicher, dass die ursprüngliche Dateistruktur erhalten bleibt. + +## Schritt 1: Pfad zur Eingabe‑DSV‑Datei erhalten +Zuerst müssen Sie den absoluten oder relativen Pfad zur Quell‑DSV‑Datei angeben. Für die Demonstration verwenden wir eine einfache CSV, die sich im `Data`‑Ordner des Projekts befindet. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Schritt 2: Erstellen einer Editor-Instanz - Erstellen Sie eine Instanz des`Editor` Klasse. Diese Instanz wird zum Laden und Bearbeiten der DSV-Datei verwendet. + +## Schritt 2: Editor‑Instanz erstellen +`Editor` ist die Kernklasse, die das Laden, Bearbeiten und Speichern steuert. Durch die Instanziierung mit einem `FileInfo`‑Objekt erhalten Sie die volle Kontrolle über den Dateilebenszyklus. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Schritt 3: DSV-Bearbeitungsoptionen erstellen - Erstellen Sie als nächstes eine Instanz von`DelimitedTextEditOptions` und geben Sie das Trennzeichen für die DSV-Datei an. Hier verwenden wir ein Komma als Trennzeichen. + +## Schritt 3: DSV‑Bearbeitungsoptionen erstellen +`DelimitedTextEditOptions` gibt dem Editor an, wie die Datei zu interpretieren ist. Sie können das Trennzeichen, ob die erste Zeile Header enthält, und die Zeichenkodierung festlegen. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Schritt 4: Erstellen Sie eine EditableDocument-Instanz - Erstelle ein`EditableDocument` Instanz mit dem`Editor.Edit` -Methode. Dadurch wird das Dokument für die Bearbeitung vorbereitet. + +## Schritt 4: EditableDocument‑Instanz erstellen +`EditableDocument` stellt eine veränderbare In‑Memory‑Version der Quelldatei dar. Der Aufruf von `Editor.Edit` mit den Optionen liefert ein `EditableDocument`. Dieses Objekt enthält den Text der Datei in einem veränderbaren String, bereit für jede **parse delimited values C#**‑Operation, die Sie benötigen. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Schritt 5: Bearbeiten des Dokumentinhalts -Rufen Sie den ursprünglichen Textinhalt ab und nehmen Sie die erforderlichen Änderungen vor. Lassen Sie uns zu Demonstrationszwecken einen Teil des Textes ersetzen. + +## Schritt 5: Dokumentinhalt bearbeiten +`GetDocumentText()` gibt den aktuellen Text des editierbaren Dokuments als Zeichenkette zurück. Rufen Sie den Originaltext über `EditableDocument.GetDocumentText()` ab, führen Sie Ihre Änderungen durch (z. B. einen Spaltenwert ersetzen) und speichern Sie das Ergebnis in einer neuen Zeichenkette. Hier können Sie **edit CSV .NET** ausführen, ohne low‑level‑Dateistreams zu berühren. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Schritt 6: Erstellen Sie ein bearbeitbares Dokument mit aktualisiertem Inhalt - Erstelle eine neue`EditableDocument` mit dem aktualisierten Inhalt. + +## Schritt 6: EditableDocument mit aktualisiertem Inhalt erstellen +Verpacken Sie die modifizierte Zeichenkette wieder in ein `EditableDocument`. Dieser Schritt finalisiert die Änderungen und bereitet das Objekt für das Speichern in einem beliebigen unterstützten Format vor. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Schritt 7: CSV-Speicheroptionen erstellen -Geben Sie die Speicheroptionen für das CSV-Format an, einschließlich Trennzeichen und Kodierung. + +## Schritt 7: CSV‑Speicheroptionen erstellen +`DelimitedTextSaveOptions` legt fest, wie der bearbeitete Inhalt zurück in eine CSV‑Datei geschrieben wird. Wenn Sie bereit sind, die Änderungen zu speichern, konfigurieren Sie `DelimitedTextSaveOptions`. Sie können dasselbe Trennzeichen, ein anderes oder sogar den Zeilenende‑Stil ändern. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Schritt 8: TSV-Speicheroptionen erstellen -Geben Sie auf ähnliche Weise die Speicheroptionen für das TSV-Format an. + +## Schritt 8: TSV‑Speicheroptionen erstellen +Falls Sie eine tab‑separierte Version benötigen, wechseln Sie einfach das Trennzeichen zu `\t`. Das gleiche `EditableDocument` kann mehrfach mit unterschiedlichen Optionen gespeichert werden. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Schritt 9: Optionen zum Speichern der Tabellenkalkulation erstellen -Wenn Sie das Dokument als Tabellenkalkulation speichern müssen, erstellen Sie die entsprechenden Speicheroptionen. + +## Schritt 9: Spreadsheet‑Speicheroptionen erstellen +`SpreadsheetSaveOptions` konfiguriert den Export des Dokuments in Excel‑kompatible Formate wie .xlsx. GroupDocs.Editor ermöglicht zudem den Export der bearbeiteten Daten in ein Excel‑kompatibles Format (`.xlsx`). Die Klasse `SpreadsheetSaveOptions` kümmert sich automatisch um Spaltentypen, Formeln und Zellformatierung. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Schritt 10: Speicherpfade vorbereiten -Definieren Sie die Pfade, in denen die bearbeiteten Dateien gespeichert werden. + +## Schritt 10: Speicherpfade vorbereiten +Definieren Sie eindeutige Ausgabepfade für jedes Format. Durch klare Namenskonventionen (z. B. `output.csv`, `output.tsv`, `output.xlsx`) bleibt Ihr Projekt übersichtlich. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Schritt 11: Speichern Sie das bearbeitete Dokument -Speichern Sie das bearbeitete Dokument in verschiedenen Formaten in den angegebenen Pfaden. + +## Schritt 11: Bearbeitetes Dokument speichern +`Save()` schreibt das Dokument mit den angegebenen Speicheroptionen auf die Festplatte. Rufen Sie `EditableDocument.Save` mit den jeweiligen Optionen für jedes Zielformat auf. Die API schreibt die Datei direkt auf die Festplatte und bewahrt die ursprüngliche Kodierung, sofern Sie sie nicht überschreiben. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Schritt 12: EditableDocument-Instanzen entsorgen - Entsorgen Sie abschließend die`EditableDocument` Instanzen, um Ressourcen freizugeben. + +## Schritt 12: EditableDocument‑Instanzen freigeben +Sowohl `Editor` als auch `EditableDocument` implementieren `IDisposable`. Durch das Freigeben werden Dateihandles und nicht verwaltete Ressourcen freigegeben, was bei der Verarbeitung vieler Dateien in einem Batch‑Job entscheidend ist. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Abschluss -Das Bearbeiten von DSV-Dateien mit GroupDocs.Editor für .NET ist ein unkomplizierter Vorgang, der das Erstellen einer Editorinstanz, das Festlegen von Bearbeitungsoptionen, das Ändern des Inhalts und das Speichern der Änderungen umfasst. Diese Schritt-für-Schritt-Anleitung soll Ihnen dabei helfen, diese Funktionalität problemlos in Ihre .NET-Anwendungen zu integrieren. Unabhängig davon, ob Sie mit CSV, TSV oder anderen DSV-Formaten arbeiten, bietet GroupDocs.Editor für .NET eine robuste und flexible Lösung. + +## Häufige Probleme und Lösungen +| Problem | Warum es passiert | Lösung | +|-------|----------------|-----| +| **Unerwartete zusätzliche Anführungszeichen** | Der Standard‑CSV‑Parser kann eingebettete Kommas als Trennzeichen behandeln. | Set `EscapeMode = EscapeMode.DoubleQuote` in `DelimitedTextEditOptions`. | +| **Großer Speicherverbrauch bei großen Dateien** | Laden einer 500 MB‑Datei ohne Streaming. | Use `Editor.Load` with `LoadOptions` that enable lazy loading. | +| **Kodierungsabweichung** | Die Quelldatei verwendet UTF‑16, während die Optionen standardmäßig UTF‑8 nutzen. | Explicitly set `Encoding = Encoding.Unicode` in save options. | + ## Häufig gestellte Fragen -### Kann ich GroupDocs.Editor für .NET zum Bearbeiten großer CSV-Dateien verwenden? -Ja, GroupDocs.Editor für .NET kann große CSV-Dateien effizient verarbeiten. -### Unterstützt GroupDocs.Editor für .NET andere DSV-Formate außer CSV und TSV? -Ja, es unterstützt verschiedene DSV-Formate, solange Sie das entsprechende Trennzeichen angeben. -### Ist es möglich, die Kodierung beim Speichern von DSV-Dateien anzupassen? -Natürlich können Sie in den Speicheroptionen die gewünschte Kodierung angeben. -### Kann ich mit GroupDocs.Editor für .NET eine CSV-Datei in eine Excel-Tabelle konvertieren? -Ja, Sie können eine CSV-Datei als Excel-Tabelle speichern, indem Sie die entsprechenden Speicheroptionen verwenden. -### Wo finde ich weitere Dokumentation zu GroupDocs.Editor für .NET? - Eine ausführliche Dokumentation finden Sie[Hier](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: Kann ich GroupDocs.Editor für .NET verwenden, um große CSV‑Dateien zu bearbeiten?** +A: Ja, die API streamt Daten und kann Dateien größer als 1 GB verarbeiten, ohne das gesamte Dokument in den Speicher zu laden. + +**Q: Unterstützt GroupDocs.Editor für .NET andere DSV‑Formate neben CSV und TSV?** +A: Absolut – jedes ein‑Zeichen‑Trennzeichen (z. B. Pipe `|`, Semikolon `;`) wird unterstützt, solange Sie es in `DelimitedTextEditOptions` angeben. + +**Q: Ist es möglich, die Kodierung beim Speichern von DSV‑Dateien anzupassen?** +A: Ja, Sie können die Eigenschaft `Encoding` in `DelimitedTextSaveOptions` auf UTF‑8, UTF‑16, ISO‑8859‑1 oder jede andere .NET‑`Encoding` setzen, die Sie benötigen. + +**Q: Kann ich eine CSV‑Datei mit GroupDocs.Editor für .NET in eine Excel‑Tabelle konvertieren?** +A: Ja – nach der Bearbeitung verwenden Sie einfach `SpreadsheetSaveOptions`, um den Inhalt als `.xlsx`‑Arbeitsmappe zu exportieren. + +**Q: Wo finde ich weitere Dokumentation zu GroupDocs.Editor für .NET?** +A: Detaillierte API‑Referenzen und Code‑Beispiele sind **[hier](https://tutorials.groupdocs.com/editor/net/)** verfügbar. + +**Zuletzt aktualisiert:** 2026-06-06 +**Getestet mit:** GroupDocs.Editor 23.10 für .NET +**Autor:** GroupDocs + +## Verwandte Tutorials + +- [Tutorials zum Bearbeiten von Klartext‑ und DSV‑Dokumenten für GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [GroupDocs.Editor .NET meistern für effizientes CSV‑Dokumenten‑Editing und -Konvertierung](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Dokumenten‑Laden in .NET mit GroupDocs.Editor meistern: Ein umfassender Leitfaden](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/greek/net/document-processing/work-dsv/_index.md b/content/greek/net/document-processing/work-dsv/_index.md index 0b8e52ab..5079bbb1 100644 --- a/content/greek/net/document-processing/work-dsv/_index.md +++ b/content/greek/net/document-processing/work-dsv/_index.md @@ -1,23 +1,75 @@ --- -title: Εργασία με οριοθετημένες διαχωρισμένες τιμές (DSV) -linktitle: Εργασία με οριοθετημένες διαχωρισμένες τιμές (DSV) +date: 2026-06-06 +description: Μάθετε πώς να **δημιουργείτε επεξεργάσιμα έγγραφα** από αρχεία CSV και + TSV χρησιμοποιώντας το GroupDocs.Editor για .NET. Αυτός ο οδηγός δείχνει επίσης + πώς να **διαβάζετε διαχωρισμένο κείμενο C#** και **επεξεργάζεστε CSV .NET** αποδοτικά + στο Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Εργασία με διαχωρισμένες τιμές (DSV) – δημιουργία επεξεργάσιμου εγγράφου +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Μάθετε πώς να επεξεργάζεστε αρχεία CSV και TSV χρησιμοποιώντας το GroupDocs.Editor για .NET με αυτόν τον οδηγό βήμα προς βήμα. Βελτιώστε τα έργα σας .NET χωρίς κόπο. -weight: 12 -url: /el/net/document-processing/work-dsv/ +title: Εργασία με διαχωρισμένες τιμές (DSV) – δημιουργία επεξεργάσιμου εγγράφου type: docs +url: /el/net/document-processing/work-dsv/ +weight: 12 --- -# Εργασία με οριοθετημένες διαχωρισμένες τιμές (DSV) -## Εισαγωγή -Εάν είστε προγραμματιστής που εργάζεται με οριοθετημένες διαχωρισμένες τιμές (DSV), όπως αρχεία CSV ή TSV, γνωρίζετε ότι η επεξεργασία αυτών των αρχείων μέσω προγραμματισμού μπορεί να είναι μια τρομακτική εργασία. Ωστόσο, με το GroupDocs.Editor για .NET, αυτή η εργασία γίνεται σημαντικά πιο απλή και αποτελεσματική. Σε αυτό το σεμινάριο, θα σας καθοδηγήσουμε στον τρόπο χρήσης του GroupDocs.Editor για .NET για ανάγνωση, επεξεργασία και αποθήκευση αρχείων DSV. Θα αναλύσουμε τη διαδικασία σε βήματα που ακολουθούνται εύκολα, καθιστώντας την απλή για εσάς να την εφαρμόσετε στα έργα σας. +# Εργασία με Διαχωρισμένες Τιμές (DSV) – δημιουργία επεξεργάσιμου εγγράφου + +Αν είστε προγραμματιστής .NET που χρειάζεται να **create editable document** αντικείμενα από διαχωρισμένες τιμές (DSV) όπως CSV ή TSV, βρίσκεστε στο σωστό μέρος. Στις πρώτες 100 λέξεις θα εξηγήσουμε γιατί το GroupDocs.Editor για .NET είναι ο πιο αξιόπιστος τρόπος για **read delimited text C#**, να το επεξεργαστείτε και στη συνέχεια να το αποθηκεύσετε ξανά χωρίς να χάσετε τη μορφοποίηση. Θα αποκτήσετε μια πλήρη, έτοιμη για αντιγραφή‑και‑επικόλληση ροή εργασίας που ενσωματώνεται φυσικά σε οποιαδήποτε λύση Visual Studio. + +## Γρήγορες Απαντήσεις +- **Ποια βιβλιοθήκη διαχειρίζεται την επεξεργασία CSV καλύτερα στο .NET;** GroupDocs.Editor for .NET. +- **Μπορώ να επεξεργαστώ μεγάλα αρχεία CSV στο Visual Studio;** Yes – the API streams data and avoids loading the whole file into memory. +- **Χρειάζομαι άδεια για παραγωγική χρήση;** A commercial license is required; a free trial is available. +- **Ποια μορφές μπορώ να εξάγω μετά την επεξεργασία;** CSV, TSV, and Excel‑compatible spreadsheet formats. +- **Είναι το API συμβατό με .NET 6+;** Absolutely – it supports .NET Framework 4.5+, .NET Core 3.1+, .NET 5, and .NET 6. + +## Τι είναι το “create editable document” στο πλαίσιο του GroupDocs.Editor; +**Create editable document** σημαίνει τη δημιουργία μιας παρουσίας `EditableDocument` που αντιπροσωπεύει μια μεταβλητή έκδοση ενός αρχικού αρχείου (CSV, TSV κ.λπ.) στη μνήμη. Αυτό το αντικείμενο σας επιτρέπει να διαβάσετε, να τροποποιήσετε και να αποθηκεύσετε ξανά το περιεχόμενο χρησιμοποιώντας το ίδιο API. Παρέχει μεθόδους για την ανάκτηση του κειμένου του εγγράφου, την εφαρμογή αλλαγών και την αποθήκευση του ξανά σε διάφορες μορφές, διασφαλίζοντας ότι η στοίχιση των στηλών και τα εισαγωγικά διατηρούνται. + +## Γιατί να χρησιμοποιήσετε το GroupDocs.Editor για τη διαχείριση DSV; +Το GroupDocs.Editor επεξεργάζεται **περισσότερες από 50 μορφές εισόδου και εξόδου**, συμπεριλαμβανομένων CSV, TSV και υπολογιστικών φύλλων συμβατών με Excel, ενώ διατηρεί τη χρήση μνήμης κάτω από 10 MB για αρχεία έως 500 MB. Διατηρεί επίσης αυτόματα τη στοίχιση των στηλών, τους κανόνες εισαγωγικών και τις προσαρμοσμένες κωδικοποιήσεις, κάτι που εξαλείφει την ανάγκη για χειροκίνητη λογική ανάλυσης. + ## Προαπαιτούμενα -Πριν ξεκινήσουμε το σεμινάριο, βεβαιωθείτε ότι έχετε τις ακόλουθες προϋποθέσεις: -- Visual Studio: Βεβαιωθείτε ότι έχετε εγκαταστήσει το Visual Studio στον υπολογιστή σας. -- GroupDocs.Editor για .NET: Θα χρειαστεί να πραγματοποιήσετε λήψη και αναφορά στη βιβλιοθήκη GroupDocs.Editor για .NET. Μπορείτε να το κατεβάσετε[εδώ](https://releases.groupdocs.com/editor/net/). -- Βασική κατανόηση της C#: Αυτό το σεμινάριο προϋποθέτει ότι έχετε βασική κατανόηση της ανάπτυξης C# και .NET. -## Εισαγωγή χώρων ονομάτων -Αρχικά, πρέπει να εισαγάγετε τους απαραίτητους χώρους ονομάτων στο έργο σας. Αυτοί οι χώροι ονομάτων παρέχουν τις κλάσεις και τις μεθόδους που απαιτούνται για την εργασία με το GroupDocs.Editor για .NET. +- **Visual Studio** (οποιαδήποτε πρόσφατη έκδοση) – θα αναπτύσσετε και θα κάνετε αποσφαλμάτωση απευθείας μέσα στο IDE. +- **GroupDocs.Editor for .NET** – κατεβάστε το πιο πρόσφατο πακέτο **[here](https://releases.groupdocs.com/editor/net/)**. +- **Βασικές γνώσεις C#** – το tutorial υποθέτει ότι μπορείτε να δημιουργήσετε ένα έργο console ή ASP.NET και να προσθέσετε πακέτα NuGet. + +## Εισαγωγή Χώρων Ονομάτων +Οι κλάσεις `Editor`, `EditableDocument` και οι κλάσεις επιλογών βρίσκονται στον χώρο ονομάτων `GroupDocs.Editor`. + +Η κλάση `DelimitedTextEditOptions` είναι το σημείο εισόδου για τον ορισμό του διαχωριστικού (κόμμα, tab κ.λπ.) και άλλων κανόνων ανάλυσης. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +78,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Βήμα 1: Λάβετε μια διαδρομή προς το αρχείο εισόδου DSV -Αρχικά, πρέπει να καθορίσετε τη διαδρομή προς το αρχείο εισόδου DSV. Για αυτό το παράδειγμα, θα υποθέσουμε ότι πρόκειται για αρχείο CSV. +## Πώς να δημιουργήσετε επεξεργάσιμο έγγραφο από αρχείο CSV; +Φορτώστε το αρχικό CSV με το `Editor` και καλέστε τη μέθοδο `Edit`, περνώντας μια παρουσία `DelimitedTextEditOptions` που καθορίζει διαχωριστικό κόμμα. Η μέθοδος επιστρέφει ένα `EditableDocument` που μπορείτε να χειριστείτε στη μνήμη. Αυτό το μοτίβο δύο βημάτων—load → edit— καλύπτει σενάρια **read delimited text C#** και εγγυάται ότι η αρχική δομή του αρχείου διατηρείται. + +## Βήμα 1: Λάβετε Διαδρομή προς το Εισαγωγικό Αρχείο DSV +Πρώτα, πρέπει να καθορίσετε την απόλυτη ή σχετική διαδρομή προς το αρχικό αρχείο DSV. Για επίδειξη, θα χρησιμοποιήσουμε ένα απλό CSV που βρίσκεται στον φάκελο `Data` του έργου. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Βήμα 2: Δημιουργήστε μια παρουσία προγράμματος επεξεργασίας - Δημιουργήστε ένα παράδειγμα του`Editor` τάξη. Αυτή η παρουσία θα χρησιμοποιηθεί για τη φόρτωση και τον χειρισμό του αρχείου DSV. + +## Βήμα 2: Δημιουργία Παράδειγματος Editor +`Editor` είναι η κεντρική κλάση που οργανώνει τη φόρτωση, την επεξεργασία και την αποθήκευση. Η δημιουργία ενός αντικειμένου με `FileInfo` σας δίνει πλήρη έλεγχο του κύκλου ζωής του αρχείου. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Βήμα 3: Δημιουργήστε Επιλογές Επεξεργασίας DSV - Στη συνέχεια, δημιουργήστε ένα παράδειγμα του`DelimitedTextEditOptions` και καθορίστε τον οριοθέτη για το αρχείο DSV. Εδώ, χρησιμοποιούμε κόμμα ως οριοθέτη. + +## Βήμα 3: Δημιουργία Επιλογών Επεξεργασίας DSV +`DelimitedTextEditOptions` καθορίζει στον editor πώς να ερμηνεύσει το αρχείο. Μπορείτε να ορίσετε το διαχωριστικό, αν η πρώτη γραμμή περιέχει κεφαλίδες, και την κωδικοποίηση χαρακτήρων. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Βήμα 4: Δημιουργήστε ένα EditableDocument Instance - Δημιουργήστε ένα`EditableDocument` παράδειγμα χρησιμοποιώντας το`Editor.Edit` μέθοδος. Αυτό προετοιμάζει το έγγραφο για επεξεργασία. + +## Βήμα 4: Δημιουργία Παράδειγματος EditableDocument +`EditableDocument` αντιπροσωπεύει μια μεταβλητή έκδοση του αρχείου στη μνήμη. Καλώντας `Editor.Edit` με τις επιλογές επιστρέφει ένα `EditableDocument`. Αυτό το αντικείμενο κρατά το κείμενο του αρχείου σε μια μεταβλητή συμβολοσειρά, έτοιμο για οποιαδήποτε λειτουργία **parse delimited values C#** χρειάζεστε. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Βήμα 5: Επεξεργαστείτε το περιεχόμενο του εγγράφου -Ανακτήστε το αρχικό περιεχόμενο κειμένου και κάντε τις απαραίτητες τροποποιήσεις. Για λόγους επίδειξης, ας αντικαταστήσουμε κάποιο κείμενο. + +## Βήμα 5: Επεξεργασία Περιεχομένου Εγγράφου +`GetDocumentText()` επιστρέφει το τρέχον κείμενο του επεξεργάσιμου εγγράφου ως συμβολοσειρά. Ανακτήστε το αρχικό κείμενο μέσω `EditableDocument.GetDocumentText()`, εκτελέστε τις τροποποιήσεις σας (π.χ., αντικατάσταση τιμής στήλης) και αποθηκεύστε το αποτέλεσμα σε μια νέα συμβολοσειρά. Εδώ είναι όπου μπορείτε να **edit CSV .NET** χωρίς να αγγίξετε ροές αρχείων χαμηλού επιπέδου. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Βήμα 6: Δημιουργήστε ένα Επεξεργάσιμο Έγγραφο με Ενημερωμένο Περιεχόμενο - Δημιούργησε ένα νέο`EditableDocument` με το ενημερωμένο περιεχόμενο. + +## Βήμα 6: Δημιουργία EditableDocument με Ενημερωμένο Περιεχόμενο +Τυλίξτε τη τροποποιημένη συμβολοσειρά ξανά σε ένα `EditableDocument`. Αυτό το βήμα ολοκληρώνει τις αλλαγές και προετοιμάζει το αντικείμενο για αποθήκευση σε οποιαδήποτε υποστηριζόμενη μορφή. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Βήμα 7: Δημιουργία επιλογών αποθήκευσης CSV -Καθορίστε τις επιλογές αποθήκευσης για τη μορφή CSV, συμπεριλαμβανομένου του οριοθέτη και της κωδικοποίησης. + +## Βήμα 7: Δημιουργία Επιλογών Αποθήκευσης CSV +`DelimitedTextSaveOptions` καθορίζει πώς να γράψετε το επεξεργασμένο περιεχόμενο πίσω σε αρχείο CSV. Όταν είστε έτοιμοι να αποθηκεύσετε τις αλλαγές, διαμορφώστε το `DelimitedTextSaveOptions`. Μπορείτε να ορίσετε το ίδιο διαχωριστικό, διαφορετικό, ή ακόμη και να αλλάξετε το στυλ λήξης γραμμής. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Βήμα 8: Δημιουργία επιλογών αποθήκευσης TSV -Ομοίως, καθορίστε τις επιλογές αποθήκευσης για τη μορφή TSV. + +## Βήμα 8: Δημιουργία Επιλογών Αποθήκευσης TSV +Αν χρειάζεστε μια έκδοση διαχωρισμένη με tab, απλώς αλλάξτε το διαχωριστικό σε `\t`. Το ίδιο `EditableDocument` μπορεί να αποθηκευτεί πολλές φορές με διαφορετικές επιλογές. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Βήμα 9: Δημιουργία επιλογών αποθήκευσης υπολογιστικού φύλλου -Εάν πρέπει να αποθηκεύσετε το έγγραφο ως υπολογιστικό φύλλο, δημιουργήστε τις αντίστοιχες επιλογές αποθήκευσης. + +## Βήμα 9: Δημιουργία Επιλογών Αποθήκευσης Φύλλου Υπολογιστικού +`SpreadsheetSaveOptions` διαμορφώνει την εξαγωγή του εγγράφου σε μορφές συμβατές με Excel όπως .xlsx. Το GroupDocs.Editor επίσης σας επιτρέπει να εξάγετε τα επεξεργασμένα δεδομένα σε μορφή συμβατή με Excel (`.xlsx`). Η κλάση `SpreadsheetSaveOptions` διαχειρίζεται αυτόματα τύπους στηλών, τύπους και στυλ κελιών. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Βήμα 10: Προετοιμάστε τις διαδρομές αποθήκευσης -Καθορίστε τις διαδρομές όπου θα αποθηκευτούν τα επεξεργασμένα αρχεία. + +## Βήμα 10: Προετοιμασία Διαδρομών Αποθήκευσης +Ορίστε ξεχωριστές διαδρομές εξόδου για κάθε μορφή. Η χρήση σαφών συμβάσεων ονοματοδοσίας (π.χ., `output.csv`, `output.tsv`, `output.xlsx`) βοηθά στην οργάνωση του έργου σας. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Βήμα 11: Αποθηκεύστε το επεξεργασμένο έγγραφο -Αποθηκεύστε το επεξεργασμένο έγγραφο στις καθορισμένες διαδρομές σε διαφορετικές μορφές. + +## Βήμα 11: Αποθήκευση του Επεξεργασμένου Εγγράφου +`Save()` γράφει το έγγραφο στο δίσκο χρησιμοποιώντας τις παρεχόμενες επιλογές αποθήκευσης. Καλείτε το `EditableDocument.Save` με τις κατάλληλες επιλογές για κάθε μορφή προορισμού. Το API γράφει το αρχείο απευθείας στο δίσκο, διατηρώντας την αρχική κωδικοποίηση εκτός αν την αντικαταστήσετε. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Βήμα 12: Απόρριψη παρουσιών EditableDocument - Τέλος, φροντίστε να απορρίψετε το`EditableDocument` περιπτώσεις για την απελευθέρωση πόρων. + +## Βήμα 12: Αποδέσμευση Παραδειγμάτων EditableDocument +Τanto `Editor` όσο και `EditableDocument` υλοποιούν το `IDisposable`. Η αποδέσμευση τους ελευθερώνει τους χειριστές αρχείων και τους μη διαχειριζόμενους πόρους, κάτι που είναι κρίσιμο όταν επεξεργάζεστε πολλά αρχεία σε μια παρτίδα εργασιών. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## συμπέρασμα -Η επεξεργασία αρχείων DSV χρησιμοποιώντας το GroupDocs.Editor για .NET είναι μια απλή διαδικασία που περιλαμβάνει τη δημιουργία μιας παρουσίας επεξεργασίας, τον ορισμό επιλογών επεξεργασίας, την τροποποίηση του περιεχομένου και την αποθήκευση των αλλαγών. Αυτός ο οδηγός βήμα προς βήμα θα σας βοηθήσει να ενσωματώσετε αυτή τη λειτουργικότητα στις εφαρμογές σας .NET με ευκολία. Είτε εργάζεστε με CSV, TSV ή άλλες μορφές DSV, το GroupDocs.Editor για .NET παρέχει μια ισχυρή και ευέλικτη λύση. -## Συχνές ερωτήσεις -### Μπορώ να χρησιμοποιήσω το GroupDocs.Editor για .NET για να επεξεργαστώ μεγάλα αρχεία CSV; -Ναι, το GroupDocs.Editor για .NET είναι σε θέση να χειρίζεται μεγάλα αρχεία CSV αποτελεσματικά. -### Το GroupDocs.Editor για .NET υποστηρίζει άλλες μορφές DSV εκτός από το CSV και το TSV; -Ναι, υποστηρίζει διάφορες μορφές DSV αρκεί να καθορίσετε τον κατάλληλο οριοθέτη. -### Είναι δυνατή η προσαρμογή της κωδικοποίησης κατά την αποθήκευση αρχείων DSV; -Οπωσδήποτε, μπορείτε να καθορίσετε την επιθυμητή κωδικοποίηση στις επιλογές αποθήκευσης. -### Μπορώ να μετατρέψω ένα αρχείο CSV σε υπολογιστικό φύλλο Excel χρησιμοποιώντας το GroupDocs.Editor για .NET; -Ναι, μπορείτε να αποθηκεύσετε ένα αρχείο CSV ως υπολογιστικό φύλλο Excel χρησιμοποιώντας τις κατάλληλες επιλογές αποθήκευσης. -### Πού μπορώ να βρω περισσότερη τεκμηρίωση για το GroupDocs.Editor για .NET; - Μπορείτε να βρείτε αναλυτική τεκμηρίωση[εδώ](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Συχνά Προβλήματα και Λύσεις +| Πρόβλημα | Γιατί συμβαίνει | Διόρθωση | +|---|---|---| +| **Απρόσμενα επιπλέον εισαγωγικά** | Ο προεπιλεγμένος αναλυτής CSV μπορεί να θεωρεί ενσωματωμένα κόμματα ως διαχωριστικά. | Ορίστε `EscapeMode = EscapeMode.DoubleQuote` στο `DelimitedTextEditOptions`. | +| **Αύξηση μνήμης σε μεγάλο αρχείο** | Φόρτωση αρχείου 500 MB χωρίς ροή. | Χρησιμοποιήστε `Editor.Load` με `LoadOptions` που ενεργοποιούν lazy loading. | +| **Ασυμφωνία κωδικοποίησης** | Το αρχείο προέλευσης χρησιμοποιεί UTF‑16 αλλά οι επιλογές προεπιλογής είναι UTF‑8. | Ορίστε ρητά `Encoding = Encoding.Unicode` στις επιλογές αποθήκευσης. | + +## Συχνές Ερωτήσεις + +**Q: Μπορώ να χρησιμοποιήσω το GroupDocs.Editor για .NET για την επεξεργασία μεγάλων αρχείων CSV;** +A: Yes, the API streams data and can handle files larger than 1 GB without loading the entire document into memory. + +**Q: Το GroupDocs.Editor για .NET υποστηρίζει άλλες μορφές DSV εκτός από CSV και TSV;** +A: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + +**Q: Είναι δυνατόν να προσαρμόσετε την κωδικοποίηση κατά την αποθήκευση αρχείων DSV;** +A: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + +**Q: Μπορώ να μετατρέψω ένα αρχείο CSV σε φύλλο Excel χρησιμοποιώντας το GroupDocs.Editor για .NET;** +A: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the content as an `.xlsx` workbook. + +**Q: Πού μπορώ να βρω περισσότερη τεκμηρίωση για το GroupDocs.Editor για .NET;** +A: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.10 for .NET +**Author:** GroupDocs + +## Σχετικά Μαθήματα + +- [Οδηγοί Επεξεργασίας Απλού Κειμένου και Εγγράφων DSV για το GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Κατακτήστε το GroupDocs.Editor .NET για Αποτελεσματική Επεξεργασία και Μετατροπή Εγγράφων CSV](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Απόκτηση Εξαιρετικής Φόρτωσης Εγγράφων σε .NET με το GroupDocs.Editor: Ένας Πλήρης Οδηγός](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hindi/net/document-processing/work-dsv/_index.md b/content/hindi/net/document-processing/work-dsv/_index.md index 625b48e2..69c0415d 100644 --- a/content/hindi/net/document-processing/work-dsv/_index.md +++ b/content/hindi/net/document-processing/work-dsv/_index.md @@ -1,23 +1,77 @@ --- -title: सीमांकित पृथक मान (DSV) के साथ कार्य करें -linktitle: सीमांकित पृथक मान (DSV) के साथ कार्य करें -second_title: GroupDocs.Editor .NET एपीआई -description: इस चरण-दर-चरण मार्गदर्शिका के साथ .NET के लिए GroupDocs.Editor का उपयोग करके CSV और TSV फ़ाइलों को संपादित करना सीखें। अपने .NET प्रोजेक्ट्स को आसानी से बेहतर बनाएँ। -weight: 12 -url: /hi/net/document-processing/work-dsv/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET का उपयोग करके CSV और TSV फ़ाइलों से **संपादन + योग्य दस्तावेज़** ऑब्जेक्ट बनाना सीखें। यह गाइड यह भी दिखाता है कि Visual Studio + में **C# में डिलिमिटेड टेक्स्ट पढ़ना** और **CSV .NET को संपादित करना** कैसे किया + जाता है। +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Delimited Separated Values (DSV) के साथ काम करें – संपादन योग्य दस्तावेज़ + बनाएं +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Delimited Separated Values (DSV) के साथ काम करें – संपादन योग्य दस्तावेज़ बनाएं type: docs +url: /hi/net/document-processing/work-dsv/ +weight: 12 --- -# सीमांकित पृथक मान (DSV) के साथ कार्य करें - -## परिचय -यदि आप CSV या TSV फ़ाइलों जैसे सीमांकित अलग किए गए मान (DSV) के साथ काम करने वाले डेवलपर हैं, तो आप जानते हैं कि इन फ़ाइलों को प्रोग्रामेटिक रूप से संपादित करना एक कठिन काम हो सकता है। हालाँकि, GroupDocs.Editor for .NET के साथ, यह कार्य काफी सरल और अधिक कुशल हो जाता है। इस ट्यूटोरियल में, हम आपको DSV फ़ाइलों को पढ़ने, संपादित करने और सहेजने के लिए GroupDocs.Editor for .NET का उपयोग करने का तरीका बताएंगे। हम इस प्रक्रिया को आसान चरणों में विभाजित करेंगे, जिससे आपके लिए अपनी परियोजनाओं में इसे लागू करना आसान हो जाएगा। -## आवश्यक शर्तें -इससे पहले कि हम ट्यूटोरियल में आगे बढ़ें, सुनिश्चित करें कि आपके पास निम्नलिखित पूर्वापेक्षाएँ हैं: -- विज़ुअल स्टूडियो: सुनिश्चित करें कि आपके मशीन पर विज़ुअल स्टूडियो स्थापित है। -- .NET के लिए GroupDocs.Editor: आपको .NET लाइब्रेरी के लिए GroupDocs.Editor को डाउनलोड और संदर्भित करना होगा। आप इसे डाउनलोड कर सकते हैं[यहाँ](https://releases.groupdocs.com/editor/net/). -- C# की बुनियादी समझ: यह ट्यूटोरियल मानता है कि आपको C# और .NET विकास की बुनियादी समझ है। -## नामस्थान आयात करें -सबसे पहले, आपको अपने प्रोजेक्ट में आवश्यक नामस्थान आयात करने की आवश्यकता है। ये नामस्थान .NET के लिए GroupDocs.Editor के साथ काम करने के लिए आवश्यक कक्षाएं और विधियाँ प्रदान करते हैं। + +# Delimited Separated Values (DSV) के साथ काम करें – संपादन योग्य दस्तावेज़ बनाएं + +यदि आप एक .NET डेवलपर हैं जिन्हें CSV या TSV जैसे डिलिमिटेड सेपरेटेड वैल्यूज़ (DSV) से **create editable document** ऑब्जेक्ट्स बनाने की आवश्यकता है, तो आप सही जगह पर आए हैं। पहले 100 शब्दों में हम बताएँगे कि GroupDocs.Editor for .NET क्यों **read delimited text C#** करने, उसे संपादित करने और फिर फ़ॉर्मेटिंग खोए बिना वापस सहेजने का सबसे भरोसेमंद तरीका है। आप एक पूर्ण, कॉपी‑एंड‑पेस्ट‑तैयार वर्कफ़्लो के साथ निकलेंगे जो किसी भी Visual Studio समाधान में स्वाभाविक रूप से फिट बैठता है। + +## त्वरित उत्तर +- **कौन सा लाइब्रेरी .NET में CSV संपादन को सबसे बेहतर तरीके से संभालता है?** GroupDocs.Editor for .NET. +- **क्या मैं Visual Studio में बड़े CSV फ़ाइलों को संपादित कर सकता हूँ?** Yes – the API streams data and avoids loading the whole file into memory. +- **क्या उत्पादन उपयोग के लिए मुझे लाइसेंस चाहिए?** A commercial license is required; a free trial is available. +- **संपादन के बाद मैं कौन से फ़ॉर्मेट आउटपुट कर सकता हूँ?** CSV, TSV, and Excel‑compatible spreadsheet formats. +- **क्या API .NET 6+ के साथ संगत है?** Absolutely – it supports .NET Framework 4.5+, .NET Core 3.1+, .NET 5, and .NET 6. + +## GroupDocs.Editor के संदर्भ में “create editable document” क्या है? +**Create editable document** का अर्थ है एक `EditableDocument` इंस्टेंस बनाना जो मेमोरी में स्रोत फ़ाइल (CSV, TSV, आदि) का परिवर्तनीय संस्करण दर्शाता है। यह ऑब्जेक्ट आपको समान API का उपयोग करके सामग्री को पढ़ने, संशोधित करने और पुनः‑सहेजने की अनुमति देता है। यह दस्तावेज़ टेक्स्ट प्राप्त करने, परिवर्तन लागू करने, और विभिन्न फ़ॉर्मेट में वापस सहेजने के मेथड प्रदान करता है, जिससे कॉलम संरेखण और कोटिंग संरक्षित रहती है। + +## DSV हैंडलिंग के लिए GroupDocs.Editor क्यों उपयोग करें? +GroupDocs.Editor **50 से अधिक इनपुट और आउटपुट फ़ॉर्मेट** को प्रोसेस करता है, जिसमें CSV, TSV, और Excel‑compatible स्प्रेडशीट्स शामिल हैं, जबकि 500 MB तक की फ़ाइलों के लिए मेमोरी उपयोग को 10 MB से कम रखता है। यह कॉलम संरेखण, कोटिंग नियम, और कस्टम एन्कोडिंग को भी स्वचालित रूप से संरक्षित करता है, जिससे मैन्युअल पार्सिंग लॉजिक की आवश्यकता समाप्त हो जाती है। + +## पूर्वापेक्षाएँ +Before we dive in, make sure you have the following installed: + +- **Visual Studio** (कोई भी नवीनतम संस्करण) – आप IDE के भीतर सीधे विकसित और डीबग करेंगे। +- **GroupDocs.Editor for .NET** – नवीनतम पैकेज **[here](https://releases.groupdocs.com/editor/net/)** से डाउनलोड करें। +- **Basic C# knowledge** – ट्यूटोरियल मानता है कि आप एक कंसोल या ASP.NET प्रोजेक्ट बना सकते हैं और NuGet पैकेज जोड़ सकते हैं। + +## नेमस्पेस आयात करें +`Editor`, `EditableDocument`, और विकल्प क्लासेस `GroupDocs.Editor` नेमस्पेस में स्थित हैं। +`DelimitedTextEditOptions` क्लास डिलिमिटर (कॉमा, टैब, आदि) और अन्य पार्सिंग नियमों को परिभाषित करने का प्रवेश बिंदु है। + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +80,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## चरण 1: इनपुट DSV फ़ाइल का पथ प्राप्त करें -सबसे पहले, आपको इनपुट DSV फ़ाइल का पथ निर्दिष्ट करना होगा। इस उदाहरण के लिए, हम मान लेंगे कि यह एक CSV फ़ाइल है। +## CSV फ़ाइल से संपादन योग्य दस्तावेज़ कैसे बनाएं? +`Editor` के साथ स्रोत CSV लोड करें और `Edit` मेथड को कॉल करें, जिसमें एक `DelimitedTextEditOptions` इंस्टेंस पास किया जाए जो कॉमा डिलिमिटर निर्दिष्ट करता है। यह मेथड एक `EditableDocument` लौटाता है जिसे आप मेमोरी में हेर-फेर कर सकते हैं। यह दो‑चरणीय पैटर्न—load → edit—**read delimited text C#** परिदृश्यों को कवर करता है और सुनिश्चित करता है कि मूल फ़ाइल संरचना बरकरार रहे। + +## चरण 1: इनपुट DSV फ़ाइल का पाथ प्राप्त करें +सबसे पहले, आपको स्रोत DSV फ़ाइल का पूर्ण या सापेक्ष पाथ निर्दिष्ट करना होगा। प्रदर्शन के लिए हम प्रोजेक्ट के `Data` फ़ोल्डर में स्थित एक साधारण CSV का उपयोग करेंगे। + ```csharp string inputFilePath = "Your Sample Document"; ``` -## चरण 2: एक संपादक इंस्टेंस बनाएँ - इसका एक उदाहरण बनाएं`Editor` क्लास. इस इंस्टेंस का उपयोग DSV फ़ाइल को लोड करने और उसमें हेरफेर करने के लिए किया जाएगा. + +## चरण 2: Editor इंस्टेंस बनाएं +`Editor` वह मुख्य क्लास है जो लोडिंग, एडिटिंग, और सेविंग को समन्वित करता है। इसे `FileInfo` ऑब्जेक्ट के साथ इंस्टैंशिएट करने से आपको फ़ाइल जीवनचक्र पर पूर्ण नियंत्रण मिलता है। + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## चरण 3: DSV संपादन विकल्प बनाएँ - इसके बाद, इसका एक उदाहरण बनाएं`DelimitedTextEditOptions` और DSV फ़ाइल के लिए सीमांकक निर्दिष्ट करें। यहाँ, हम सीमांकक के रूप में अल्पविराम का उपयोग करते हैं। + +## चरण 3: DSV एडिट विकल्प बनाएं +`DelimitedTextEditOptions` एडिटर को बताता है कि फ़ाइल को कैसे व्याख्यायित किया जाए। आप डिलिमिटर, क्या पहली पंक्ति में हेडर हैं, और कैरेक्टर एन्कोडिंग सेट कर सकते हैं। + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## चरण 4: संपादन योग्य दस्तावेज़ इंस्टेंस बनाएँ - एक बनाएं`EditableDocument` उदाहरण का उपयोग कर`Editor.Edit` यह दस्तावेज़ को संपादन के लिए तैयार करता है। + +## चरण 4: EditableDocument इंस्टेंस बनाएं +`EditableDocument` स्रोत फ़ाइल का एक परिवर्तनीय इन‑मेमोरी संस्करण दर्शाता है। विकल्पों के साथ `Editor.Edit` को कॉल करने से एक `EditableDocument` मिलता है। यह ऑब्जेक्ट फ़ाइल का टेक्स्ट एक परिवर्तनीय स्ट्रिंग में रखता है, जो किसी भी **parse delimited values C#** ऑपरेशन के लिए तैयार है। + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## चरण 5: दस्तावेज़ सामग्री संपादित करें -मूल पाठ सामग्री को पुनः प्राप्त करें और आवश्यक संशोधन करें। प्रदर्शन के उद्देश्य से, आइए कुछ पाठ बदलें। +`GetDocumentText()` संपादन योग्य दस्तावेज़ का वर्तमान टेक्स्ट एक स्ट्रिंग के रूप में लौटाता है। मूल टेक्स्ट को `EditableDocument.GetDocumentText()` के माध्यम से प्राप्त करें, अपने संशोधन करें (जैसे, किसी कॉलम वैल्यू को बदलें), और परिणाम को नई स्ट्रिंग में संग्रहीत करें। यही वह जगह है जहाँ आप **edit CSV .NET** बिना लो‑लेवल फ़ाइल स्ट्रीम को छुए कर सकते हैं। + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## चरण 6: अपडेट की गई सामग्री के साथ संपादन योग्य दस्तावेज़ बनाएँ - कोई नया बनाएं`EditableDocument` अद्यतन सामग्री के साथ. + +## चरण 6: अपडेटेड कंटेंट के साथ EditableDocument बनाएं +संशोधित स्ट्रिंग को फिर से एक `EditableDocument` में रैप करें। यह चरण बदलावों को अंतिम रूप देता है और ऑब्जेक्ट को किसी भी समर्थित फ़ॉर्मेट में सहेजने के लिए तैयार करता है। + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## चरण 7: CSV सहेजें विकल्प बनाएँ -डिलीमीटर और एनकोडिंग सहित CSV प्रारूप के लिए सहेजने के विकल्प निर्दिष्ट करें। + +## चरण 7: CSV सेव ऑप्शन बनाएं +`DelimitedTextSaveOptions` यह निर्धारित करता है कि संपादित कंटेंट को CSV फ़ाइल में कैसे लिखा जाए। जब आप बदलावों को स्थायी बनाना चाहते हैं, तो `DelimitedTextSaveOptions` को कॉन्फ़िगर करें। आप वही डिलिमिटर, कोई अलग डिलिमिटर, या यहाँ तक कि लाइन‑एंडिंग शैली भी बदल सकते हैं। + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## चरण 8: TSV सहेजें विकल्प बनाएँ -इसी प्रकार, TSV प्रारूप के लिए सहेजने के विकल्प निर्दिष्ट करें। + +## चरण 8: TSV सेव ऑप्शन बनाएं +यदि आपको टैब‑सेपरेटेड संस्करण चाहिए, तो बस डिलिमिटर को `\t` में बदल दें। वही `EditableDocument` विभिन्न विकल्पों के साथ कई बार सहेजा जा सकता है। + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## चरण 9: स्प्रेडशीट सहेजें विकल्प बनाएँ -यदि आपको दस्तावेज़ को स्प्रेडशीट के रूप में सहेजना है, तो संगत सहेजें विकल्प बनाएँ। + +## चरण 9: स्प्रेडशीट सेव ऑप्शन बनाएं +`SpreadsheetSaveOptions` दस्तावेज़ को Excel‑compatible फ़ॉर्मेट जैसे .xlsx में एक्सपोर्ट करने की कॉन्फ़िगरेशन करता है। GroupDocs.Editor आपको संपादित डेटा को Excel‑compatible फ़ॉर्मेट (`.xlsx`) में एक्सपोर्ट करने की भी अनुमति देता है। `SpreadsheetSaveOptions` क्लास कॉलम प्रकार, फ़ॉर्मूले, और सेल स्टाइलिंग को स्वचालित रूप से संभालता है। + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## चरण 10: सेव पथ तैयार करें -उन पथों को परिभाषित करें जहां संपादित फ़ाइलें सहेजी जाएंगी. + +## चरण 10: सेव पाथ तैयार करें +प्रत्येक फ़ॉर्मेट के लिए अलग-अलग आउटपुट पाथ निर्धारित करें। स्पष्ट नामकरण परम्पराओं (जैसे, `output.csv`, `output.tsv`, `output.xlsx`) का उपयोग करने से आपका प्रोजेक्ट व्यवस्थित रहता है। + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` + ## चरण 11: संपादित दस्तावेज़ को सहेजें -संपादित दस्तावेज़ को विभिन्न प्रारूपों में निर्दिष्ट पथों पर सहेजें। +`Save()` प्रदान किए गए सेव ऑप्शन्स का उपयोग करके दस्तावेज़ को डिस्क पर लिखता है। प्रत्येक लक्ष्य फ़ॉर्मेट के लिए उपयुक्त ऑप्शन्स के साथ `EditableDocument.Save` को कॉल करें। API फ़ाइल को सीधे डिस्क पर लिखता है, मूल एन्कोडिंग को संरक्षित रखता है जब तक आप इसे ओवरराइड न करें। + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## चरण 12: EditableDocument इंस्टैंस को हटाएँ - अंत में, सुनिश्चित करें कि आप इसका निपटान कर दें`EditableDocument` संसाधनों को मुक्त करने के लिए उदाहरण। + +## चरण 12: EditableDocument इंस्टेंस को डिस्पोज़ करें +`Editor` और `EditableDocument` दोनों `IDisposable` को इम्प्लीमेंट करते हैं। उन्हें डिस्पोज़ करने से फ़ाइल हैंडल और अनमैनेज्ड रिसोर्सेज़ मुक्त होते हैं, जो बैच जॉब में कई फ़ाइलों को प्रोसेस करते समय अत्यंत महत्वपूर्ण है। + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## निष्कर्ष -.NET के लिए GroupDocs.Editor का उपयोग करके DSV फ़ाइलों को संपादित करना एक सीधी प्रक्रिया है जिसमें एक संपादक उदाहरण बनाना, संपादन विकल्प सेट करना, सामग्री को संशोधित करना और परिवर्तनों को सहेजना शामिल है। यह चरण-दर-चरण मार्गदर्शिका आपको इस कार्यक्षमता को अपने .NET अनुप्रयोगों में आसानी से एकीकृत करने में मदद करेगी। चाहे आप CSV, TSV या अन्य DSV प्रारूपों के साथ काम कर रहे हों, .NET के लिए GroupDocs.Editor एक मजबूत और लचीला समाधान प्रदान करता है। + +## सामान्य समस्याएँ और समाधान +| समस्या | क्यों होता है | समाधान | +|-------|----------------|-----| +| **अप्रत्याशित अतिरिक्त कोट्स** | डिफ़ॉल्ट CSV पार्सर एम्बेडेड कॉमा को डिलिमिटर मान सकता है। | `DelimitedTextEditOptions` में `EscapeMode = EscapeMode.DoubleQuote` सेट करें। | +| **बड़ी फ़ाइल में मेमोरी स्पाइक** | स्ट्रीमिंग के बिना 500 MB फ़ाइल लोड करना। | `Editor.Load` को `LoadOptions` के साथ उपयोग करें जो लेज़ी लोडिंग सक्षम करता है। | +| **एन्कोडिंग मिसमैच** | स्रोत फ़ाइल UTF‑16 उपयोग करती है लेकिन विकल्प डिफ़ॉल्ट रूप से UTF‑8 हैं। | सेव ऑप्शन्स में स्पष्ट रूप से `Encoding = Encoding.Unicode` सेट करें। | + ## अक्सर पूछे जाने वाले प्रश्न -### क्या मैं बड़ी CSV फ़ाइलों को संपादित करने के लिए .NET के लिए GroupDocs.Editor का उपयोग कर सकता हूं? -हां, .NET के लिए GroupDocs.Editor बड़ी CSV फ़ाइलों को कुशलतापूर्वक संभालने में सक्षम है। -### क्या .NET के लिए GroupDocs.Editor CSV और TSV के अलावा अन्य DSV प्रारूपों का समर्थन करता है? -हां, यह विभिन्न DSV प्रारूपों का समर्थन करता है, बशर्ते आप उपयुक्त सीमांकक निर्दिष्ट करें। -### क्या DSV फ़ाइलों को सहेजते समय एन्कोडिंग को अनुकूलित करना संभव है? -बिल्कुल, आप सेव विकल्पों में वांछित एनकोडिंग निर्दिष्ट कर सकते हैं। -### क्या मैं .NET के लिए GroupDocs.Editor का उपयोग करके CSV फ़ाइल को Excel स्प्रेडशीट में परिवर्तित कर सकता हूं? -हां, आप उपयुक्त सेव विकल्पों का उपयोग करके CSV फ़ाइल को एक्सेल स्प्रेडशीट के रूप में सेव कर सकते हैं। -### मैं .NET के लिए GroupDocs.Editor पर अधिक दस्तावेज़ कहां पा सकता हूं? - आप विस्तृत दस्तावेज पा सकते हैं[यहाँ](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: क्या मैं GroupDocs.Editor for .NET का उपयोग करके बड़े CSV फ़ाइलों को संपादित कर सकता हूँ?** +A: हाँ, API डेटा को स्ट्रीम करता है और पूरी दस्तावेज़ को मेमोरी में लोड किए बिना 1 GB से बड़ी फ़ाइलों को संभाल सकता है। + +**Q: क्या GroupDocs.Editor for .NET CSV और TSV के अलावा अन्य DSV फ़ॉर्मेट्स को सपोर्ट करता है?** +A: बिलकुल – कोई भी एक‑अक्षर डिलिमिटर (जैसे, पाइप `|`, सेमीकोलन `;`) समर्थित है जब तक आप इसे `DelimitedTextEditOptions` में निर्दिष्ट करें। + +**Q: क्या DSV फ़ाइलें सहेजते समय एन्कोडिंग को कस्टमाइज़ करना संभव है?** +A: हाँ, आप `DelimitedTextSaveOptions` में `Encoding` प्रॉपर्टी को UTF‑8, UTF‑16, ISO‑8859‑1, या किसी भी आवश्यक .NET `Encoding` पर सेट कर सकते हैं। + +**Q: क्या मैं GroupDocs.Editor for .NET का उपयोग करके CSV फ़ाइल को Excel स्प्रेडशीट में कन्वर्ट कर सकता हूँ?** +A: हाँ – संपादन के बाद, बस `SpreadsheetSaveOptions` का उपयोग करके कंटेंट को `.xlsx` वर्कबुक के रूप में एक्सपोर्ट करें। + +**Q: GroupDocs.Editor for .NET पर अधिक दस्तावेज़ीकरण कहाँ मिल सकता है?** +A: विस्तृत API रेफ़रेंसेज़ और कोड सैंपल्स उपलब्ध हैं **[here](https://tutorials.groupdocs.com/editor/net/)**। + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.10 for .NET +**Author:** GroupDocs + +## संबंधित ट्यूटोरियल्स + +- [GroupDocs.Editor .NET के लिए प्लेन टेक्स्ट और DSV दस्तावेज़ संपादन ट्यूटोरियल्स](/editor/net/plain-text-dsv-documents/) +- [प्रभावी CSV दस्तावेज़ संपादन और रूपांतरण के लिए GroupDocs.Editor .NET में महारत हासिल करें](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [.NET में GroupDocs.Editor के साथ दस्तावेज़ लोडिंग में महारत: एक व्यापक गाइड](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hongkong/net/document-processing/work-dsv/_index.md b/content/hongkong/net/document-processing/work-dsv/_index.md index 29e76007..641172fd 100644 --- a/content/hongkong/net/document-processing/work-dsv/_index.md +++ b/content/hongkong/net/document-processing/work-dsv/_index.md @@ -1,23 +1,73 @@ --- -title: 使用分隔分隔值 (DSV) -linktitle: 使用分隔分隔值 (DSV) +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET 從 CSV 與 TSV 檔案 **create editable document** + 物件。本指南亦示範如何在 Visual Studio 中有效率地 **read delimited text C#** 與 **edit CSV .NET**。 +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: 使用分隔值 (DSV) – 建立可編輯文件 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 透過此逐步指南,了解如何使用 GroupDocs.Editor for .NET 編輯 CSV 和 TSV 檔案。輕鬆改進您的 .NET 專案。 -weight: 12 -url: /zh-hant/net/document-processing/work-dsv/ +title: 使用分隔值 (DSV) – 建立可編輯文件 type: docs +url: /zh-hant/net/document-processing/work-dsv/ +weight: 12 --- -# 使用分隔分隔值 (DSV) - -## 介紹 -如果您是使用 CSV 或 TSV 檔案等分隔分隔值 (DSV) 的開發人員,您就會知道以程式方式編輯這些檔案可能是一項艱鉅的任務。然而,使用 GroupDocs.Editor for .NET,這項任務變得更加簡單和有效率。在本教程中,我們將引導您了解如何使用 GroupDocs.Editor for .NET 讀取、編輯和儲存 DSV 檔案。我們將把這個過程分解為易於遵循的步驟,讓您可以在專案中輕鬆實施。 -## 先決條件 -在我們深入學習本教程之前,請確保您具備以下先決條件: -- Visual Studio:確保您的電腦上安裝了 Visual Studio。 -- GroupDocs.Editor for .NET:您需要下載並參考 GroupDocs.Editor for .NET 程式庫。你可以下載它[這裡](https://releases.groupdocs.com/editor/net/). -- 對 C# 的基本了解:本教學假設您對 C# 和 .NET 開發有基本的了解。 -## 導入命名空間 -首先,您需要在專案中匯入必要的命名空間。這些命名空間提供使用 GroupDocs.Editor for .NET 所需的類別和方法。 + +# 使用分隔值 (DSV) – 建立可編輯文件 + +如果您是需要從 CSV 或 TSV 等分隔值 (DSV) **create editable document** 物件的 .NET 開發人員,您來對地方了。在前 100 個字內,我們將說明為什麼 GroupDocs.Editor for .NET 是 **read delimited text C#**、編輯並在不失去格式的情況下重新儲存的最可靠方式。您將獲得一套完整、可直接複製貼上的工作流程,能自然地融入任何 Visual Studio 解決方案。 + +## 快速解答 +- **哪個函式庫在 .NET 中最佳處理 CSV 編輯?** GroupDocs.Editor for .NET. +- **我可以在 Visual Studio 中編輯大型 CSV 檔案嗎?** 可以 – API 以串流方式處理資料,避免將整個檔案載入記憶體。 +- **生產環境需要授權嗎?** 需要商業授權;提供免費試用版。 +- **編輯後可以輸出哪些格式?** CSV、TSV 以及 Excel 相容的試算表格式。 +- **API 是否相容於 .NET 6+?** 完全相容 – 支援 .NET Framework 4.5+、.NET Core 3.1+、.NET 5 以及 .NET 6。 + +## 「create editable document」在 GroupDocs.Editor 中是什麼意思? +**Create editable document** 指的是產生一個 `EditableDocument` 實例,該實例在記憶體中代表來源檔案 (CSV、TSV 等) 的可變版本。此物件讓您能使用相同的 API 讀取、修改並重新儲存內容。它提供取得文件文字、套用變更以及以各種格式儲存的方法,確保欄位對齊與引號保留。 + +## 為什麼要使用 GroupDocs.Editor 處理 DSV? +GroupDocs.Editor 處理 **more than 50 input and output formats**,包括 CSV、TSV 以及 Excel 相容的試算表,同時在處理高達 500 MB 的檔案時記憶體使用量低於 10 MB。它亦會自動保留欄位對齊、引號規則與自訂編碼,免除手動解析的需求。 + +## 前置條件 +- **Visual Studio**(任何近期版本)– 您將直接在 IDE 中開發與除錯。 +- **GroupDocs.Editor for .NET** – 下載最新套件 **[here](https://releases.groupdocs.com/editor/net/)**。 +- **Basic C# knowledge** – 本教學假設您能建立 Console 或 ASP.NET 專案並加入 NuGet 套件。 + +## 匯入命名空間 +`Editor`、`EditableDocument` 與選項類別位於 `GroupDocs.Editor` 命名空間。 + +`DelimitedTextEditOptions` 類別是定義分隔符號(逗號、Tab 等)以及其他解析規則的入口點。 + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +76,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## 第 1 步:取得輸入 DSV 檔案的路徑 -首先,您需要指定輸入 DSV 檔案的路徑。對於此範例,我們假設它是 CSV 檔案。 +## 如何從 CSV 檔案建立 editable document? +使用 `Editor` 載入來源 CSV,然後呼叫 `Edit` 方法,傳入指定逗號分隔符的 `DelimitedTextEditOptions` 實例。此方法會回傳可在記憶體中操作的 `EditableDocument`。這個「載入 → 編輯」的兩步驟模式涵蓋 **read delimited text C#** 情境,並保證原始檔案結構不變。 + +## 步驟 1:取得輸入 DSV 檔案的路徑 +首先,需要指定來源 DSV 檔案的絕對或相對路徑。為示範起見,我們使用專案 `Data` 資料夾中的簡易 CSV。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 步驟2:建立編輯器實例 -建立一個實例`Editor`班級。該實例將用於載入和操作 DSV 檔案。 + +## 步驟 2:建立 Editor 實例 +`Editor` 是負責載入、編輯與儲存的核心類別。以 `FileInfo` 物件實例化它,即可完整掌控檔案生命週期。 + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## 第 3 步:建立 DSV 編輯選項 -接下來,建立一個實例`DelimitedTextEditOptions`並指定 DSV 檔案的分隔符號。在這裡,我們使用逗號作為分隔符號。 + +## 步驟 3:建立 DSV 編輯選項 +`DelimitedTextEditOptions` 告訴編輯器如何解讀檔案。您可以設定分隔符號、首列是否為標頭,以及字元編碼。 + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## 步驟 4:建立一個 EditableDocument 實例 -創建一個`EditableDocument`實例使用`Editor.Edit`方法。這將為編輯文件做好準備。 + +## 步驟 4:建立 EditableDocument 實例 +`EditableDocument` 代表來源檔案在記憶體中的可變版本。呼叫 `Editor.Edit` 並傳入選項,即可取得 `EditableDocument`。此物件以可變字串保存檔案文字,隨時可執行 **parse delimited values C#** 操作。 + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## 步驟5:編輯文檔內容 -檢索原始文字內容並進行必要的修改。出於演示目的,讓我們替換一些文字。 + +## 步驟 5:編輯文件內容 +`GetDocumentText()` 會回傳可編輯文件目前的文字字串。透過 `EditableDocument.GetDocumentText()` 取得原始文字後,執行修改(例如替換某欄位值),並將結果存入新字串。這就是 **edit CSV .NET**、不必觸碰低階檔案串流的地方。 + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## 步驟 6:建立包含更新內容的 EditableDocument -創建一個新的`EditableDocument`與更新的內容。 + +## 步驟 6:以更新後的內容建立 EditableDocument +將修改過的字串重新包裝成 `EditableDocument`。此步驟完成變更,並為之後的任意支援格式儲存做好準備。 + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## 第 7 步:建立 CSV 儲存選項 -指定 CSV 格式的儲存選項,包括分隔符號和編碼。 + +## 步驟 7:建立 CSV 儲存選項 +`DelimitedTextSaveOptions` 定義如何將編輯後的內容寫回 CSV 檔案。當您準備好持久化變更時,設定 `DelimitedTextSaveOptions`,可指定相同或不同的分隔符,甚至變更換行樣式。 + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 第 8 步:建立 TSV 儲存選項 -同樣,指定 TSV 格式的儲存選項。 + +## 步驟 8:建立 TSV 儲存選項 +若需要 Tab 分隔的版本,只需將分隔符切換為 `\t`。同一個 `EditableDocument` 可使用不同選項多次儲存。 + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 第 9 步:建立電子表格儲存選項 -如果需要將文件儲存為電子表格,請建立對應的儲存選項。 + +## 步驟 9:建立試算表儲存選項 +`SpreadsheetSaveOptions` 設定將文件匯出為 Excel 相容格式(如 .xlsx)。GroupDocs.Editor 亦允許您以 `SpreadsheetSaveOptions` 匯出編輯後的資料為 `.xlsx`。此類別會自動處理欄位類型、公式與儲存格樣式。 + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## 第10步:準備保存路徑 -定義編輯文件的儲存路徑。 + +## 步驟 10:準備儲存路徑 +為每種格式定義不同的輸出路徑。使用清晰的命名慣例(例如 `output.csv`、`output.tsv`、`output.xlsx`)有助於保持專案井然有序。 + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## 第11步:儲存編輯後的文檔 -將編輯後的文件以不同格式儲存到指定路徑。 + +## 步驟 11:儲存編輯後的文件 +`Save()` 會依照提供的儲存選項將文件寫入磁碟。對每個目標格式呼叫 `EditableDocument.Save` 並傳入相應選項。API 直接寫入檔案,除非您另行指定,否則會保留原始編碼。 + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## 第 12 步:處置 EditableDocument 實例 -最後,請務必處理掉`EditableDocument`實例以釋放資源。 + +## 步驟 12:釋放 EditableDocument 實例 +`Editor` 與 `EditableDocument` 皆實作 `IDisposable`。釋放它們可關閉檔案句柄與非受控資源,這在批次處理大量檔案時尤為重要。 + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## 結論 -使用 GroupDocs.Editor for .NET 編輯 DSV 檔案是一個簡單的過程,涉及建立編輯器實例、設定編輯選項、修改內容和儲存變更。本逐步指南應可協助您輕鬆將此功能整合到您的 .NET 應用程式中。無論您使用的是 CSV、TSV 或其他 DSV 格式,GroupDocs.Editor for .NET 都能提供強大且靈活的解決方案。 -## 常見問題解答 -### 我可以使用 GroupDocs.Editor for .NET 編輯大型 CSV 檔案嗎? -是的,GroupDocs.Editor for .NET 能夠有效處理大型 CSV 檔案。 -### 除 CSV 和 TSV 之外,GroupDocs.Editor for .NET 是否支援其他 DSV 格式? -是的,只要指定適當的分隔符,它就支援各種 DSV 格式。 -### 儲存DSV檔案時可以自訂編碼嗎? -當然,您可以在儲存選項中指定所需的編碼。 -### 我可以使用 GroupDocs.Editor for .NET 將 CSV 檔案轉換為 Excel 電子表格嗎? -是的,您可以使用適當的儲存選項將 CSV 檔案儲存為 Excel 電子表格。 -### 在哪裡可以找到更多關於 GroupDocs.Editor for .NET 的文件? -你可以找到詳細的文檔[這裡](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## 常見問題與解決方案 +| 問題 | 發生原因 | 解決方案 | +|------|----------|----------| +| **Unexpected extra quotes** | 預設的 CSV 解析器可能將內嵌的逗號視為分隔符。 | 在 `DelimitedTextEditOptions` 中設定 `EscapeMode = EscapeMode.DoubleQuote`。 | +| **Large file memory spike** | 未使用串流直接載入 500 MB 檔案。 | 使用 `Editor.Load` 搭配啟用延遲載入的 `LoadOptions`。 | +| **Encoding mismatch** | 原始檔案為 UTF‑16,但選項預設為 UTF‑8。 | 在儲存選項中明確設定 `Encoding = Encoding.Unicode`。 | + +## 常見問答 + +**Q: 我可以使用 GroupDocs.Editor for .NET 編輯大型 CSV 檔案嗎?** +A: 可以,API 以串流方式處理資料,能在不將整個文件載入記憶體的情況下處理超過 1 GB 的檔案。 + +**Q: GroupDocs.Editor for .NET 是否支援除 CSV 與 TSV 之外的其他 DSV 格式?** +A: 當然支援 – 只要在 `DelimitedTextEditOptions` 中指定任意單一字元分隔符(例如管道 `|`、分號 `;`),皆可使用。 + +**Q: 儲存 DSV 檔案時可以自訂編碼嗎?** +A: 可以,您可在 `DelimitedTextSaveOptions` 中設定 `Encoding` 屬性為 UTF‑8、UTF‑16、ISO‑8859‑1 或任何 .NET `Encoding`。 + +**Q: 我能將 CSV 檔案轉換為 Excel 試算表嗎?** +A: 可以 – 編輯完成後,只需使用 `SpreadsheetSaveOptions` 即可匯出為 `.xlsx` 工作簿。 + +**Q: 哪裡可以找到更多關於 GroupDocs.Editor for .NET 的文件?** +A: 詳細的 API 參考與程式碼範例可於 **[here](https://tutorials.groupdocs.com/editor/net/)** 取得。 + +--- + +**最後更新:** 2026-06-06 +**測試環境:** GroupDocs.Editor 23.10 for .NET +**作者:** GroupDocs + +## 相關教學 + +- [Plain Text and DSV 文件編輯教學(適用於 GroupDocs.Editor .NET)](/editor/net/plain-text-dsv-documents/) +- [精通 GroupDocs.Editor .NET 以高效 CSV 文件編輯與轉換](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [精通 .NET 中的文件載入:使用 GroupDocs.Editor 的完整指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hungarian/net/document-processing/work-dsv/_index.md b/content/hungarian/net/document-processing/work-dsv/_index.md index 1b90ab6d..9fc97977 100644 --- a/content/hungarian/net/document-processing/work-dsv/_index.md +++ b/content/hungarian/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Munka elválasztott értékekkel (DSV) -linktitle: Munka elválasztott értékekkel (DSV) +date: 2026-06-06 +description: Ismerje meg, hogyan hozhat **create editable document** objektumokat + CSV és TSV fájlokból a GroupDocs.Editor for .NET használatával. Ez az útmutató bemutatja, + hogyan lehet **read delimited text C#** és **edit CSV .NET** hatékonyan a Visual Studio-ban. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Dolgozzon a határolt elválasztott értékekkel (DSV) – szerkeszthető dokumentum + létrehozása +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Ebből a lépésről lépésre szóló útmutatóból megtudhatja, hogyan szerkeszthet CSV- és TSV-fájlokat a GroupDocs.Editor for .NET használatával. Javítsa .NET-projektjeit könnyedén. -weight: 12 -url: /hu/net/document-processing/work-dsv/ +title: Dolgozzon a határolt elválasztott értékekkel (DSV) – szerkeszthető dokumentum + létrehozása type: docs +url: /hu/net/document-processing/work-dsv/ +weight: 12 --- -# Munka elválasztott értékekkel (DSV) -## Bevezetés -Ha Ön olyan fejlesztő, aki elválasztott értékekkel (DSV), például CSV- vagy TSV-fájlokkal dolgozik, tudja, hogy ezeknek a fájloknak a programozott szerkesztése ijesztő feladat lehet. A GroupDocs.Editor for .NET segítségével azonban ez a feladat lényegesen egyszerűbbé és hatékonyabbá válik. Ebben az oktatóanyagban végigvezetjük, hogyan használhatja a GroupDocs.Editor for .NET programot DSV-fájlok olvasásához, szerkesztéséhez és mentéséhez. A folyamatot könnyen követhető lépésekre bontjuk, így Ön könnyen megvalósíthatja projektjeit. +# Munkavégzés elválasztott értékekkel (DSV) – szerkeszthető dokumentum létrehozása + +Ha .NET fejlesztő vagy, akinek **create editable document** objektumokat kell létrehoznia elválasztott értékekből (DSV), például CSV vagy TSV, jó helyen jár. Az első 100 szóban elmagyarázzuk, miért a GroupDocs.Editor for .NET a legmegbízhatóbb módja a **read delimited text C#** elolvasásának, szerkesztésének, majd vissza mentésének formázás elvesztése nélkül. Egy teljes, másolás‑beillesztésre kész munkafolyamatot kapsz, amely természetesen illeszkedik bármely Visual Studio megoldáshoz. + +## Gyors válaszok +- **Melyik könyvtár kezeli a CSV szerkesztését a legjobban .NET‑ben?** GroupDocs.Editor for .NET. +- **Szerkeszthetek nagy CSV fájlokat Visual Studio‑ban?** Igen – az API adatfolyamot használ, és elkerüli a teljes fájl memóriába töltését. +- **Szükség van licencre a termelésben való használathoz?** Kereskedelmi licenc szükséges; ingyenes próba elérhető. +- **Milyen formátumokba exportálhatok a szerkesztés után?** CSV, TSV és Excel‑kompatibilis táblázatformátumok. +- **Az API kompatibilis a .NET 6+ verzióval?** Teljesen – támogatja a .NET Framework 4.5+, .NET Core 3.1+, .NET 5 és .NET 6 verziókat. + +## Mi az a „create editable document” a GroupDocs.Editor kontextusában? +**Create editable document** azt jelenti, hogy egy `EditableDocument` példányt hozunk létre, amely a forrásfájl (CSV, TSV stb.) memóriában tárolt, módosítható verzióját képviseli. Ez az objektum lehetővé teszi a tartalom olvasását, módosítását és újbóli mentését ugyanazzal az API‑val. Metódusokat biztosít a dokumentum szövegének lekérésére, változtatások alkalmazására és különböző formátumokba való mentésre, biztosítva, hogy az oszlopok igazítása és az idézőjelek megmaradjanak. + +## Miért használjuk a GroupDocs.Editor‑t DSV kezeléshez? +A GroupDocs.Editor **több mint 50 bemeneti és kimeneti formátumot** támogat, köztük a CSV‑t, TSV‑t és Excel‑kompatibilis táblázatokat, miközben a memóriahasználatot 10 MB alatt tartja akár 500 MB‑os fájlok esetén is. Automatikusan megőrzi az oszlopok igazítását, az idézőjelek szabályait és az egyedi kódolásokat, ezáltal kiküszöbölve a manuális feldolgozási logikára való szükségletet. + ## Előfeltételek -Mielőtt belevágnánk az oktatóanyagba, győződjön meg arról, hogy rendelkezik a következő előfeltételekkel: -- Visual Studio: Győződjön meg arról, hogy a Visual Studio telepítve van a gépen. -- GroupDocs.Editor for .NET: Le kell töltenie és hivatkoznia kell a GroupDocs.Editor for .NET könyvtárra. Letöltheti[itt](https://releases.groupdocs.com/editor/net/). -- C# alapvető ismerete: Ez az oktatóanyag feltételezi, hogy rendelkezik a C# és a .NET fejlesztés alapvető ismereteivel. +- **Visual Studio** (bármely friss kiadás) – közvetlenül az IDE‑ben fejleszthetsz és hibakereshetsz. +- **GroupDocs.Editor for .NET** – töltsd le a legújabb csomagot **[itt](https://releases.groupdocs.com/editor/net/)**. +- **Alapvető C# ismeretek** – a bemutató feltételezi, hogy tudsz konzol‑ vagy ASP.NET‑projektet létrehozni és NuGet csomagokat hozzáadni. + ## Névterek importálása -Először is importálnia kell a szükséges névtereket a projektbe. Ezek a névterek biztosítják a GroupDocs.Editor for .NET használatához szükséges osztályokat és metódusokat. +Az `Editor`, `EditableDocument` és a kapcsolódó opcióosztályok a `GroupDocs.Editor` névtérben találhatók. + +A `DelimitedTextEditOptions` osztály a belépési pont a határoló (vessző, tabulátor stb.) és egyéb elemzési szabályok meghatározásához. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## 1. lépés: Szerezze meg a bemeneti DSV-fájl elérési útját -Először is meg kell adnia a bemeneti DSV-fájl elérési útját. Ebben a példában feltételezzük, hogy ez egy CSV-fájl. +## Hogyan hozzunk létre szerkeszthető dokumentumot CSV fájlból? +Töltsd be a forrás CSV‑t az `Editor`‑rel, majd hívd meg az `Edit` metódust, egy `DelimitedTextEditOptions` példányt átadva, amely vessző határolót ad meg. A metódus egy `EditableDocument`‑et ad vissza, amelyet memóriában manipulálhatsz. Ez a kétlépéses minta – betöltés → szerkesztés – lefedi a **read delimited text C#** forgatókönyveket, és garantálja, hogy az eredeti fájlstruktúra megmaradjon. + +## 1. lépés: Szerezzünk útvonalat a bemeneti DSV fájlhoz +Először meg kell adnod a forrás DSV fájl abszolút vagy relatív útvonalát. Bemutatásként egy egyszerű CSV‑t használunk, amely a projekt `Data` mappájában található. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. lépés: Hozzon létre egy szerkesztőpéldányt - Hozzon létre egy példányt a`Editor` osztály. Ez a példány a DSV-fájl betöltésére és kezelésére szolgál. + +## 2. lépés: Hozzunk létre egy Editor példányt +Az `Editor` a központi osztály, amely a betöltést, szerkesztést és mentést koordinálja. Egy `FileInfo` objektummal példányosítva teljes irányítást kapsz a fájl életciklusa felett. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## 3. lépés: Hozzon létre DSV szerkesztési beállításokat - Ezután hozzon létre egy példányt a`DelimitedTextEditOptions` és adja meg a DSV-fájl határolóját. Itt vesszőt használunk elválasztóként. + +## 3. lépés: Hozzunk létre DSV szerkesztési beállításokat +A `DelimitedTextEditOptions` megmondja az editornak, hogyan értelmezze a fájlt. Beállíthatod a határolót, hogy az első sor tartalmazza‑e a fejléceket, valamint a karakterkódolást. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## 4. lépés: Hozzon létre egy EditableDocument példányt - Hozzon létre egy`EditableDocument` például a`Editor.Edit` módszer. Ez előkészíti a dokumentumot szerkesztésre. + +## 4. lépés: Hozzunk létre EditableDocument példányt +Az `EditableDocument` a forrásfájl memóriában tárolt, módosítható verzióját képviseli. Az `Editor.Edit` meghívása a beállításokkal egy `EditableDocument`‑et ad vissza. Ez az objektum a fájl szövegét egy módosítható stringben tárolja, készen állva bármely **parse delimited values C#** műveletre. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## 5. lépés: Szerkessze a dokumentum tartalmát -Keresse ki az eredeti szöveges tartalmat, és végezze el a szükséges módosításokat. Bemutatás céljából cseréljünk ki néhány szöveget. + +## 5. lépés: Szerkesszük a dokumentum tartalmát +A `GetDocumentText()` visszaadja a szerkeszthető dokumentum aktuális szövegét stringként. Szerezd meg az eredeti szöveget a `EditableDocument.GetDocumentText()`‑vel, végezd el a módosításokat (pl. egy oszlopérték cseréje), és tárold az eredményt egy új stringben. Itt tudod **edit CSV .NET**‑et használni anélkül, hogy alacsony szintű fájlfolyamokat érintenél. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## 6. lépés: Hozzon létre egy szerkeszthető dokumentumot frissített tartalommal - Újat csinálni`EditableDocument` a frissített tartalommal. + +## 6. lépés: Hozzunk létre egy EditableDocument‑ot frissített tartalommal +A módosított stringet csomagold vissza egy `EditableDocument`‑ba. Ez a lépés véglegesíti a változtatásokat, és előkészíti az objektumot a bármely támogatott formátumba való mentéshez. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## 7. lépés: Hozzon létre CSV mentési beállításokat -Adja meg a CSV formátum mentési beállításait, beleértve a határolót és a kódolást. + +## 7. lépés: Hozzunk létre CSV mentési beállításokat +A `DelimitedTextSaveOptions` határozza meg, hogyan írjuk vissza a szerkesztett tartalmat egy CSV fájlba. Amikor készen állsz a változások mentésére, konfiguráld a `DelimitedTextSaveOptions`‑t. Megadhatod ugyanazt a határolót, egy másikat, vagy akár megváltoztathatod a sorvége stílusát is. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 8. lépés: Hozzon létre TSV mentési beállításokat -Hasonlóképpen adja meg a TSV formátum mentési beállításait. + +## 8. lépés: Hozzunk létre TSV mentési beállításokat +Ha tabulátorral elválasztott változatra van szükséged, egyszerűen állítsd a határolót `\t`‑re. Ugyanaz a `EditableDocument` többször is menthető különböző beállításokkal. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 9. lépés: Hozzon létre Táblázat mentési opciókat -Ha a dokumentumot táblázatként kell mentenie, hozza létre a megfelelő mentési beállításokat. + +## 9. lépés: Hozzunk létre táblázat mentési beállításokat +A `SpreadsheetSaveOptions` beállítja a dokumentum exportálását Excel‑kompatibilis formátumokba, például .xlsx‑be. A GroupDocs.Editor lehetővé teszi a szerkesztett adatok Excel‑kompatibilis formátumba (`.xlsx`) való exportálását is. A `SpreadsheetSaveOptions` osztály automatikusan kezeli az oszloptípusokat, képleteket és a cellastílusokat. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## 10. lépés: Készítse elő a mentési útvonalakat -Határozza meg a szerkesztett fájlok mentési útvonalait. + +## 10. lépés: Készítsük elő a mentési útvonalakat +Határozd meg a különböző formátumokhoz tartozó kimeneti útvonalakat. A világos elnevezési konvenciók (pl. `output.csv`, `output.tsv`, `output.xlsx`) segítenek a projekt rendezett tartásában. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## 11. lépés: Mentse el a szerkesztett dokumentumot -Mentse el a szerkesztett dokumentumot a megadott útvonalakra különböző formátumokban. + +## 11. lépés: Mentsük a szerkesztett dokumentumot +A `Save()` a megadott mentési beállításokkal írja a dokumentumot a lemezre. Hívd meg az `EditableDocument.Save`‑t a megfelelő opciókkal minden célformátumhoz. Az API közvetlenül a lemezre írja a fájlt, megőrizve az eredeti kódolást, hacsak nem módosítod azt. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## 12. lépés: Dobja ki az EditableDocument Példányokat - Végül mindenképpen dobja ki a`EditableDocument` példányokat az erőforrások felszabadítására. + +## 12. lépés: Az EditableDocument példányok felszabadítása +Mind az `Editor`, mind az `EditableDocument` implementálja az `IDisposable` interfészt. A felszabadításuk felszabadítja a fájlkezelőket és a nem kezelt erőforrásokat, ami kulcsfontosságú sok fájl batch feldolgozásakor. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Következtetés -DSV-fájlok szerkesztése a GroupDocs.Editor for .NET használatával egy egyszerű folyamat, amely magában foglalja egy szerkesztőpéldány létrehozását, a szerkesztési beállítások megadását, a tartalom módosítását és a módosítások mentését. Ez a lépésenkénti útmutató segít abban, hogy ezt a funkciót könnyedén integrálja .NET-alkalmazásaiba. Akár CSV-vel, TSV-vel vagy más DSV-formátummal dolgozik, a GroupDocs.Editor for .NET robusztus és rugalmas megoldást kínál. -## GYIK -### Használhatom a GroupDocs.Editor for .NET programot nagy CSV-fájlok szerkesztéséhez? -Igen, a GroupDocs.Editor for .NET képes hatékonyan kezelni a nagy CSV-fájlokat. -### A GroupDocs.Editor for .NET támogatja a CSV-n és a TSV-n kívül más DSV-formátumokat is? -Igen, támogatja a különböző DSV formátumokat mindaddig, amíg megadja a megfelelő határolót. -### Testreszabható a kódolás DSV fájlok mentésekor? -Természetesen a kívánt kódolást megadhatja a mentési beállításokban. -### Átalakíthatok egy CSV-fájlt Excel-táblázattá a GroupDocs.Editor for .NET segítségével? -Igen, a megfelelő mentési beállítások használatával elmenthet egy CSV-fájlt Excel-táblázatként. -### Hol találok további dokumentációt a GroupDocs.Editor for .NET-hez? - Részletes dokumentációt találhat[itt](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Gyakori problémák és megoldások +| Probléma | Miért fordul elő | Megoldás | +|----------|------------------|----------| +| **Váratlan extra idézőjelek** | Az alapértelmezett CSV elemző beágyazott vesszőket is elválasztóként kezelhet. | Állítsa be `EscapeMode = EscapeMode.DoubleQuote` a `DelimitedTextEditOptions`‑ban. | +| **Nagy fájl memóriaugrás** | 500 MB fájl betöltése streaming nélkül. | Használja az `Editor.Load`‑t `LoadOptions`‑szel, amely engedélyezi a lusta betöltést. | +| **Kódolási eltérés** | A forrásfájl UTF‑16‑ot használ, de a beállítások alapértelmezés szerint UTF‑8-at. | Kifejezetten állítsa be `Encoding = Encoding.Unicode` a mentési beállításokban. | + +## Gyakran feltett kérdések + +**Q: Használhatom a GroupDocs.Editor for .NET‑et nagy CSV fájlok szerkesztésére?** +A: Igen, az API adatfolyamot használ, és 1 GB‑nál nagyobb fájlokat is kezel anélkül, hogy a teljes dokumentumot memóriába töltené. + +**Q: A GroupDocs.Editor for .NET támogat más DSV formátumokat is a CSV‑n és TSV‑n kívül?** +A: Teljesen – bármely egykarakteres határoló (pl. `|`, `;`) támogatott, amennyiben a `DelimitedTextEditOptions`‑ban megadod. + +**Q: Lehet testre szabni a kódolást DSV fájlok mentésekor?** +A: Igen, beállíthatod az `Encoding` tulajdonságot a `DelimitedTextSaveOptions`‑ban UTF‑8, UTF‑16, ISO‑8859‑1 vagy bármely .NET `Encoding` értékre, amelyre szükséged van. + +**Q: Átalakíthatom-e a CSV fájlt Excel táblázattá a GroupDocs.Editor for .NET‑el?** +A: Igen – a szerkesztés után egyszerűen használd a `SpreadsheetSaveOptions`‑t a tartalom `.xlsx` munkafüzetként való exportálásához. + +**Q: Hol találok további dokumentációt a GroupDocs.Editor for .NET‑ről?** +A: Részletes API‑referenciák és kódminták érhetők el **[itt](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Utolsó frissítés:** 2026-06-06 +**Tesztelve ezzel:** GroupDocs.Editor 23.10 for .NET +**Szerző:** GroupDocs + +## Kapcsolódó oktatóanyagok + +- [Plain Text and DSV Document Editing Tutorials for GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Master GroupDocs.Editor .NET for Efficient CSV Document Editing and Conversion](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/indonesian/net/document-processing/work-dsv/_index.md b/content/indonesian/net/document-processing/work-dsv/_index.md index 9721dfe7..dabe976b 100644 --- a/content/indonesian/net/document-processing/work-dsv/_index.md +++ b/content/indonesian/net/document-processing/work-dsv/_index.md @@ -1,23 +1,77 @@ --- -title: Bekerja dengan Nilai Terpisah yang Dibatasi (DSV) -linktitle: Bekerja dengan Nilai Terpisah yang Dibatasi (DSV) +date: 2026-06-06 +description: Pelajari cara **membuat dokumen yang dapat diedit** dari file CSV dan + TSV menggunakan GroupDocs.Editor untuk .NET. Panduan ini juga menunjukkan cara **membaca + teks terdelimit C#** dan **mengedit CSV .NET** secara efisien di Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Bekerja dengan Nilai Terpisah Delimited (DSV) – buat dokumen yang dapat + diedit +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Pelajari cara mengedit file CSV dan TSV menggunakan GroupDocs.Editor untuk .NET dengan panduan langkah demi langkah ini. Tingkatkan proyek .NET Anda dengan mudah. -weight: 12 -url: /id/net/document-processing/work-dsv/ +title: Bekerja dengan Nilai Terpisah Delimited (DSV) – buat dokumen yang dapat diedit type: docs +url: /id/net/document-processing/work-dsv/ +weight: 12 --- -# Bekerja dengan Nilai Terpisah yang Dibatasi (DSV) -## Perkenalan -Jika Anda seorang pengembang yang bekerja dengan nilai-nilai terpisah yang dibatasi (DSV) seperti file CSV atau TSV, Anda tahu bahwa mengedit file-file ini secara terprogram dapat menjadi tugas yang menakutkan. Namun, dengan GroupDocs.Editor untuk .NET, tugas ini menjadi jauh lebih sederhana dan efisien. Dalam tutorial ini, kami akan memandu Anda tentang cara menggunakan GroupDocs.Editor untuk .NET untuk membaca, mengedit, dan menyimpan file DSV. Kami akan membagi prosesnya menjadi langkah-langkah yang mudah diikuti, sehingga memudahkan Anda menerapkannya dalam proyek Anda. +# Bekerja dengan Nilai Terpisah Delimited (DSV) – buat dokumen yang dapat diedit + +Jika Anda seorang pengembang .NET yang perlu **create editable document** objek dari nilai terpisah delimited (DSV) seperti CSV atau TSV, Anda berada di tempat yang tepat. Dalam 100 kata pertama kami akan menjelaskan mengapa GroupDocs.Editor untuk .NET adalah cara paling andal untuk **read delimited text C#**, mengeditnya, dan kemudian menyimpannya kembali tanpa kehilangan format. Anda akan mendapatkan alur kerja lengkap yang siap disalin‑tempel dan cocok secara alami dalam solusi Visual Studio apa pun. + +## Jawaban Cepat +- **Library mana yang menangani penyuntingan CSV terbaik di .NET?** GroupDocs.Editor for .NET. +- **Bisakah saya menyunting file CSV besar di Visual Studio?** Ya – API mem-stream data dan menghindari memuat seluruh file ke memori. +- **Apakah saya memerlukan lisensi untuk penggunaan produksi?** Lisensi komersial diperlukan; percobaan gratis tersedia. +- **Format apa yang dapat saya hasilkan setelah penyuntingan?** CSV, TSV, dan format spreadsheet yang kompatibel dengan Excel. +- **Apakah API kompatibel dengan .NET 6+?** Tentu – mendukung .NET Framework 4.5+, .NET Core 3.1+, .NET 5, dan .NET 6. + +## Apa itu “create editable document” dalam konteks GroupDocs.Editor? +**Create editable document** berarti menghasilkan sebuah instance `EditableDocument` yang mewakili versi yang dapat diubah dari file sumber (CSV, TSV, dll.) dalam memori. Objek ini memungkinkan Anda membaca, memodifikasi, dan menyimpan kembali konten menggunakan API yang sama. Ia menyediakan metode untuk mengambil teks dokumen, menerapkan perubahan, dan menyimpannya kembali dalam berbagai format, memastikan bahwa penjajaran kolom dan kutipan tetap terjaga. + +## Mengapa menggunakan GroupDocs.Editor untuk penanganan DSV? +GroupDocs.Editor memproses **lebih dari 50 format input dan output**, termasuk CSV, TSV, dan spreadsheet yang kompatibel dengan Excel, sambil menjaga penggunaan memori di bawah 10 MB untuk file hingga 500 MB. Ia juga secara otomatis mempertahankan penjajaran kolom, aturan kutipan, dan enkoding khusus, yang menghilangkan kebutuhan akan logika parsing manual. + ## Prasyarat -Sebelum kita masuk ke tutorialnya, pastikan Anda memiliki prasyarat berikut: -- Visual Studio: Pastikan Anda telah menginstal Visual Studio di mesin Anda. -- GroupDocs.Editor untuk .NET: Anda perlu mengunduh dan mereferensikan perpustakaan GroupDocs.Editor untuk .NET. Anda dapat mengunduhnya[Di Sini](https://releases.groupdocs.com/editor/net/). -- Pemahaman Dasar C#: Tutorial ini mengasumsikan Anda memiliki pemahaman dasar tentang pengembangan C# dan .NET. +Sebelum kita mulai, pastikan Anda telah menginstal hal berikut: + +- **Visual Studio** (edisi terbaru apa pun) – Anda akan mengembangkan dan men-debug langsung di dalam IDE. +- **GroupDocs.Editor for .NET** – unduh paket terbaru **[here](https://releases.groupdocs.com/editor/net/)**. +- **Pengetahuan dasar C#** – tutorial mengasumsikan Anda dapat membuat proyek console atau ASP.NET dan menambahkan paket NuGet. + ## Impor Namespace -Pertama, Anda perlu mengimpor namespace yang diperlukan dalam proyek Anda. Namespace ini menyediakan kelas dan metode yang diperlukan untuk bekerja dengan GroupDocs.Editor untuk .NET. +Kelas `Editor`, `EditableDocument`, dan kelas opsi berada di namespace `GroupDocs.Editor`. + +Kelas `DelimitedTextEditOptions` adalah titik masuk untuk mendefinisikan pemisah (koma, tab, dll.) dan aturan parsing lainnya. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +80,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Langkah 1: Dapatkan Jalur ke File Input DSV -Pertama, Anda perlu menentukan jalur ke file input DSV. Untuk contoh ini, kami berasumsi itu adalah file CSV. +## Cara membuat dokumen yang dapat diedit dari file CSV? +Muat CSV sumber dengan `Editor` dan panggil metode `Edit`, dengan memberikan instance `DelimitedTextEditOptions` yang menentukan pemisah koma. Metode ini mengembalikan sebuah `EditableDocument` yang dapat Anda manipulasi di memori. Pola dua langkah ini—load → edit—mencakup skenario **read delimited text C#** dan menjamin struktur file asli tetap dipertahankan. + +## Langkah 1: Dapatkan Jalur ke File DSV Input +Pertama, Anda perlu menentukan jalur absolut atau relatif ke file DSV sumber. Untuk demonstrasi kami akan menggunakan CSV sederhana yang terletak di folder `Data` proyek. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Langkah 2: Buat Mesin Virtual Editor - Buat sebuah instance dari`Editor` kelas. Contoh ini akan digunakan untuk memuat dan memanipulasi file DSV. + +## Langkah 2: Buat Instance Editor +`Editor` adalah kelas inti yang mengatur pemuatan, penyuntingan, dan penyimpanan. Menginstansiasinya dengan objek `FileInfo` memberi Anda kontrol penuh atas siklus hidup file. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Langkah 3: Buat Opsi Edit DSV - Selanjutnya, buat sebuah instance dari`DelimitedTextEditOptions` dan tentukan pembatas untuk file DSV. Di sini, kami menggunakan koma sebagai pembatas. + +## Langkah 3: Buat Opsi Penyuntingan DSV +`DelimitedTextEditOptions` memberi tahu editor cara menafsirkan file. Anda dapat mengatur pemisah, apakah baris pertama berisi header, dan enkoding karakter. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Langkah 4: Buat Instans EditableDocument - Buat sebuah`EditableDocument` misalnya menggunakan`Editor.Edit` metode. Ini mempersiapkan dokumen untuk diedit. + +## Langkah 4: Buat Instance EditableDocument +`EditableDocument` mewakili versi dalam memori yang dapat diubah dari file sumber. Memanggil `Editor.Edit` dengan opsi tersebut mengembalikan sebuah `EditableDocument`. Objek ini menyimpan teks file dalam string yang dapat diubah, siap untuk operasi **parse delimited values C#** apa pun yang Anda butuhkan. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## Langkah 5: Edit Konten Dokumen -Ambil konten teks asli dan lakukan modifikasi yang diperlukan. Untuk tujuan demonstrasi, mari ganti beberapa teks. +`GetDocumentText()` mengembalikan teks saat ini dari dokumen yang dapat diedit sebagai string. Ambil teks asli melalui `EditableDocument.GetDocumentText()`, lakukan modifikasi Anda (mis., mengganti nilai kolom), dan simpan hasilnya dalam string baru. Di sinilah Anda **edit CSV .NET** tanpa menyentuh aliran file tingkat rendah. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Langkah 6: Buat Dokumen yang Dapat Diedit dengan Konten yang Diperbarui - Buat yang baru`EditableDocument` dengan konten yang diperbarui. + +## Langkah 6: Buat EditableDocument dengan Konten yang Diperbarui +Bungkus string yang telah dimodifikasi kembali ke dalam `EditableDocument`. Langkah ini menyelesaikan perubahan dan menyiapkan objek untuk disimpan dalam format apa pun yang didukung. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` + ## Langkah 7: Buat Opsi Penyimpanan CSV -Tentukan opsi penyimpanan untuk format CSV, termasuk pembatas dan pengkodean. +`DelimitedTextSaveOptions` menentukan cara menulis konten yang telah diedit kembali ke file CSV. Saat Anda siap menyimpan perubahan, konfigurasikan `DelimitedTextSaveOptions`. Anda dapat menentukan pemisah yang sama, yang berbeda, atau bahkan mengubah gaya akhir baris. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## Langkah 8: Buat Opsi Penyimpanan TSV -Demikian pula, tentukan opsi penyimpanan untuk format TSV. +Jika Anda membutuhkan versi dipisahkan tab, cukup ubah pemisah menjadi `\t`. `EditableDocument` yang sama dapat disimpan berkali-kali dengan opsi yang berbeda. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## Langkah 9: Buat Opsi Penyimpanan Spreadsheet -Jika Anda perlu menyimpan dokumen sebagai spreadsheet, buat opsi penyimpanan yang sesuai. +`SpreadsheetSaveOptions` mengonfigurasi ekspor dokumen ke format yang kompatibel dengan Excel seperti .xlsx. GroupDocs.Editor juga memungkinkan Anda mengekspor data yang telah diedit ke format yang kompatibel dengan Excel (`.xlsx`). Kelas `SpreadsheetSaveOptions` menangani tipe kolom, formula, dan gaya sel secara otomatis. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Langkah 10: Siapkan Jalur Simpan -Tentukan jalur penyimpanan file yang diedit. + +## Langkah 10: Siapkan Jalur Penyimpanan +Tentukan jalur output yang berbeda untuk setiap format. Menggunakan konvensi penamaan yang jelas (mis., `output.csv`, `output.tsv`, `output.xlsx`) membantu menjaga proyek Anda terorganisir. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` + ## Langkah 11: Simpan Dokumen yang Diedit -Simpan dokumen yang diedit ke jalur yang ditentukan dalam format berbeda. +`Save()` menulis dokumen ke disk menggunakan opsi penyimpanan yang diberikan. Panggil `EditableDocument.Save` dengan opsi yang sesuai untuk setiap format target. API menulis file langsung ke disk, mempertahankan enkoding asli kecuali Anda menggantinya. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Langkah 12: Buang Instans EditableDocument - Terakhir, pastikan untuk membuangnya`EditableDocument` contoh untuk membebaskan sumber daya. + +## Langkah 12: Buang Instance EditableDocument +Baik `Editor` maupun `EditableDocument` mengimplementasikan `IDisposable`. Membuangnya melepaskan handle file dan sumber daya tak terkelola, yang penting saat memproses banyak file dalam pekerjaan batch. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Kesimpulan -Mengedit file DSV menggunakan GroupDocs.Editor untuk .NET adalah proses mudah yang melibatkan pembuatan instance editor, mengatur opsi edit, memodifikasi konten, dan menyimpan perubahan. Panduan langkah demi langkah ini akan membantu Anda mengintegrasikan fungsi ini ke dalam aplikasi .NET Anda dengan mudah. Baik Anda bekerja dengan CSV, TSV, atau format DSV lainnya, GroupDocs.Editor untuk .NET memberikan solusi yang kuat dan fleksibel. -## FAQ -### Bisakah saya menggunakan GroupDocs.Editor untuk .NET untuk mengedit file CSV besar? -Ya, GroupDocs.Editor untuk .NET mampu menangani file CSV besar secara efisien. -### Apakah GroupDocs.Editor untuk .NET mendukung format DSV lain selain CSV dan TSV? -Ya, ini mendukung berbagai format DSV selama Anda menentukan pembatas yang sesuai. -### Apakah mungkin untuk menyesuaikan pengkodean saat menyimpan file DSV? -Tentu saja, Anda dapat menentukan pengkodean yang diinginkan dalam opsi penyimpanan. -### Bisakah saya mengonversi file CSV ke spreadsheet Excel menggunakan GroupDocs.Editor untuk .NET? -Ya, Anda dapat menyimpan file CSV sebagai spreadsheet Excel dengan menggunakan opsi penyimpanan yang sesuai. -### Di mana saya dapat menemukan dokumentasi lebih lanjut tentang GroupDocs.Editor untuk .NET? - Anda dapat menemukan dokumentasi terperinci[Di Sini](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Masalah Umum dan Solusinya +| Masalah | Mengapa Terjadi | Solusi | +|-------|----------------|-----| +| **Kutipan tambahan tak terduga** | Parser CSV default dapat memperlakukan koma yang tertanam sebagai pemisah. | Set `EscapeMode = EscapeMode.DoubleQuote` di `DelimitedTextEditOptions`. | +| **Lonjakan memori pada file besar** | Memuat file 500 MB tanpa streaming. | Gunakan `Editor.Load` dengan `LoadOptions` yang mengaktifkan lazy loading. | +| **Ketidaksesuaian enkoding** | File sumber menggunakan UTF‑16 tetapi opsi default ke UTF‑8. | Secara eksplisit set `Encoding = Encoding.Unicode` di opsi penyimpanan. | + +## Pertanyaan yang Sering Diajukan + +**Q: Bisakah saya menggunakan GroupDocs.Editor untuk .NET untuk menyunting file CSV besar?** +A: Ya, API mem-stream data dan dapat menangani file lebih besar dari 1 GB tanpa memuat seluruh dokumen ke memori. + +**Q: Apakah GroupDocs.Editor untuk .NET mendukung format DSV lain selain CSV dan TSV?** +A: Tentu – setiap pemisah satu karakter (mis., pipe `|`, titik koma `;`) didukung selama Anda menentukan dalam `DelimitedTextEditOptions`. + +**Q: Apakah memungkinkan menyesuaikan enkoding saat menyimpan file DSV?** +A: Ya, Anda dapat mengatur properti `Encoding` di `DelimitedTextSaveOptions` ke UTF‑8, UTF‑16, ISO‑8859‑1, atau enkoding .NET apa pun yang Anda perlukan. + +**Q: Bisakah saya mengonversi file CSV ke spreadsheet Excel menggunakan GroupDocs.Editor untuk .NET?** +A: Ya – setelah penyuntingan, cukup gunakan `SpreadsheetSaveOptions` untuk mengekspor konten sebagai workbook `.xlsx`. + +**Q: Di mana saya dapat menemukan dokumentasi lebih lanjut tentang GroupDocs.Editor untuk .NET?** +A: Referensi API detail dan contoh kode tersedia **[here](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Terakhir Diperbarui:** 2026-06-06 +**Diuji Dengan:** GroupDocs.Editor 23.10 untuk .NET +**Penulis:** GroupDocs + +## Tutorial Terkait + +- [Tutorial Penyuntingan Dokumen Teks Biasa dan DSV untuk GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Menguasai GroupDocs.Editor .NET untuk Penyuntingan Dokumen CSV yang Efisien dan Konversi](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Menguasai Pemuatan Dokumen di .NET dengan GroupDocs.Editor: Panduan Komprehensif](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/italian/net/document-processing/work-dsv/_index.md b/content/italian/net/document-processing/work-dsv/_index.md index 656039d1..ee5bd1f4 100644 --- a/content/italian/net/document-processing/work-dsv/_index.md +++ b/content/italian/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Utilizzare valori separati delimitati (DSV) -linktitle: Utilizzare valori separati delimitati (DSV) -second_title: API GroupDocs.Editor .NET -description: Scopri come modificare file CSV e TSV utilizzando GroupDocs.Editor per .NET con questa guida passo passo. Migliora i tuoi progetti .NET senza sforzo. -weight: 12 -url: /it/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Scopri come **creare oggetti documento modificabile** da file CSV e TSV + utilizzando GroupDocs.Editor per .NET. Questa guida mostra anche come **leggere + testo delimitato C#** e **modificare CSV .NET** in modo efficiente in Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Lavorare con Delimited Separated Values (DSV) – creare documento modificabile +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Lavorare con Delimited Separated Values (DSV) – creare documento modificabile type: docs +url: /it/net/document-processing/work-dsv/ +weight: 12 --- -# Utilizzare valori separati delimitati (DSV) -## introduzione -Se sei uno sviluppatore che lavora con valori separati delimitati (DSV) come file CSV o TSV, sai che la modifica di questi file a livello di codice può essere un compito arduo. Tuttavia, con GroupDocs.Editor per .NET, questa attività diventa notevolmente più semplice ed efficiente. In questo tutorial ti spiegheremo come utilizzare GroupDocs.Editor per .NET per leggere, modificare e salvare file DSV. Suddivideremo il processo in passaggi facili da seguire, rendendolo semplice da implementare nei tuoi progetti. +# Lavorare con valori delimitati separati (DSV) – creare documento modificabile + +Se sei uno sviluppatore .NET che ha bisogno di **create editable document** oggetti da valori delimitati separati (DSV) come CSV o TSV, sei nel posto giusto. Nei primi 100 parole spiegheremo perché GroupDocs.Editor per .NET è il modo più affidabile per **read delimited text C#**, modificarlo e poi salvarlo senza perdere la formattazione. Avrai a disposizione un flusso di lavoro completo, pronto per il copia‑incolla, che si integra naturalmente in qualsiasi soluzione Visual Studio. + +## Risposte rapide +- **Quale libreria gestisce al meglio la modifica dei CSV in .NET?** GroupDocs.Editor for .NET. +- **Posso modificare file CSV di grandi dimensioni in Visual Studio?** Sì – l'API trasmette i dati in streaming e evita di caricare l'intero file in memoria. +- **Ho bisogno di una licenza per l'uso in produzione?** È necessaria una licenza commerciale; è disponibile una prova gratuita. +- **Quali formati posso esportare dopo la modifica?** CSV, TSV e formati di fogli di calcolo compatibili con Excel. +- **L'API è compatibile con .NET 6+?** Assolutamente – supporta .NET Framework 4.5+, .NET Core 3.1+, .NET 5 e .NET 6. + +## Cos'è “create editable document” nel contesto di GroupDocs.Editor? +**Create editable document** indica la generazione di un'istanza `EditableDocument` che rappresenta una versione modificabile di un file sorgente (CSV, TSV, ecc.) in memoria. Questo oggetto consente di leggere, modificare e risalvare il contenuto usando la stessa API. Fornisce metodi per recuperare il testo del documento, applicare modifiche e salvarlo nuovamente in vari formati, garantendo che l'allineamento delle colonne e le virgolette siano preservati. + +## Perché usare GroupDocs.Editor per la gestione dei DSV? +GroupDocs.Editor elabora **più di 50 formati di input e output**, inclusi CSV, TSV e fogli di calcolo compatibili con Excel, mantenendo l'uso della memoria sotto i 10 MB per file fino a 500 MB. Inoltre preserva automaticamente l'allineamento delle colonne, le regole di quotatura e le codifiche personalizzate, eliminando la necessità di logica di parsing manuale. + ## Prerequisiti -Prima di immergerci nel tutorial, assicurati di avere i seguenti prerequisiti: -- Visual Studio: assicurati di avere Visual Studio installato sul tuo computer. -- GroupDocs.Editor per .NET: dovrai scaricare e fare riferimento alla libreria GroupDocs.Editor per .NET. Puoi scaricarlo[Qui](https://releases.groupdocs.com/editor/net/). -- Comprensione di base di C#: questa esercitazione presuppone una conoscenza di base dello sviluppo C# e .NET. -## Importa spazi dei nomi -Innanzitutto, devi importare gli spazi dei nomi necessari nel tuo progetto. Questi spazi dei nomi forniscono le classi e i metodi necessari per lavorare con GroupDocs.Editor per .NET. +Prima di iniziare, assicurati di avere installato quanto segue: + +- **Visual Studio** (qualsiasi edizione recente) – svilupperai e eseguirai il debug direttamente nell'IDE. +- **GroupDocs.Editor for .NET** – scarica l'ultimo pacchetto **[here](https://releases.groupdocs.com/editor/net/)**. +- **Conoscenza base di C#** – il tutorial presuppone che tu possa creare un progetto console o ASP.NET e aggiungere pacchetti NuGet. + +## Importare gli spazi dei nomi +Le classi `Editor`, `EditableDocument` e le classi di opzioni si trovano nello spazio dei nomi `GroupDocs.Editor`. + +La classe `DelimitedTextEditOptions` è il punto di ingresso per definire il delimitatore (virgola, tabulazione, ecc.) e altre regole di parsing. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Passaggio 1: ottenere un percorso per il file DSV di input -Innanzitutto è necessario specificare il percorso del file DSV di input. Per questo esempio, supponiamo che si tratti di un file CSV. +## Come creare un documento modificabile da un file CSV? +Carica il CSV sorgente con `Editor` e chiama il metodo `Edit`, passando un'istanza `DelimitedTextEditOptions` che specifica un delimitatore a virgola. Il metodo restituisce un `EditableDocument` che puoi manipolare in memoria. Questo schema a due passaggi—load → edit—copre scenari **read delimited text C#** e garantisce che la struttura originale del file venga mantenuta. + +## Passo 1: Ottenere il percorso del file DSV di input +Innanzitutto, devi specificare il percorso assoluto o relativo del file DSV sorgente. Per dimostrazione useremo un semplice CSV situato nella cartella `Data` del progetto. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Passaggio 2: crea un'istanza dell'editor - Crea un'istanza di`Editor` classe. Questa istanza verrà utilizzata per caricare e manipolare il file DSV. + +## Passo 2: Creare un'istanza di Editor +`Editor` è la classe principale che orchestra il caricamento, la modifica e il salvataggio. Istanziare con un oggetto `FileInfo` ti dà il pieno controllo sul ciclo di vita del file. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Passaggio 3: crea le opzioni di modifica DSV - Successivamente, crea un'istanza di`DelimitedTextEditOptions` e specificare il delimitatore per il file DSV. Qui utilizziamo una virgola come delimitatore. + +## Passo 3: Creare le opzioni di modifica DSV +`DelimitedTextEditOptions` indica all'editor come interpretare il file. Puoi impostare il delimitatore, se la prima riga contiene intestazioni e la codifica dei caratteri. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Passaggio 4: crea un'istanza di documento modificabile - Creare un`EditableDocument` istanza utilizzando il file`Editor.Edit` metodo. Questo prepara il documento per la modifica. + +## Passo 4: Creare un'istanza di EditableDocument +`EditableDocument` rappresenta una versione modificabile in memoria del file sorgente. Chiamare `Editor.Edit` con le opzioni restituisce un `EditableDocument`. Questo oggetto contiene il testo del file in una stringa modificabile, pronta per qualsiasi operazione **parse delimited values C#** di cui hai bisogno. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Passaggio 5: modifica il contenuto del documento -Recupera il contenuto del testo originale e apporta le modifiche necessarie. A scopo dimostrativo, sostituiamo del testo. + +## Passo 5: Modificare il contenuto del documento +`GetDocumentText()` restituisce il testo corrente del documento modificabile come stringa. Recupera il testo originale tramite `EditableDocument.GetDocumentText()`, esegui le modifiche (ad esempio, sostituisci il valore di una colonna) e memorizza il risultato in una nuova stringa. Qui è dove **edit CSV .NET** senza toccare i flussi di file a basso livello. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Passaggio 6: crea un documento modificabile con contenuto aggiornato - Creane uno nuovo`EditableDocument` con il contenuto aggiornato. + +## Passo 6: Creare un EditableDocument con contenuto aggiornato +Riconverti la stringa modificata in un `EditableDocument`. Questo passaggio finalizza le modifiche e prepara l'oggetto per il salvataggio in qualsiasi formato supportato. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Passaggio 7: crea opzioni di salvataggio CSV -Specificare le opzioni di salvataggio per il formato CSV, inclusi delimitatore e codifica. + +## Passo 7: Creare le opzioni di salvataggio CSV +`DelimitedTextSaveOptions` specifica come scrivere il contenuto modificato nuovamente in un file CSV. Quando sei pronto a persistere le modifiche, configura `DelimitedTextSaveOptions`. Puoi specificare lo stesso delimitatore, uno diverso o anche modificare lo stile di terminazione delle righe. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Passaggio 8: crea le opzioni di salvataggio TSV -Allo stesso modo, specifica le opzioni di salvataggio per il formato TSV. + +## Passo 8: Creare le opzioni di salvataggio TSV +Se ti serve una versione separata da tabulazioni, basta cambiare il delimitatore in `\t`. Lo stesso `EditableDocument` può essere salvato più volte con opzioni diverse. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Passaggio 9: crea le opzioni di salvataggio del foglio di calcolo -Se devi salvare il documento come foglio di calcolo, crea le opzioni di salvataggio corrispondenti. + +## Passo 9: Creare le opzioni di salvataggio Spreadsheet +`SpreadsheetSaveOptions` configura l'esportazione del documento in formati compatibili con Excel come .xlsx. GroupDocs.Editor consente anche di esportare i dati modificati in un formato compatibile con Excel (`.xlsx`). La classe `SpreadsheetSaveOptions` gestisce automaticamente i tipi di colonna, le formule e lo stile delle celle. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Passaggio 10: preparare i percorsi di salvataggio -Definire i percorsi in cui verranno salvati i file modificati. + +## Passo 10: Preparare i percorsi di salvataggio +Definisci percorsi di output distinti per ogni formato. Utilizzare convenzioni di denominazione chiare (ad esempio, `output.csv`, `output.tsv`, `output.xlsx`) aiuta a mantenere il progetto organizzato. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Passaggio 11: salva il documento modificato -Salva il documento modificato nei percorsi specificati in diversi formati. + +## Passo 11: Salvare il documento modificato +`Save()` scrive il documento su disco usando le opzioni di salvataggio fornite. Invoca `EditableDocument.Save` con le opzioni appropriate per ogni formato di destinazione. L'API scrive il file direttamente su disco, preservando la codifica originale a meno che non la sovrascrivi. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Passaggio 12: eliminare le istanze di documento modificabile - Infine, assicurati di smaltire il`EditableDocument` istanze per liberare risorse. + +## Passo 12: Rilasciare le istanze di EditableDocument +Sia `Editor` che `EditableDocument` implementano `IDisposable`. Rilasciarli libera i handle dei file e le risorse non gestite, cosa cruciale quando si elaborano molti file in un lavoro batch. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusione -La modifica dei file DSV utilizzando GroupDocs.Editor per .NET è un processo semplice che prevede la creazione di un'istanza dell'editor, l'impostazione delle opzioni di modifica, la modifica del contenuto e il salvataggio delle modifiche. Questa guida dettagliata dovrebbe aiutarti a integrare facilmente questa funzionalità nelle tue applicazioni .NET. Che tu stia lavorando con CSV, TSV o altri formati DSV, GroupDocs.Editor per .NET fornisce una soluzione solida e flessibile. + +## Problemi comuni e soluzioni +| Problema | Perché accade | Soluzione | +|----------|----------------|-----------| +| **Virgolette extra inattese** | Il parser CSV predefinito può trattare le virgole incorporate come delimitatori. | Imposta `EscapeMode = EscapeMode.DoubleQuote` in `DelimitedTextEditOptions`. | +| **Picco di memoria con file grandi** | Caricamento di un file da 500 MB senza streaming. | Usa `Editor.Load` con `LoadOptions` che abilitano il caricamento pigro. | +| **Mancata corrispondenza di codifica** | Il file sorgente usa UTF‑16 ma le opzioni di default sono UTF‑8. | Imposta esplicitamente `Encoding = Encoding.Unicode` nelle opzioni di salvataggio. | + ## Domande frequenti -### Posso utilizzare GroupDocs.Editor for .NET per modificare file CSV di grandi dimensioni? -Sì, GroupDocs.Editor per .NET è in grado di gestire file CSV di grandi dimensioni in modo efficiente. -### GroupDocs.Editor per .NET supporta altri formati DSV oltre a CSV e TSV? -Sì, supporta vari formati DSV purché si specifichi il delimitatore appropriato. -### È possibile personalizzare la codifica durante il salvataggio dei file DSV? -Assolutamente sì, puoi specificare la codifica desiderata nelle opzioni di salvataggio. -### Posso convertire un file CSV in un foglio di calcolo Excel utilizzando GroupDocs.Editor per .NET? -Sì, puoi salvare un file CSV come foglio di calcolo Excel utilizzando le opzioni di salvataggio appropriate. -### Dove posso trovare ulteriore documentazione su GroupDocs.Editor per .NET? - Puoi trovare documentazione dettagliata[Qui](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: Posso usare GroupDocs.Editor per .NET per modificare file CSV di grandi dimensioni?** +A: Sì, l'API trasmette i dati in streaming e può gestire file più grandi di 1 GB senza caricare l'intero documento in memoria. + +**Q: GroupDocs.Editor per .NET supporta altri formati DSV oltre a CSV e TSV?** +A: Assolutamente – qualsiasi delimitatore a singolo carattere (ad esempio, pipe `|`, punto e virgola `;`) è supportato purché lo specifichi in `DelimitedTextEditOptions`. + +**Q: È possibile personalizzare la codifica durante il salvataggio dei file DSV?** +A: Sì, puoi impostare la proprietà `Encoding` in `DelimitedTextSaveOptions` a UTF‑8, UTF‑16, ISO‑8859‑1, o qualsiasi `Encoding` .NET tu richieda. + +**Q: Posso convertire un file CSV in un foglio di calcolo Excel usando GroupDocs.Editor per .NET?** +A: Sì – dopo la modifica, usa semplicemente `SpreadsheetSaveOptions` per esportare il contenuto come un workbook `.xlsx`. + +**Q: Dove posso trovare ulteriore documentazione su GroupDocs.Editor per .NET?** +A: Riferimenti API dettagliati e esempi di codice sono disponibili **[here](https://tutorials.groupdocs.com/editor/net/)**. + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.10 for .NET +**Author:** GroupDocs + +## Tutorial correlati + +- [Tutorial di editing di testo semplice e documenti DSV per GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Padroneggiare GroupDocs.Editor .NET per l'editing efficiente di documenti CSV e la conversione](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Padroneggiare il caricamento dei documenti in .NET con GroupDocs.Editor: Guida completa](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/japanese/net/document-processing/work-dsv/_index.md b/content/japanese/net/document-processing/work-dsv/_index.md index df098028..7a021a5c 100644 --- a/content/japanese/net/document-processing/work-dsv/_index.md +++ b/content/japanese/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: 区切り文字で区切られた値 (DSV) の操作 -linktitle: 区切り文字で区切られた値 (DSV) の操作 +date: 2026-06-06 +description: GroupDocs.Editor for .NET を使用して CSV および TSV ファイルから **create editable + document** オブジェクトを作成する方法を学びます。このガイドでは、Visual Studio で **read delimited text C#** + と **edit CSV .NET** を効率的に行う方法も示します。 +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Delimited Separated Values (DSV) を操作する – 編集可能なドキュメントを作成 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: このステップバイステップ ガイドでは、GroupDocs.Editor for .NET を使用して CSV および TSV ファイルを編集する方法を学習します。.NET プロジェクトを簡単に改善できます。 -weight: 12 -url: /ja/net/document-processing/work-dsv/ +title: Delimited Separated Values (DSV) を操作する – 編集可能なドキュメントを作成 type: docs +url: /ja/net/document-processing/work-dsv/ +weight: 12 --- -# 区切り文字で区切られた値 (DSV) の操作 -## 導入 -CSV や TSV ファイルなどの区切り値 (DSV) を扱う開発者であれば、これらのファイルをプログラムで編集するのは大変な作業になる可能性があることをご存知でしょう。ただし、GroupDocs.Editor for .NET を使用すると、この作業は大幅に簡単かつ効率的になります。このチュートリアルでは、GroupDocs.Editor for .NET を使用して DSV ファイルを読み取り、編集し、保存する方法について説明します。プロセスをわかりやすい手順に分解して、プロジェクトに簡単に実装できるようにします。 +# 区切り文字付き値 (DSV) の操作 – 編集可能なドキュメントの作成 + +.NET 開発者で、CSV や TSV などの区切り文字付き値 (DSV) から **editable document** オブジェクトを作成したい方は、正しい場所に来ました。最初の 100 語で、GroupDocs.Editor for .NET が **read delimited text C#** を最も信頼できる方法で読み取り、編集し、書式を失わずに保存できる理由を説明します。Visual Studio ソリューションに自然に組み込める、コピー&ペースト可能な完全なワークフローを手に入れられます。 + +## クイック回答 +- **どのライブラリが .NET で CSV 編集に最適ですか?** GroupDocs.Editor for .NET. +- **Visual Studio で大きな CSV ファイルを編集できますか?** はい – API はデータをストリーミングし、ファイル全体をメモリにロードしません。 +- **本番環境で使用するにはライセンスが必要ですか?** 商用ライセンスが必要です。無料トライアルが利用可能です。 +- **編集後に出力できるフォーマットは?** CSV、TSV、Excel 互換のスプレッドシート形式です。 +- **API は .NET 6+ と互換性がありますか?** もちろんです – .NET Framework 4.5+、.NET Core 3.1+、.NET 5、.NET 6 をサポートしています。 + +## GroupDocs.Editor のコンテキストで「create editable document」とは何ですか? +**Create editable document** とは、`EditableDocument` インスタンスを生成し、メモリ上にソースファイル (CSV、TSV など) の可変バージョンを表すことを意味します。このオブジェクトを使用すると、同じ API でコンテンツを読み取り、変更し、再保存できます。ドキュメントテキストの取得、変更の適用、さまざまな形式での再保存メソッドが提供され、列の整列や引用符が保持されます。 + +## DSV の取り扱いに GroupDocs.Editor を使用する理由は? +GroupDocs.Editor は **50 以上の入力および出力フォーマット** を処理し、CSV、TSV、Excel 互換スプレッドシートを含みます。500 MB までのファイルでもメモリ使用量は 10 MB 未満に抑えられます。また、列の整列、引用符ルール、カスタムエンコーディングを自動的に保持するため、手動のパースロジックが不要です。 + ## 前提条件 -チュートリアルに進む前に、次の前提条件を満たしていることを確認してください。 -- Visual Studio: マシンに Visual Studio がインストールされていることを確認します。 -- GroupDocs.Editor for .NET: GroupDocs.Editor for .NETライブラリをダウンロードして参照する必要があります。ダウンロードできます。[ここ](https://releases.groupdocs.com/editor/net/). -- C# の基本的な理解: このチュートリアルでは、C# と .NET 開発の基本的な理解があることを前提としています。 +- **Visual Studio**(任意の最新エディション) – IDE 内で直接開発およびデバッグできます。 +- **GroupDocs.Editor for .NET** – 最新パッケージは **[here](https://releases.groupdocs.com/editor/net/)** からダウンロードしてください。 +- **Basic C# knowledge** – 本チュートリアルは、コンソールまたは ASP.NET プロジェクトを作成し、NuGet パッケージを追加できることを前提としています。 + ## 名前空間のインポート -まず、プロジェクトに必要な名前空間をインポートする必要があります。これらの名前空間は、GroupDocs.Editor for .NET を操作するために必要なクラスとメソッドを提供します。 +`Editor`、`EditableDocument`、およびオプションクラスは `GroupDocs.Editor` 名前空間にあります。 + +`DelimitedTextEditOptions` クラスは、区切り文字(カンマ、タブなど)やその他のパースルールを定義するエントリーポイントです。 + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## ステップ1: 入力DSVファイルへのパスを取得する -まず、入力 DSV ファイルへのパスを指定する必要があります。この例では、CSV ファイルであると想定します。 +## CSV ファイルから editable document を作成する方法は? +`Editor` でソース CSV をロードし、カンマ区切りを指定した `DelimitedTextEditOptions` インスタンスを渡して `Edit` メソッドを呼び出します。メソッドはメモリ上の `EditableDocument` を返し、これを操作できます。この 2 段階パターン(ロード → 編集)は **read delimited text C#** シナリオをカバーし、元のファイル構造が保持されます。 + +## 手順 1: 入力 DSV ファイルへのパスを取得する +まず、ソース DSV ファイルへの絶対パスまたは相対パスを指定する必要があります。デモ用にプロジェクトの `Data` フォルダーにあるシンプルな CSV を使用します。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## ステップ2: エディターインスタンスを作成する -インスタンスを作成する`Editor`クラス。このインスタンスは、DSV ファイルの読み込みと操作に使用されます。 + +## 手順 2: Editor インスタンスを作成する +`Editor` はロード、編集、保存を統括するコアクラスです。`FileInfo` オブジェクトでインスタンス化すると、ファイルライフサイクルを完全に制御できます。 + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## ステップ3: DSV編集オプションを作成する -次に、インスタンスを作成します`DelimitedTextEditOptions`DSV ファイルの区切り文字を指定します。ここでは、区切り文字としてカンマを使用します。 + +## 手順 3: DSV 編集オプションを作成する +`DelimitedTextEditOptions` はエディタにファイルの解釈方法を指示します。区切り文字、ヘッダー行の有無、文字エンコーディングなどを設定できます。 + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## ステップ4: EditableDocumentインスタンスを作成する -作成する`EditableDocument`インスタンスを使用して`Editor.Edit`メソッド。これにより、ドキュメントを編集する準備が整います。 + +## 手順 4: EditableDocument インスタンスを作成する +`EditableDocument` はソースファイルの可変メモリバージョンを表します。オプションを指定して `Editor.Edit` を呼び出すと `EditableDocument` が返されます。このオブジェクトはテキストを可変文字列として保持し、任意の **parse delimited values C#** 操作に備えます。 + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## ステップ5: ドキュメントコンテンツを編集する -元のテキスト コンテンツを取得し、必要な変更を加えます。デモンストレーションのために、一部のテキストを置き換えてみましょう。 + +## 手順 5: ドキュメント内容を編集する +`GetDocumentText()` は editable document の現在のテキストを文字列で返します。`EditableDocument.GetDocumentText()` で元テキストを取得し、列の値を置換するなどの変更を加えて新しい文字列に保存します。これにより **edit CSV .NET** が低レベルのファイルストリームに触れずに実現できます。 + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## ステップ 6: 更新されたコンテンツを含む編集可能なドキュメントを作成する -新しいを作成します`EditableDocument`更新されたコンテンツ。 + +## 手順 6: 更新されたコンテンツで EditableDocument を作成する +変更後の文字列を再び `EditableDocument` にラップします。このステップで変更が確定し、任意のサポート形式で保存できる状態になります。 + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## ステップ7: CSV保存オプションを作成する -区切り文字やエンコードなど、CSV 形式の保存オプションを指定します。 + +## 手順 7: CSV 保存オプションを作成する +`DelimitedTextSaveOptions` は編集後のコンテンツを書き戻す際の設定を指定します。変更を永続化する準備ができたら、同じ区切り文字や別の区切り文字、改行スタイルなどを構成できます。 + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## ステップ8: TSV保存オプションを作成する -同様に、TSV 形式の保存オプションを指定します。 + +## 手順 8: TSV 保存オプションを作成する +タブ区切り版が必要な場合は、区切り文字を `\t` に切り替えるだけです。同じ `EditableDocument` を異なるオプションで複数回保存できます。 + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## ステップ9: スプレッドシートの保存オプションを作成する -ドキュメントをスプレッドシートとして保存する必要がある場合は、対応する保存オプションを作成します。 + +## 手順 9: スプレッドシート保存オプションを作成する +`SpreadsheetSaveOptions` はドキュメントを .xlsx などの Excel 互換形式にエクスポートする設定です。GroupDocs.Editor は編集データを Excel 互換形式(`.xlsx`)にエクスポートでき、`SpreadsheetSaveOptions` クラスが列タイプ、数式、セルスタイルを自動的に処理します。 + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## ステップ10: 保存パスを準備する -編集したファイルを保存するパスを定義します。 + +## 手順 10: 保存パスを準備する +各形式ごとに異なる出力パスを定義します。`output.csv`、`output.tsv`、`output.xlsx` のように明確な命名規則を使用すると、プロジェクトが整理しやすくなります。 + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## ステップ11: 編集したドキュメントを保存する -編集したドキュメントをさまざまな形式で指定されたパスに保存します。 + +## 手順 11: 編集済みドキュメントを保存する +`Save()` は提供された保存オプションを使用してディスクに書き込みます。各ターゲット形式に対して適切なオプションで `EditableDocument.Save` を呼び出してください。API は元のエンコーディングを保持し、上書きしない限りそのまま保存します。 + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## ステップ 12: EditableDocument インスタンスを破棄する -最後に、`EditableDocument`インスタンスを作成してリソースを解放します。 + +## 手順 12: EditableDocument インスタンスを破棄する +`Editor` と `EditableDocument` はどちらも `IDisposable` を実装しています。破棄するとファイルハンドルとアンマネージドリソースが解放され、バッチジョブで多数のファイルを処理する際に重要です。 + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## 結論 -GroupDocs.Editor for .NET を使用して DSV ファイルを編集するのは、エディター インスタンスの作成、編集オプションの設定、コンテンツの変更、変更の保存という簡単なプロセスです。このステップ バイ ステップ ガイドは、この機能を .NET アプリケーションに簡単に統合するのに役立ちます。CSV、TSV、またはその他の DSV 形式のいずれを扱う場合でも、GroupDocs.Editor for .NET は堅牢で柔軟なソリューションを提供します。 + +## よくある問題と解決策 +| 問題 | 発生理由 | 解決策 | +|------|----------|--------| +| **予期しない余分な引用符** | デフォルトの CSV パーサーは、埋め込みのコンマを区切り文字として扱う可能性があります。 | `DelimitedTextEditOptions` で `EscapeMode = EscapeMode.DoubleQuote` を設定してください。 | +| **大きなファイルでメモリ使用量が急増** | ストリーミングせずに 500 MB のファイルをロードしています。 | 遅延ロードを有効にする `LoadOptions` を使用して `Editor.Load` を呼び出してください。 | +| **エンコーディングの不一致** | ソースファイルは UTF‑16 を使用していますが、オプションはデフォルトで UTF‑8 です。 | 保存オプションで明示的に `Encoding = Encoding.Unicode` を設定してください。 | + ## よくある質問 -### GroupDocs.Editor for .NET を使用して大きな CSV ファイルを編集できますか? -はい、GroupDocs.Editor for .NET は大きな CSV ファイルを効率的に処理できます。 -### GroupDocs.Editor for .NET は、CSV と TSV 以外の DSV 形式もサポートしていますか? -はい、適切な区切り文字を指定すれば、さまざまな DSV 形式をサポートします。 -### DSV ファイルを保存するときにエンコーディングをカスタマイズすることは可能ですか? -もちろん、保存オプションで希望のエンコードを指定できます。 -### GroupDocs.Editor for .NET を使用して CSV ファイルを Excel スプレッドシートに変換できますか? -はい、適切な保存オプションを使用することで、CSV ファイルを Excel スプレッドシートとして保存できます。 -### GroupDocs.Editor for .NET に関する詳細なドキュメントはどこで入手できますか? -詳細なドキュメントは以下をご覧ください[ここ](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: GroupDocs.Editor for .NET を使用して大きな CSV ファイルを編集できますか?** +A: はい、API はデータをストリーミングし、ドキュメント全体をメモリにロードせずに 1 GB を超えるファイルも処理できます。 + +**Q: GroupDocs.Editor for .NET は CSV と TSV 以外の DSV フォーマットもサポートしていますか?** +A: もちろんです – `DelimitedTextEditOptions` で指定すれば、任意の単一文字区切り(例: パイプ `|`、セミコロン `;`)がサポートされます。 + +**Q: DSV ファイルを保存する際にエンコーディングをカスタマイズできますか?** +A: はい、`DelimitedTextSaveOptions` の `Encoding` プロパティを UTF‑8、UTF‑16、ISO‑8859‑1、または必要な任意の .NET `Encoding` に設定できます。 + +**Q: GroupDocs.Editor for .NET を使用して CSV ファイルを Excel スプレッドシートに変換できますか?** +A: はい – 編集後に `SpreadsheetSaveOptions` を使用してコンテンツを `.xlsx` ワークブックとしてエクスポートすれば完了です。 + +**Q: GroupDocs.Editor for .NET の詳細なドキュメントはどこで見つけられますか?** +A: 詳細な API リファレンスとコードサンプルは **[here](https://tutorials.groupdocs.com/editor/net/)** で入手できます。 + +**最終更新日:** 2026-06-06 +**テスト環境:** GroupDocs.Editor 23.10 for .NET +**作者:** GroupDocs + +## 関連チュートリアル + +- [GroupDocs.Editor .NET 用 プレーンテキストおよび DSV ドキュメント編集チュートリアル](/editor/net/plain-text-dsv-documents/) +- [効率的な CSV ドキュメント編集と変換のための GroupDocs.Editor .NET マスターガイド](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [.NET でのドキュメントロードの完全ガイド – GroupDocs.Editor を活用](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/korean/net/document-processing/work-dsv/_index.md b/content/korean/net/document-processing/work-dsv/_index.md index f048ed70..444820cc 100644 --- a/content/korean/net/document-processing/work-dsv/_index.md +++ b/content/korean/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: DSV(구분된 구분 값) 작업 -linktitle: DSV(구분된 구분 값) 작업 +date: 2026-06-06 +description: CSV 및 TSV 파일을 사용하여 GroupDocs.Editor for .NET으로 **편집 가능한 문서** 객체를 만드는 + 방법을 배웁니다. 이 가이드는 또한 Visual Studio에서 **C#로 구분된 텍스트를 읽고** **CSV .NET을 편집**하는 효율적인 + 방법을 보여줍니다. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: 구분된 구분 값(DSV) 작업 – 편집 가능한 문서 만들기 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 이 단계별 가이드를 통해 .NET용 GroupDocs.Editor를 사용하여 CSV 및 TSV 파일을 편집하는 방법을 알아보세요. .NET 프로젝트를 손쉽게 개선하세요. -weight: 12 -url: /ko/net/document-processing/work-dsv/ +title: 구분된 구분 값(DSV) 작업 – 편집 가능한 문서 만들기 type: docs +url: /ko/net/document-processing/work-dsv/ +weight: 12 --- -# DSV(구분된 구분 값) 작업 - -## 소개 -CSV 또는 TSV 파일과 같은 DSV(구분된 구분 값)를 사용하여 작업하는 개발자라면 이러한 파일을 프로그래밍 방식으로 편집하는 것이 어려운 작업이 될 수 있다는 것을 알고 있습니다. 그러나 .NET용 GroupDocs.Editor를 사용하면 이 작업이 훨씬 더 간단하고 효율적이 됩니다. 이 자습서에서는 .NET용 GroupDocs.Editor를 사용하여 DSV 파일을 읽고 편집하고 저장하는 방법을 안내합니다. 프로세스를 따라하기 쉬운 단계로 나누어 프로젝트에서 쉽게 구현할 수 있도록 하겠습니다. -## 전제조건 -튜토리얼을 시작하기 전에 다음 전제 조건이 충족되었는지 확인하세요. -- Visual Studio: 컴퓨터에 Visual Studio가 설치되어 있는지 확인하세요. -- .NET용 GroupDocs.Editor: .NET용 GroupDocs.Editor 라이브러리를 다운로드하고 참조해야 합니다. 당신은 그것을 다운로드 할 수 있습니다[여기](https://releases.groupdocs.com/editor/net/). -- C#의 기본 이해: 이 자습서에서는 사용자가 C# 및 .NET 개발에 대한 기본 지식을 가지고 있다고 가정합니다. + +# 구분된 구분 값(DSV) 작업 – 편집 가능한 문서 만들기 + +If you’re a .NET developer who needs to **create editable document** objects from delimited separated values (DSV) such as CSV or TSV, you’ve come to the right place. In the first 100 words we’ll explain why GroupDocs.Editor for .NET is the most reliable way to **read delimited text C#**, edit it, and then save it back without losing formatting. You’ll walk away with a complete, copy‑and‑paste‑ready workflow that fits naturally into any Visual Studio solution. + +## 빠른 답변 +- **.NET에서 CSV 편집을 가장 잘 처리하는 라이브러리는 무엇인가요?** GroupDocs.Editor for .NET. +- **Visual Studio에서 대용량 CSV 파일을 편집할 수 있나요?** Yes – the API streams data and avoids loading the whole file into memory. +- **프로덕션 사용을 위해 라이선스가 필요합니까?** A commercial license is required; a free trial is available. +- **편집 후 어떤 형식으로 출력할 수 있나요?** CSV, TSV, and Excel‑compatible spreadsheet formats. +- **API가 .NET 6+와 호환되나요?** Absolutely – it supports .NET Framework 4.5+, .NET Core 3.1+, .NET 5, and .NET 6. + +## GroupDocs.Editor 컨텍스트에서 “create editable document”란 무엇인가요? +**Create editable document**는 메모리 내에서 소스 파일(CSV, TSV 등)의 변경 가능한 버전을 나타내는 `EditableDocument` 인스턴스를 생성하는 것을 의미합니다. 이 객체를 사용하면 동일한 API로 내용을 읽고, 수정하고, 다시 저장할 수 있습니다. 문서 텍스트를 가져오고, 변경을 적용하며, 다양한 형식으로 다시 저장하는 메서드를 제공하여 열 정렬 및 인용 부호가 보존되도록 합니다. + +## DSV 처리에 GroupDocs.Editor를 사용하는 이유 +GroupDocs.Editor는 CSV, TSV 및 Excel 호환 스프레드시트를 포함한 **50개 이상의 입력 및 출력 형식**을 처리하면서 500 MB까지의 파일에 대해 메모리 사용량을 10 MB 이하로 유지합니다. 또한 열 정렬, 인용 규칙 및 사용자 지정 인코딩을 자동으로 보존하므로 수동 파싱 로직이 필요하지 않습니다. + +## 사전 요구 사항 +- **Visual Studio** (최근 버전) – IDE 내부에서 직접 개발 및 디버깅합니다. +- **GroupDocs.Editor for .NET** – 최신 패키지를 **[here](https://releases.groupdocs.com/editor/net/)**에서 다운로드하십시오. +- **Basic C# knowledge** – 이 튜토리얼은 콘솔 또는 ASP.NET 프로젝트를 만들고 NuGet 패키지를 추가할 수 있다고 가정합니다. + ## 네임스페이스 가져오기 -먼저 프로젝트에서 필요한 네임스페이스를 가져와야 합니다. 이러한 네임스페이스는 .NET용 GroupDocs.Editor를 사용하는 데 필요한 클래스와 메서드를 제공합니다. +`Editor`, `EditableDocument`, 및 옵션 클래스는 `GroupDocs.Editor` 네임스페이스에 있습니다. + +`DelimitedTextEditOptions` 클래스는 구분자(쉼표, 탭 등) 및 기타 파싱 규칙을 정의하기 위한 진입점입니다. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,141 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## 1단계: 입력 DSV 파일의 경로 가져오기 -먼저 입력 DSV 파일의 경로를 지정해야 합니다. 이 예에서는 CSV 파일이라고 가정합니다. +## CSV 파일에서 editable document를 만드는 방법? +`Editor`를 사용해 소스 CSV를 로드하고 `Edit` 메서드를 호출하면서 쉼표 구분자를 지정한 `DelimitedTextEditOptions` 인스턴스를 전달합니다. 이 메서드는 메모리 내에서 조작할 수 있는 `EditableDocument`를 반환합니다. 이 두 단계 패턴—load → edit—은 **read delimited text C#** 시나리오를 포괄하며 원본 파일 구조가 유지됨을 보장합니다. + +## 단계 1: 입력 DSV 파일 경로 가져오기 +먼저, 소스 DSV 파일의 절대 경로나 상대 경로를 지정해야 합니다. 예시로 프로젝트의 `Data` 폴더에 있는 간단한 CSV를 사용하겠습니다. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2단계: 편집기 인스턴스 생성 - 인스턴스를 생성합니다.`Editor` 수업. 이 인스턴스는 DSV 파일을 로드하고 조작하는 데 사용됩니다. + +## 단계 2: Editor 인스턴스 생성 +`Editor`는 로드, 편집 및 저장을 조정하는 핵심 클래스입니다. `FileInfo` 객체와 함께 인스턴스를 생성하면 파일 수명 주기를 완전히 제어할 수 있습니다. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## 3단계: DSV 편집 옵션 만들기 - 다음으로 인스턴스를 생성합니다.`DelimitedTextEditOptions` DSV 파일의 구분 기호를 지정합니다. 여기서는 쉼표를 구분 기호로 사용합니다. + +## 단계 3: DSV 편집 옵션 생성 +`DelimitedTextEditOptions`는 편집기에게 파일을 어떻게 해석할지 알려줍니다. 구분자, 첫 번째 행에 헤더가 있는지 여부, 문자 인코딩을 설정할 수 있습니다. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## 4단계: EditableDocument 인스턴스 생성 - 만들기`EditableDocument` 인스턴스를 사용하여`Editor.Edit` 방법. 그러면 편집할 문서가 준비됩니다. + +## 단계 4: EditableDocument 인스턴스 생성 +`EditableDocument`는 소스 파일의 변경 가능한 메모리 내 버전을 나타냅니다. 옵션과 함께 `Editor.Edit`를 호출하면 `EditableDocument`가 반환됩니다. 이 객체는 파일 텍스트를 변경 가능한 문자열로 보관하며, 필요에 따라 **parse delimited values C#** 작업을 수행할 준비가 되어 있습니다. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## 5단계: 문서 내용 편집 -원본 텍스트 콘텐츠를 검색하고 필요한 수정을 가합니다. 데모를 위해 일부 텍스트를 교체해 보겠습니다. + +## 단계 5: 문서 내용 편집 +`GetDocumentText()`는 편집 가능한 문서의 현재 텍스트를 문자열로 반환합니다. `EditableDocument.GetDocumentText()`를 통해 원본 텍스트를 가져오고, 수정 작업(예: 열 값 교체)을 수행한 뒤 결과를 새로운 문자열에 저장합니다. 여기에서 **edit CSV .NET**을 수행하면서 저수준 파일 스트림을 건드리지 않을 수 있습니다. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## 6단계: 업데이트된 콘텐츠로 편집 가능한 문서 만들기 - 새로 만들기`EditableDocument` 업데이트된 콘텐츠로 + +## 단계 6: 업데이트된 내용으로 EditableDocument 생성 +수정된 문자열을 다시 `EditableDocument`에 래핑합니다. 이 단계에서 변경 사항이 최종 확정되고 객체가 지원되는 모든 형식으로 저장될 준비가 됩니다. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## 7단계: CSV 저장 옵션 생성 -구분 기호 및 인코딩을 포함하여 CSV 형식에 대한 저장 옵션을 지정합니다. + +## 단계 7: CSV 저장 옵션 생성 +`DelimitedTextSaveOptions`는 편집된 내용을 CSV 파일에 다시 쓰는 방식을 지정합니다. 변경 사항을 저장할 준비가 되면 `DelimitedTextSaveOptions`를 구성합니다. 동일한 구분자, 다른 구분자, 혹은 줄 끝 스타일을 변경할 수도 있습니다. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 8단계: TSV 저장 옵션 생성 -마찬가지로 TSV 형식에 대한 저장 옵션을 지정합니다. + +## 단계 8: TSV 저장 옵션 생성 +탭 구분 버전이 필요하면 구분자를 `\t`로 바꾸면 됩니다. 동일한 `EditableDocument`를 다양한 옵션으로 여러 번 저장할 수 있습니다. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 9단계: 스프레드시트 저장 옵션 만들기 -문서를 스프레드시트로 저장해야 하는 경우 해당 저장 옵션을 만듭니다. + +## 단계 9: 스프레드시트 저장 옵션 생성 +`SpreadsheetSaveOptions`는 문서를 .xlsx와 같은 Excel 호환 형식으로 내보내도록 구성합니다. GroupDocs.Editor를 사용하면 편집된 데이터를 Excel 호환 형식(`.xlsx`)으로 내보낼 수 있습니다. `SpreadsheetSaveOptions` 클래스는 열 유형, 수식 및 셀 스타일을 자동으로 처리합니다. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## 10단계: 저장 경로 준비 -편집된 파일이 저장될 경로를 정의합니다. + +## 단계 10: 저장 경로 준비 +각 형식에 대해 별개의 출력 경로를 정의합니다. 명확한 명명 규칙(`output.csv`, `output.tsv`, `output.xlsx` 등)을 사용하면 프로젝트를 체계적으로 유지할 수 있습니다. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## 11단계: 편집된 문서 저장 -편집된 문서를 지정된 경로에 다른 형식으로 저장합니다. + +## 단계 11: 편집된 문서 저장 +`Save()`는 제공된 저장 옵션을 사용해 문서를 디스크에 기록합니다. 각 대상 형식에 맞는 옵션으로 `EditableDocument.Save`를 호출합니다. API는 파일을 직접 디스크에 쓰며, 별도로 지정하지 않는 한 원본 인코딩을 보존합니다. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## 12단계: EditableDocument 인스턴스 삭제 - 마지막으로, 반드시 폐기하십시오.`EditableDocument` 인스턴스를 사용하여 리소스를 확보합니다. + +## 단계 12: EditableDocument 인스턴스 해제 +`Editor`와 `EditableDocument` 모두 `IDisposable`을 구현합니다. 이를 해제하면 파일 핸들과 관리되지 않는 리소스가 해제되어 배치 작업에서 다수의 파일을 처리할 때 중요합니다. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## 결론 -.NET용 GroupDocs.Editor를 사용하여 DSV 파일을 편집하는 것은 편집기 인스턴스 만들기, 편집 옵션 설정, 콘텐츠 수정 및 변경 사항 저장을 포함하는 간단한 프로세스입니다. 이 단계별 가이드는 이 기능을 .NET 애플리케이션에 쉽게 통합하는 데 도움이 됩니다. CSV, TSV 또는 기타 DSV 형식으로 작업하는 경우 .NET용 GroupDocs.Editor는 강력하고 유연한 솔루션을 제공합니다. -## FAQ -### .NET용 GroupDocs.Editor를 사용하여 대용량 CSV 파일을 편집할 수 있습니까? -예, .NET용 GroupDocs.Editor는 대용량 CSV 파일을 효율적으로 처리할 수 있습니다. -### .NET용 GroupDocs.Editor는 CSV 및 TSV 외에 다른 DSV 형식을 지원합니까? -예, 적절한 구분 기호를 지정하는 한 다양한 DSV 형식을 지원합니다. -### DSV 파일을 저장할 때 인코딩을 사용자 정의할 수 있습니까? -물론 저장 옵션에서 원하는 인코딩을 지정할 수 있습니다. -### .NET용 GroupDocs.Editor를 사용하여 CSV 파일을 Excel 스프레드시트로 변환할 수 있나요? -예, 적절한 저장 옵션을 사용하여 CSV 파일을 Excel 스프레드시트로 저장할 수 있습니다. -### .NET용 GroupDocs.Editor에 대한 추가 문서는 어디서 찾을 수 있나요? - 자세한 문서를 찾을 수 있습니다[여기](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## 일반적인 문제 및 해결책 + +| 문제 | 발생 원인 | 해결 방법 | +|-------|----------------|-----| +| **예상치 못한 추가 인용 부호** | 기본 CSV 파서는 포함된 쉼표를 구분자로 오인할 수 있습니다. | `DelimitedTextEditOptions`에서 `EscapeMode = EscapeMode.DoubleQuote`를 설정합니다. | +| **대용량 파일 메모리 급증** | 스트리밍 없이 500 MB 파일을 로드합니다. | 지연 로딩을 활성화하는 `LoadOptions`와 함께 `Editor.Load`를 사용합니다. | +| **인코딩 불일치** | 소스 파일은 UTF‑16을 사용하지만 옵션은 기본적으로 UTF‑8을 사용합니다. | 저장 옵션에서 `Encoding = Encoding.Unicode`를 명시적으로 설정합니다. | + +## 자주 묻는 질문 + +**Q: GroupDocs.Editor for .NET를 사용해 대용량 CSV 파일을 편집할 수 있나요?** +A: 예, API는 데이터를 스트리밍하며 전체 문서를 메모리에 로드하지 않고 1 GB 이상의 파일을 처리할 수 있습니다. + +**Q: GroupDocs.Editor for .NET가 CSV와 TSV 외에 다른 DSV 형식을 지원하나요?** +A: 물론입니다 – `DelimitedTextEditOptions`에 지정하기만 하면 단일 문자 구분자(예: 파이프 `|`, 세미콜론 `;`)를 모두 지원합니다. + +**Q: DSV 파일을 저장할 때 인코딩을 사용자 지정할 수 있나요?** +A: 예, `DelimitedTextSaveOptions`의 `Encoding` 속성을 UTF‑8, UTF‑16, ISO‑8859‑1 또는 필요한 .NET `Encoding`으로 설정할 수 있습니다. + +**Q: GroupDocs.Editor for .NET를 사용해 CSV 파일을 Excel 스프레드시트로 변환할 수 있나요?** +A: 예 – 편집 후 `SpreadsheetSaveOptions`를 사용해 내용을 `.xlsx` 워크북으로 내보내면 됩니다. + +**Q: GroupDocs.Editor for .NET에 대한 자세한 문서는 어디에서 찾을 수 있나요?** +A: 자세한 API 레퍼런스와 코드 샘플은 **[here](https://tutorials.groupdocs.com/editor/net/)**에서 확인할 수 있습니다. + +--- + +**마지막 업데이트:** 2026-06-06 +**테스트 환경:** GroupDocs.Editor 23.10 for .NET +**작성자:** GroupDocs + +## 관련 튜토리얼 + +- [GroupDocs.Editor .NET용 일반 텍스트 및 DSV 문서 편집 튜토리얼](/editor/net/plain-text-dsv-documents/) +- [효율적인 CSV 문서 편집 및 변환을 위한 GroupDocs.Editor .NET 마스터](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [GroupDocs.Editor와 함께 .NET에서 문서 로딩 마스터하기: 종합 가이드](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/polish/net/document-processing/work-dsv/_index.md b/content/polish/net/document-processing/work-dsv/_index.md index 031a7708..fd9e2d5b 100644 --- a/content/polish/net/document-processing/work-dsv/_index.md +++ b/content/polish/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: Praca z wartościami rozdzielonymi rozdzielanymi (DSV) -linktitle: Praca z wartościami rozdzielonymi rozdzielanymi (DSV) -second_title: Edytor GroupDocs.NET API -description: Z tego przewodnika krok po kroku dowiesz się, jak edytować pliki CSV i TSV przy użyciu programu GroupDocs.Editor dla platformy .NET. Ulepszaj swoje projekty .NET bez wysiłku. -weight: 12 -url: /pl/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Dowiedz się, jak **create editable document** objects z plików CSV i + TSV przy użyciu GroupDocs.Editor for .NET. Ten przewodnik pokazuje również, jak + **read delimited text C#** oraz **edit CSV .NET** efektywnie w Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Praca z Delimited Separated Values (DSV) – tworzenie edytowalnego dokumentu +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Praca z Delimited Separated Values (DSV) – tworzenie edytowalnego dokumentu type: docs +url: /pl/net/document-processing/work-dsv/ +weight: 12 --- -# Praca z wartościami rozdzielonymi rozdzielanymi (DSV) - -## Wstęp -Jeśli jesteś programistą pracującym z wartościami rozdzielanymi (DSV), takimi jak pliki CSV lub TSV, wiesz, że programowa edycja tych plików może być trudnym zadaniem. Jednak dzięki GroupDocs.Editor dla .NET zadanie to staje się znacznie prostsze i wydajniejsze. W tym samouczku przeprowadzimy Cię przez proces używania programu GroupDocs.Editor dla platformy .NET do odczytywania, edytowania i zapisywania plików DSV. Podzielimy proces na łatwe do wykonania kroki, dzięki czemu możesz łatwo wdrożyć go w swoich projektach. -## Warunki wstępne -Zanim przejdziemy do samouczka, upewnij się, że spełniasz następujące wymagania wstępne: -- Visual Studio: Upewnij się, że na komputerze jest zainstalowany program Visual Studio. -- GroupDocs.Editor dla .NET: Należy pobrać bibliotekę GroupDocs.Editor dla .NET i skorzystać z niej. Możesz go pobrać[Tutaj](https://releases.groupdocs.com/editor/net/). -- Podstawowa znajomość języka C#: W tym samouczku założono, że masz podstawową wiedzę na temat programowania w językach C# i .NET. -## Importuj przestrzenie nazw -Najpierw musisz zaimportować niezbędne przestrzenie nazw do swojego projektu. Te przestrzenie nazw udostępniają klasy i metody wymagane do pracy z programem GroupDocs.Editor dla platformy .NET. + +# Praca z wartościami rozdzielonymi (DSV) – tworzenie edytowalnego dokumentu + +Jeśli jesteś programistą .NET, który potrzebuje **create editable document** obiektów z wartościami rozdzielonymi (DSV) takimi jak CSV lub TSV, trafiłeś we właściwe miejsce. W pierwszych 100 słowach wyjaśnimy, dlaczego GroupDocs.Editor dla .NET jest najpewniejszym sposobem na **read delimited text C#**, edycję i ponowne zapisanie bez utraty formatowania. Otrzymasz kompletny, gotowy do kopiowania i wklejania przepływ pracy, który naturalnie wpasowuje się w każde rozwiązanie Visual Studio. + +## Szybkie odpowiedzi +- **Która biblioteka najlepiej obsługuje edycję CSV w .NET?** GroupDocs.Editor for .NET. +- **Czy mogę edytować duże pliki CSV w Visual Studio?** Tak – API strumieniuje dane i unika ładowania całego pliku do pamięci. +- **Czy potrzebuję licencji do użytku produkcyjnego?** Wymagana jest licencja komercyjna; dostępna jest darmowa wersja próbna. +- **Jakie formaty mogę uzyskać po edycji?** CSV, TSV i formaty arkuszy kalkulacyjnych kompatybilne z Excel. +- **Czy API jest kompatybilne z .NET 6+?** Absolutnie – obsługuje .NET Framework 4.5+, .NET Core 3.1+, .NET 5 i .NET 6. + +## Co oznacza „create editable document” w kontekście GroupDocs.Editor? +**Create editable document** oznacza wygenerowanie instancji `EditableDocument`, która reprezentuje zmienną wersję pliku źródłowego (CSV, TSV itp.) w pamięci. Ten obiekt pozwala odczytywać, modyfikować i ponownie zapisywać zawartość przy użyciu tego samego API. Udostępnia metody do pobierania tekstu dokumentu, stosowania zmian i zapisywania go w różnych formatach, zapewniając zachowanie wyrównania kolumn i cudzysłowów. + +## Dlaczego używać GroupDocs.Editor do obsługi DSV? +GroupDocs.Editor obsługuje **ponad 50 formatów wejściowych i wyjściowych**, w tym CSV, TSV oraz arkusze kalkulacyjne kompatybilne z Excel, przy jednoczesnym utrzymaniu zużycia pamięci poniżej 10 MB dla plików do 500 MB. Automatycznie zachowuje wyrównanie kolumn, zasady cudzysłowów i niestandardowe kodowania, co eliminuje potrzebę ręcznej logiki parsowania. + +## Wymagania wstępne +- **Visual Studio** (dowolna aktualna edycja) – będziesz rozwijać i debugować bezpośrednio w IDE. +- **GroupDocs.Editor for .NET** – pobierz najnowszy pakiet **[here](https://releases.groupdocs.com/editor/net/)**. +- **Podstawowa znajomość C#** – tutorial zakłada, że potrafisz utworzyć projekt konsolowy lub ASP.NET i dodać pakiety NuGet. + +## Importowanie przestrzeni nazw +`Editor`, `EditableDocument` oraz klasy opcji znajdują się w przestrzeni nazw `GroupDocs.Editor`. + +Klasa `DelimitedTextEditOptions` jest punktem wejścia do definiowania separatora (przecinek, tabulator itp.) oraz innych reguł parsowania. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` +## Jak utworzyć edytowalny dokument z pliku CSV? +Wczytaj źródłowy CSV za pomocą `Editor` i wywołaj metodę `Edit`, przekazując instancję `DelimitedTextEditOptions` określającą separator przecinka. Metoda zwraca `EditableDocument`, który możesz manipulować w pamięci. Ten dwustopniowy wzorzec — wczytaj → edytuj — obejmuje scenariusze **read delimited text C#** i zapewnia zachowanie pierwotnej struktury pliku. + ## Krok 1: Uzyskaj ścieżkę do wejściowego pliku DSV -Najpierw musisz określić ścieżkę do wejściowego pliku DSV. W tym przykładzie założymy, że jest to plik CSV. +Najpierw musisz określić absolutną lub względną ścieżkę do źródłowego pliku DSV. Dla demonstracji użyjemy prostego CSV znajdującego się w folderze `Data` projektu. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Krok 2: Utwórz instancję edytora - Utwórz instancję`Editor` klasa. Ta instancja będzie używana do ładowania pliku DSV i manipulowania nim. + +## Krok 2: Utwórz instancję Editor +`Editor` jest klasą rdzeniową, która koordynuje wczytywanie, edycję i zapisywanie. Utworzenie jej przy użyciu obiektu `FileInfo` daje pełną kontrolę nad cyklem życia pliku. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` + ## Krok 3: Utwórz opcje edycji DSV - Następnie utwórz instancję`DelimitedTextEditOptions` i określ ogranicznik dla pliku DSV. Tutaj używamy przecinka jako separatora. +`DelimitedTextEditOptions` informuje edytor, jak interpretować plik. Możesz ustawić separator, czy pierwszy wiersz zawiera nagłówki oraz kodowanie znaków. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` + ## Krok 4: Utwórz instancję EditableDocument - Stworzyć`EditableDocument` przykład za pomocą`Editor.Edit` metoda. Spowoduje to przygotowanie dokumentu do edycji. +`EditableDocument` reprezentuje zmienną wersję pliku źródłowego w pamięci. Wywołanie `Editor.Edit` z opcjami zwraca `EditableDocument`. Ten obiekt przechowuje tekst pliku w zmiennym łańcuchu, gotowy do dowolnej operacji **parse delimited values C#**, której potrzebujesz. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## Krok 5: Edytuj zawartość dokumentu -Pobierz oryginalną treść tekstową i wprowadź niezbędne modyfikacje. Dla celów demonstracyjnych zamieńmy jakiś tekst. +`GetDocumentText()` zwraca bieżący tekst edytowalnego dokumentu jako łańcuch. Pobierz oryginalny tekst za pomocą `EditableDocument.GetDocumentText()`, wykonaj modyfikacje (np. zamień wartość w kolumnie) i zapisz wynik w nowym łańcuchu. To miejsce, w którym **edit CSV .NET** bez ingerencji w niskopoziomowe strumienie plików. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Krok 6: Utwórz dokument edytowalny ze zaktualizowaną zawartością - Stwórz nowy`EditableDocument` z zaktualizowaną zawartością. + +## Krok 6: Utwórz EditableDocument z zaktualizowaną zawartością +Owiń zmodyfikowany łańcuch z powrotem w `EditableDocument`. Ten krok finalizuje zmiany i przygotowuje obiekt do zapisu w dowolnym obsługiwanym formacie. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` + ## Krok 7: Utwórz opcje zapisu CSV -Określ opcje zapisywania formatu CSV, w tym ogranicznik i kodowanie. +`DelimitedTextSaveOptions` określa, jak zapisać edytowaną zawartość z powrotem do pliku CSV. Gdy będziesz gotowy, aby zachować zmiany, skonfiguruj `DelimitedTextSaveOptions`. Możesz podać ten sam separator, inny lub nawet zmienić styl zakończenia linii. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` + ## Krok 8: Utwórz opcje zapisu TSV -Podobnie określ opcje zapisu dla formatu TSV. +Jeśli potrzebujesz wersji rozdzielonej tabulatorem, po prostu zmień separator na `\t`. Ten sam `EditableDocument` może być zapisany wielokrotnie z różnymi opcjami. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Krok 9: Utwórz opcje zapisywania arkusza kalkulacyjnego -Jeśli chcesz zapisać dokument jako arkusz kalkulacyjny, utwórz odpowiednie opcje zapisywania. + +## Krok 9: Utwórz opcje zapisu arkusza kalkulacyjnego +`SpreadsheetSaveOptions` konfiguruje eksport dokumentu do formatów kompatybilnych z Excel, takich jak .xlsx. GroupDocs.Editor umożliwia również eksport edytowanych danych do formatu kompatybilnego z Excel (`.xlsx`). Klasa `SpreadsheetSaveOptions` automatycznie obsługuje typy kolumn, formuły i stylowanie komórek. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` + ## Krok 10: Przygotuj ścieżki zapisu -Określ ścieżki, w których będą zapisywane edytowane pliki. +Zdefiniuj odrębne ścieżki wyjściowe dla każdego formatu. Używanie przejrzystych konwencji nazewnictwa (np. `output.csv`, `output.tsv`, `output.xlsx`) pomaga utrzymać porządek w projekcie. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` + ## Krok 11: Zapisz edytowany dokument -Zapisz edytowany dokument w określonych ścieżkach w różnych formatach. +`Save()` zapisuje dokument na dysku przy użyciu podanych opcji zapisu. Wywołaj `EditableDocument.Save` z odpowiednimi opcjami dla każdego docelowego formatu. API zapisuje plik bezpośrednio na dysku, zachowując oryginalne kodowanie, chyba że je nadpiszesz. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Krok 12: Usuń instancje edytowalnego dokumentu - Na koniec pamiętaj o pozbyciu się`EditableDocument` instancje, aby zwolnić zasoby. + +## Krok 12: Usuń instancje EditableDocument +Zarówno `Editor`, jak i `EditableDocument` implementują `IDisposable`. Ich usunięcie zwalnia uchwyty plików i zasoby niezarządzane, co jest kluczowe przy przetwarzaniu wielu plików w zadaniu wsadowym. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Wniosek -Edycja plików DSV przy użyciu programu GroupDocs.Editor dla .NET to prosty proces obejmujący utworzenie instancji edytora, ustawienie opcji edycji, modyfikację zawartości i zapisanie zmian. Ten przewodnik krok po kroku powinien pomóc w łatwej integracji tej funkcji z aplikacjami .NET. Niezależnie od tego, czy pracujesz z plikami CSV, TSV czy innymi formatami DSV, GroupDocs.Editor dla .NET zapewnia solidne i elastyczne rozwiązanie. -## Często zadawane pytania -### Czy mogę używać GroupDocs.Editor dla .NET do edycji dużych plików CSV? -Tak, GroupDocs.Editor dla .NET jest w stanie efektywnie obsługiwać duże pliki CSV. -### Czy GroupDocs.Editor dla .NET obsługuje inne formaty DSV oprócz CSV i TSV? -Tak, obsługuje różne formaty DSV, o ile określisz odpowiedni ogranicznik. -### Czy można dostosować kodowanie podczas zapisywania plików DSV? -Oczywiście możesz określić żądane kodowanie w opcjach zapisu. -### Czy mogę przekonwertować plik CSV na arkusz kalkulacyjny Excel za pomocą GroupDocs.Editor dla .NET? -Tak, możesz zapisać plik CSV jako arkusz kalkulacyjny Excel, korzystając z odpowiednich opcji zapisywania. -### Gdzie mogę znaleźć więcej dokumentacji dotyczącej GroupDocs.Editor dla .NET? - Można znaleźć szczegółową dokumentację[Tutaj](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Częste problemy i rozwiązania +| Problem | Dlaczego się pojawia | Rozwiązanie | +|---------|----------------------|-------------| +| **Nieoczekiwane dodatkowe cudzysłowy** | Domyślny parser CSV może traktować wbudowane przecinki jako separatory. | Ustaw `EscapeMode = EscapeMode.DoubleQuote` w `DelimitedTextEditOptions`. | +| **Wzrost zużycia pamięci przy dużym pliku** | Ładowanie pliku 500 MB bez strumieniowania. | Użyj `Editor.Load` z `LoadOptions`, które włączają leniwe ładowanie. | +| **Niezgodność kodowania** | Plik źródłowy używa UTF‑16, ale opcje domyślnie ustawione są na UTF‑8. | Jawnie ustaw `Encoding = Encoding.Unicode` w opcjach zapisu. | + +## Najczęściej zadawane pytania + +**Q: Czy mogę używać GroupDocs.Editor dla .NET do edycji dużych plików CSV?** +A: Tak, API strumieniuje dane i może obsługiwać pliki większe niż 1 GB bez ładowania całego dokumentu do pamięci. + +**Q: Czy GroupDocs.Editor dla .NET obsługuje inne formaty DSV poza CSV i TSV?** +A: Absolutnie – każdy jednopunktowy separator (np. pionowa kreska `|`, średnik `;`) jest obsługiwany, o ile zostanie określony w `DelimitedTextEditOptions`. + +**Q: Czy można dostosować kodowanie przy zapisywaniu plików DSV?** +A: Tak, możesz ustawić właściwość `Encoding` w `DelimitedTextSaveOptions` na UTF‑8, UTF‑16, ISO‑8859‑1 lub dowolne kodowanie .NET, którego potrzebujesz. + +**Q: Czy mogę przekonwertować plik CSV na arkusz Excel przy użyciu GroupDocs.Editor dla .NET?** +A: Tak – po edycji wystarczy użyć `SpreadsheetSaveOptions`, aby wyeksportować zawartość jako skoroszyt `.xlsx`. + +**Q: Gdzie mogę znaleźć więcej dokumentacji na temat GroupDocs.Editor dla .NET?** +A: Szczegółowe odniesienia API i przykłady kodu są dostępne **[here](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Ostatnia aktualizacja:** 2026-06-06 +**Testowano z:** GroupDocs.Editor 23.10 for .NET +**Autor:** GroupDocs + +## Powiązane samouczki + +- [Samouczki edycji tekstu zwykłego i dokumentów DSV dla GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Opanuj GroupDocs.Editor .NET dla efektywnej edycji i konwersji dokumentów CSV](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Mistrzostwo ładowania dokumentów w .NET z GroupDocs.Editor: Kompletny przewodnik](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/portuguese/net/document-processing/work-dsv/_index.md b/content/portuguese/net/document-processing/work-dsv/_index.md index ac3423e1..609c84a9 100644 --- a/content/portuguese/net/document-processing/work-dsv/_index.md +++ b/content/portuguese/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Trabalhar com valores separados delimitados (DSV) -linktitle: Trabalhar com valores separados delimitados (DSV) -second_title: API GroupDocs.Editor .NET -description: Aprenda como editar arquivos CSV e TSV usando GroupDocs.Editor for .NET com este guia passo a passo. Melhore seus projetos .NET sem esforço. -weight: 12 -url: /pt/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Aprenda como **criar documentos editáveis** a partir de arquivos CSV + e TSV usando GroupDocs.Editor for .NET. Este guia também mostra como **ler texto + delimitado em C#** e **editar CSV em .NET** de forma eficiente no Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Trabalhar com Valores Delimitados Separados (DSV) – criar documento editável +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Trabalhar com Valores Delimitados Separados (DSV) – criar documento editável type: docs +url: /pt/net/document-processing/work-dsv/ +weight: 12 --- -# Trabalhar com valores separados delimitados (DSV) - -## Introdução -Se você é um desenvolvedor que trabalha com valores separados delimitados (DSV), como arquivos CSV ou TSV, sabe que editar esses arquivos programaticamente pode ser uma tarefa difícil. No entanto, com GroupDocs.Editor for .NET, esta tarefa torna-se significativamente mais simples e eficiente. Neste tutorial, orientaremos você sobre como usar o GroupDocs.Editor for .NET para ler, editar e salvar arquivos DSV. Dividiremos o processo em etapas fáceis de seguir, tornando-o simples para você implementar em seus projetos. -## Pré-requisitos -Antes de mergulharmos no tutorial, certifique-se de ter os seguintes pré-requisitos: -- Visual Studio: certifique-se de ter o Visual Studio instalado em sua máquina. -- GroupDocs.Editor for .NET: você precisará baixar e referenciar a biblioteca GroupDocs.Editor for .NET. Você pode baixá-lo[aqui](https://releases.groupdocs.com/editor/net/). -- Compreensão básica de C#: este tutorial pressupõe que você tenha uma compreensão básica de desenvolvimento em C# e .NET. -## Importar namespaces -Primeiro, você precisa importar os namespaces necessários para o seu projeto. Esses namespaces fornecem as classes e os métodos necessários para trabalhar com GroupDocs.Editor for .NET. + +# Trabalhar com Valores Separados por Delimitador (DSV) – criar documento editável + +Se você é um desenvolvedor .NET que precisa **create editable document** objetos a partir de valores separados por delimitador (DSV) como CSV ou TSV, você está no lugar certo. Nas primeiras 100 palavras explicaremos por que o GroupDocs.Editor para .NET é a forma mais confiável de **read delimited text C#**, editá‑lo e, em seguida, salvá‑lo novamente sem perder a formatação. Você sairá com um fluxo de trabalho completo, pronto para copiar‑e‑colar, que se encaixa naturalmente em qualquer solução Visual Studio. + +## Respostas Rápidas +- **Qual biblioteca lida melhor com edição de CSV em .NET?** GroupDocs.Editor for .NET. +- **Posso editar arquivos CSV grandes no Visual Studio?** Sim – a API transmite dados e evita carregar o arquivo inteiro na memória. +- **Preciso de licença para uso em produção?** É necessária uma licença comercial; uma avaliação gratuita está disponível. +- **Quais formatos posso gerar após a edição?** CSV, TSV e formatos de planilha compatíveis com Excel. +- **A API é compatível com .NET 6+?** Absolutamente – suporta .NET Framework 4.5+, .NET Core 3.1+, .NET 5 e .NET 6. + +## O que é “create editable document” no contexto do GroupDocs.Editor? +**Create editable document** significa gerar uma instância `EditableDocument` que representa uma versão mutável de um arquivo fonte (CSV, TSV, etc.) na memória. Esse objeto permite ler, modificar e salvar novamente o conteúdo usando a mesma API. Ele fornece métodos para recuperar o texto do documento, aplicar alterações e salvá‑lo em vários formatos, garantindo que o alinhamento de colunas e as aspas sejam preservados. + +## Por que usar o GroupDocs.Editor para manipulação de DSV? +GroupDocs.Editor processa **mais de 50 formatos de entrada e saída**, incluindo CSV, TSV e planilhas compatíveis com Excel, mantendo o uso de memória abaixo de 10 MB para arquivos de até 500 MB. Ele também preserva o alinhamento de colunas, regras de aspas e codificações personalizadas automaticamente, o que elimina a necessidade de lógica de análise manual. + +## Pré‑requisitos +Antes de começarmos, certifique‑se de que você tem o seguinte instalado: + +- **Visual Studio** (qualquer edição recente) – você desenvolverá e depurará diretamente dentro da IDE. +- **GroupDocs.Editor for .NET** – baixe o pacote mais recente **[aqui](https://releases.groupdocs.com/editor/net/)**. +- **Conhecimento básico de C#** – o tutorial assume que você pode criar um projeto console ou ASP.NET e adicionar pacotes NuGet. + +## Importar Namespaces +As classes `Editor`, `EditableDocument` e de opções residem no namespace `GroupDocs.Editor`. + +A classe `DelimitedTextEditOptions` é o ponto de entrada para definir o delimitador (vírgula, tabulação, etc.) e outras regras de análise. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,138 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Etapa 1: Obtenha um caminho para o arquivo DSV de entrada -Primeiro, você precisa especificar o caminho para o arquivo DSV de entrada. Neste exemplo, assumiremos que é um arquivo CSV. +## Como criar documento editável a partir de um arquivo CSV? +Carregue o CSV fonte com `Editor` e chame o método `Edit`, passando uma instância `DelimitedTextEditOptions` que especifica um delimitador de vírgula. O método retorna um `EditableDocument` que você pode manipular na memória. Esse padrão de duas etapas—load → edit—cobre cenários de **read delimited text C#** e garante que a estrutura original do arquivo seja mantida. + +## Etapa 1: Obter um caminho para o arquivo DSV de entrada +Primeiro, você precisa especificar o caminho absoluto ou relativo para o arquivo DSV fonte. Para demonstração, usaremos um CSV simples localizado na pasta `Data` do projeto. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Etapa 2: crie uma instância de editor - Crie uma instância do`Editor` aula. Esta instância será usada para carregar e manipular o arquivo DSV. + +## Etapa 2: Criar uma instância do Editor +`Editor` é a classe central que orquestra o carregamento, edição e salvamento. Instanciá‑la com um objeto `FileInfo` lhe dá controle total sobre o ciclo de vida do arquivo. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Etapa 3: criar opções de edição de DSV - Em seguida, crie uma instância de`DelimitedTextEditOptions` e especifique o delimitador para o arquivo DSV. Aqui, usamos uma vírgula como delimitador. + +## Etapa 3: Criar opções de edição DSV +`DelimitedTextEditOptions` informa ao editor como interpretar o arquivo. Você pode definir o delimitador, se a primeira linha contém cabeçalhos e a codificação de caracteres. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Etapa 4: crie uma instância EditableDocument - Criar um`EditableDocument` instância usando o`Editor.Edit` método. Isso prepara o documento para edição. + +## Etapa 4: Criar instância de EditableDocument +`EditableDocument` representa uma versão mutável em memória do arquivo fonte. Chamar `Editor.Edit` com as opções retorna um `EditableDocument`. Esse objeto contém o texto do arquivo em uma string mutável, pronto para qualquer operação **parse delimited values C#** que você precisar. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Etapa 5: edite o conteúdo do documento -Recupere o conteúdo do texto original e faça as modificações necessárias. Para fins de demonstração, vamos substituir algum texto. + +## Etapa 5: Editar o conteúdo do documento +`GetDocumentText()` devolve o texto atual do documento editável como uma string. Recupere o texto original via `EditableDocument.GetDocumentText()`, execute suas modificações (por exemplo, substituir o valor de uma coluna) e armazene o resultado em uma nova string. É aqui que você **edit CSV .NET** sem tocar em fluxos de arquivo de baixo nível. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Etapa 6: crie um EditableDocument com conteúdo atualizado - Crie um novo`EditableDocument` com o conteúdo atualizado. + +## Etapa 6: Criar EditableDocument com conteúdo atualizado +Envolva a string modificada novamente em um `EditableDocument`. Esta etapa finaliza as alterações e prepara o objeto para ser salvo em qualquer formato suportado. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Etapa 7: criar opções para salvar CSV -Especifique as opções de salvamento para o formato CSV, incluindo o delimitador e a codificação. + +## Etapa 7: Criar opções de salvamento CSV +`DelimitedTextSaveOptions` especifica como gravar o conteúdo editado de volta em um arquivo CSV. Quando estiver pronto para persistir as alterações, configure `DelimitedTextSaveOptions`. Você pode especificar o mesmo delimitador, um diferente ou até mudar o estilo de terminação de linha. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Etapa 8: criar opções de salvamento de TSV -Da mesma forma, especifique as opções de salvamento para o formato TSV. + +## Etapa 8: Criar opções de salvamento TSV +Se precisar de uma versão separada por tabulação, basta mudar o delimitador para `\t`. O mesmo `EditableDocument` pode ser salvo várias vezes com opções diferentes. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Etapa 9: criar opções para salvar planilhas -Se você precisar salvar o documento como uma planilha, crie as opções de salvamento correspondentes. + +## Etapa 9: Criar opções de salvamento de planilha +`SpreadsheetSaveOptions` configura a exportação do documento para formatos compatíveis com Excel, como .xlsx. O GroupDocs.Editor também permite exportar os dados editados para um formato compatível com Excel (`.xlsx`). A classe `SpreadsheetSaveOptions` lida automaticamente com tipos de colunas, fórmulas e estilos de célula. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Etapa 10: preparar caminhos para salvar -Defina os caminhos onde os arquivos editados serão salvos. + +## Etapa 10: Preparar caminhos de salvamento +Defina caminhos de saída distintos para cada formato. Usar convenções de nomenclatura claras (por exemplo, `output.csv`, `output.tsv`, `output.xlsx`) ajuda a manter seu projeto organizado. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Etapa 11: salve o documento editado -Salve o documento editado nos caminhos especificados em diferentes formatos. + +## Etapa 11: Salvar o documento editado +`Save()` grava o documento no disco usando as opções de salvamento fornecidas. Chame `EditableDocument.Save` com as opções apropriadas para cada formato de destino. A API grava o arquivo diretamente no disco, preservando a codificação original, a menos que você a sobrescreva. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Etapa 12: descartar instâncias de EditableDocument - Finalmente, certifique-se de descartar o`EditableDocument` instâncias para liberar recursos. + +## Etapa 12: Dispor instâncias de EditableDocument +Tanto `Editor` quanto `EditableDocument` implementam `IDisposable`. Dispor deles libera manipuladores de arquivos e recursos não gerenciados, o que é crucial ao processar muitos arquivos em um trabalho em lote. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusão -edição de arquivos DSV usando GroupDocs.Editor for .NET é um processo simples que envolve a criação de uma instância do editor, configuração de opções de edição, modificação do conteúdo e salvamento das alterações. Este guia passo a passo deve ajudá-lo a integrar essa funcionalidade em seus aplicativos .NET com facilidade. Esteja você trabalhando com CSV, TSV ou outros formatos DSV, o GroupDocs.Editor for .NET oferece uma solução robusta e flexível. -## Perguntas frequentes -### Posso usar o GroupDocs.Editor for .NET para editar arquivos CSV grandes? -Sim, o GroupDocs.Editor for .NET é capaz de lidar com arquivos CSV grandes com eficiência. -### O GroupDocs.Editor for .NET oferece suporte a outros formatos DSV além de CSV e TSV? -Sim, ele oferece suporte a vários formatos DSV, desde que você especifique o delimitador apropriado. -### É possível personalizar a codificação ao salvar arquivos DSV? -Com certeza, você pode especificar a codificação desejada nas opções de salvamento. -### Posso converter um arquivo CSV em uma planilha do Excel usando GroupDocs.Editor for .NET? -Sim, você pode salvar um arquivo CSV como uma planilha do Excel usando as opções de salvamento apropriadas. -### Onde posso encontrar mais documentação sobre GroupDocs.Editor for .NET? - Você pode encontrar documentação detalhada[aqui](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Problemas comuns e soluções +| Problema | Por que acontece | Correção | +|----------|------------------|----------| +| **Aspas extras inesperadas** | O analisador CSV padrão pode tratar vírgulas incorporadas como delimitadores. | Defina `EscapeMode = EscapeMode.DoubleQuote` em `DelimitedTextEditOptions`. | +| **Pico de memória em arquivo grande** | Carregar um arquivo de 500 MB sem streaming. | Use `Editor.Load` com `LoadOptions` que habilitam carregamento preguiçoso. | +| **Incompatibilidade de codificação** | O arquivo fonte usa UTF‑16, mas as opções padrão são UTF‑8. | Defina explicitamente `Encoding = Encoding.Unicode` nas opções de salvamento. | + +## Perguntas Frequentes + +**Q: Posso usar o GroupDocs.Editor para .NET para editar arquivos CSV grandes?** +A: Sim, a API transmite dados e pode lidar com arquivos maiores que 1 GB sem carregar o documento inteiro na memória. + +**Q: O GroupDocs.Editor para .NET suporta outros formatos DSV além de CSV e TSV?** +A: Absolutamente – qualquer delimitador de um único caractere (por exemplo, pipe `|`, ponto‑e‑vírgula `;`) é suportado, desde que você o especifique em `DelimitedTextEditOptions`. + +**Q: É possível personalizar a codificação ao salvar arquivos DSV?** +A: Sim, você pode definir a propriedade `Encoding` em `DelimitedTextSaveOptions` para UTF‑8, UTF‑16, ISO‑8859‑1 ou qualquer `Encoding` .NET que precisar. + +**Q: Posso converter um arquivo CSV para uma planilha Excel usando o GroupDocs.Editor para .NET?** +A: Sim – após a edição, basta usar `SpreadsheetSaveOptions` para exportar o conteúdo como uma pasta de trabalho `.xlsx`. + +**Q: Onde posso encontrar mais documentação sobre o GroupDocs.Editor para .NET?** +A: Referências detalhadas da API e exemplos de código estão disponíveis **[aqui](https://tutorials.groupdocs.com/editor/net/)**. + +**Última atualização:** 2026-06-06 +**Testado com:** GroupDocs.Editor 23.10 para .NET +**Autor:** GroupDocs + +## Tutoriais Relacionados + +- [Tutoriais de edição de documentos de texto simples e DSV para GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Domine o GroupDocs.Editor .NET para edição eficiente de documentos CSV e conversão](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Domínio do carregamento de documentos em .NET com GroupDocs.Editor: Um guia abrangente](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/russian/net/document-processing/work-dsv/_index.md b/content/russian/net/document-processing/work-dsv/_index.md index 129a9eda..2adfe611 100644 --- a/content/russian/net/document-processing/work-dsv/_index.md +++ b/content/russian/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: Работа со значениями, разделенными разделителями (DSV) -linktitle: Работа со значениями, разделенными разделителями (DSV) +date: 2026-06-06 +description: Узнайте, как **создавать редактируемый документ** из файлов CSV и TSV + с помощью GroupDocs.Editor для .NET. Это руководство также показывает, как **читать + разделённый текст C#** и **редактировать CSV .NET** эффективно в Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Работа с разделёнными значениями (DSV) – создание редактируемого документа +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Узнайте, как редактировать файлы CSV и TSV с помощью GroupDocs.Editor для .NET, с помощью этого пошагового руководства. Улучшайте свои проекты .NET без особых усилий. -weight: 12 -url: /ru/net/document-processing/work-dsv/ +title: Работа с разделёнными значениями (DSV) – создание редактируемого документа type: docs +url: /ru/net/document-processing/work-dsv/ +weight: 12 --- -# Работа со значениями, разделенными разделителями (DSV) - -## Введение -Если вы разработчик, работающий со значениями с разделителями-разделителями (DSV), такими как файлы CSV или TSV, вы знаете, что программное редактирование этих файлов может оказаться сложной задачей. Однако с GroupDocs.Editor для .NET эта задача становится значительно проще и эффективнее. В этом руководстве мы покажем вам, как использовать GroupDocs.Editor для .NET для чтения, редактирования и сохранения файлов DSV. Мы разобьем этот процесс на простые для выполнения шаги, чтобы вы могли легко реализовать его в своих проектах. -## Предварительные условия -Прежде чем мы углубимся в руководство, убедитесь, что у вас есть следующие предварительные условия: -- Visual Studio: убедитесь, что на вашем компьютере установлена Visual Studio. -- GroupDocs.Editor для .NET: вам потребуется загрузить библиотеку GroupDocs.Editor for .NET и указать ссылку на нее. Вы можете скачать его[здесь](https://releases.groupdocs.com/editor/net/). -- Базовые знания C#. В этом руководстве предполагается, что у вас есть базовые знания о разработке C# и .NET. -## Импортировать пространства имен -Во-первых, вам необходимо импортировать необходимые пространства имен в ваш проект. Эти пространства имен предоставляют классы и методы, необходимые для работы с GroupDocs.Editor для .NET. + +# Работа с разделенными значениями (DSV) – создание редактируемого документа + +Если вы разработчик .NET, которому нужно **create editable document** из разделенных значений (DSV) таких как CSV или TSV, вы попали по адресу. В первых 100 словах мы объясним, почему GroupDocs.Editor for .NET — самый надежный способ **read delimited text C#**, редактировать его и затем сохранять без потери форматирования. Вы получите готовый к копированию и вставке рабочий процесс, который естественно впишется в любое решение Visual Studio. + +## Быстрые ответы +- **Какая библиотека лучше всего обрабатывает редактирование CSV в .NET?** GroupDocs.Editor for .NET. +- **Могу ли я редактировать большие CSV‑файлы в Visual Studio?** Да — API потоково передаёт данные и избегает загрузки всего файла в память. +- **Нужна ли лицензия для использования в продакшене?** Требуется коммерческая лицензия; доступна бесплатная пробная версия. +- **В каких форматах можно сохранить после редактирования?** CSV, TSV и форматы электронных таблиц, совместимые с Excel. +- **Совместим ли API с .NET 6+?** Абсолютно — поддерживает .NET Framework 4.5+, .NET Core 3.1+, .NET 5 и .NET 6. + +## Что означает «create editable document» в контексте GroupDocs.Editor? +**Create editable document** означает создание экземпляра `EditableDocument`, представляющего изменяемую версию исходного файла (CSV, TSV и т.д.) в памяти. Этот объект позволяет читать, изменять и повторно сохранять содержимое с помощью того же API. Он предоставляет методы для получения текста документа, применения изменений и сохранения его в различных форматах, обеспечивая сохранение выравнивания столбцов и кавычек. + +## Почему стоит использовать GroupDocs.Editor для работы с DSV? +GroupDocs.Editor обрабатывает **более 50 форматов ввода и вывода**, включая CSV, TSV и электронные таблицы, совместимые с Excel, при этом потребление памяти не превышает 10 МБ для файлов размером до 500 МБ. Он также автоматически сохраняет выравнивание столбцов, правила кавычек и пользовательские кодировки, что устраняет необходимость в ручной логике парсинга. + +## Предварительные требования +- **Visual Studio** (любая современная версия) — вы будете разрабатывать и отлаживать непосредственно в IDE. +- **GroupDocs.Editor for .NET** — скачайте последнюю версию **[здесь](https://releases.groupdocs.com/editor/net/)**. +- **Базовые знания C#** — в руководстве предполагается, что вы умеете создавать консольный или ASP.NET проект и добавлять пакеты NuGet. + +## Импорт пространств имён +Классы `Editor`, `EditableDocument` и классы параметров находятся в пространстве имён `GroupDocs.Editor`. + +Класс `DelimitedTextEditOptions` является точкой входа для определения разделителя (запятая, табуляция и т.д.) и других правил парсинга. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Шаг 1. Получите путь к входному файлу DSV -Сначала вам нужно указать путь к входному файлу DSV. В этом примере мы предположим, что это файл CSV. +## Как создать редактируемый документ из CSV‑файла? +Загрузите исходный CSV с помощью `Editor` и вызовите метод `Edit`, передав экземпляр `DelimitedTextEditOptions`, указывающий запятую в качестве разделителя. Метод возвращает `EditableDocument`, которым можно управлять в памяти. Этот двухшаговый шаблон — загрузка → редактирование — покрывает сценарии **read delimited text C#** и гарантирует сохранение исходной структуры файла. + +## Шаг 1: Получите путь к входному DSV‑файлу +Сначала необходимо указать абсолютный или относительный путь к исходному DSV‑файлу. Для демонстрации мы используем простой CSV, расположенный в папке `Data` проекта. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Шаг 2. Создайте экземпляр редактора - Создайте экземпляр`Editor` сорт. Этот экземпляр будет использоваться для загрузки файла DSV и управления им. + +## Шаг 2: Создайте экземпляр Editor +`Editor` — основной класс, который управляет загрузкой, редактированием и сохранением. Создание его экземпляра с объектом `FileInfo` даёт полный контроль над жизненным циклом файла. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Шаг 3. Создайте параметры редактирования DSV - Далее создайте экземпляр`DelimitedTextEditOptions` и укажите разделитель для файла DSV. Здесь мы используем запятую в качестве разделителя. + +## Шаг 3: Создайте параметры редактирования DSV +`DelimitedTextEditOptions` указывает редактору, как интерпретировать файл. Вы можете задать разделитель, содержит ли первая строка заголовки, и кодировку символов. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Шаг 4. Создайте экземпляр EditableDocument - Создать`EditableDocument` экземпляр, используя`Editor.Edit` метод. Это подготавливает документ к редактированию. + +## Шаг 4: Создайте экземпляр EditableDocument +`EditableDocument` представляет изменяемую в памяти версию исходного файла. Вызов `Editor.Edit` с параметрами возвращает `EditableDocument`. Этот объект хранит текст файла в изменяемой строке, готовой к любой операции **parse delimited values C#**, которую вам потребуется выполнить. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Шаг 5. Отредактируйте содержимое документа -Получите исходное текстовое содержимое и внесите необходимые изменения. В демонстрационных целях заменим некоторый текст. + +## Шаг 5: Отредактируйте содержимое документа +`GetDocumentText()` возвращает текущий текст редактируемого документа в виде строки. Получите оригинальный текст через `EditableDocument.GetDocumentText()`, выполните необходимые изменения (например, замените значение столбца) и сохраните результат в новой строке. Здесь вы **edit CSV .NET** без работы с низкоуровневыми файловыми потоками. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Шаг 6. Создайте редактируемый документ с обновленным содержимым - Создать новый`EditableDocument` с обновленным контентом. + +## Шаг 6: Создайте EditableDocument с обновлённым содержимым +Оберните изменённую строку обратно в `EditableDocument`. Этот шаг завершает изменения и подготавливает объект к сохранению в любом поддерживаемом формате. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Шаг 7. Создайте параметры сохранения в формате CSV. -Укажите параметры сохранения для формата CSV, включая разделитель и кодировку. + +## Шаг 7: Создайте параметры сохранения CSV +`DelimitedTextSaveOptions` определяет, как записать отредактированное содержимое обратно в CSV‑файл. Когда вы готовы сохранить изменения, настройте `DelimitedTextSaveOptions`. Вы можете указать тот же разделитель, другой или даже изменить стиль окончания строк. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Шаг 8. Создайте параметры сохранения TSV. -Аналогичным образом укажите параметры сохранения для формата TSV. + +## Шаг 8: Создайте параметры сохранения TSV +Если вам нужна версия с разделителями‑табуляциями, просто смените разделитель на `\t`. Один и тот же `EditableDocument` можно сохранять несколько раз с разными параметрами. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Шаг 9: Создайте параметры сохранения электронной таблицы -Если вам нужно сохранить документ в виде электронной таблицы, создайте соответствующие параметры сохранения. + +## Шаг 9: Создайте параметры сохранения электронных таблиц +`SpreadsheetSaveOptions` настраивает экспорт документа в форматы, совместимые с Excel, такие как .xlsx. GroupDocs.Editor также позволяет экспортировать отредактированные данные в формат, совместимый с Excel (`.xlsx`). Класс `SpreadsheetSaveOptions` автоматически обрабатывает типы столбцов, формулы и стили ячеек. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Шаг 10: Подготовьте пути сохранения -Определите пути, по которым будут сохраняться отредактированные файлы. + +## Шаг 10: Подготовьте пути сохранения +Определите отдельные пути вывода для каждого формата. Использование понятных соглашений об именовании (например, `output.csv`, `output.tsv`, `output.xlsx`) помогает поддерживать порядок в проекте. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Шаг 11: Сохраните отредактированный документ -Сохраните отредактированный документ по указанным путям в разных форматах. + +## Шаг 11: Сохраните отредактированный документ +`Save()` записывает документ на диск, используя предоставленные параметры сохранения. Вызовите `EditableDocument.Save` с соответствующими параметрами для каждого целевого формата. API записывает файл напрямую на диск, сохраняя оригинальную кодировку, если вы её не переопределяете. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Шаг 12. Удалите экземпляры EditableDocument - Наконец, обязательно утилизируйте`EditableDocument` экземпляры для освобождения ресурсов. + +## Шаг 12: Освободите экземпляры EditableDocument +И `Editor`, и `EditableDocument` реализуют `IDisposable`. Их освобождение закрывает файловые дескрипторы и неуправляемые ресурсы, что критично при обработке большого количества файлов в пакетной задаче. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Заключение -Редактирование файлов DSV с помощью GroupDocs.Editor для .NET — это простой процесс, который включает в себя создание экземпляра редактора, настройку параметров редактирования, изменение содержимого и сохранение изменений. Это пошаговое руководство поможет вам легко интегрировать эту функцию в ваши приложения .NET. Независимо от того, работаете ли вы с CSV, TSV или другими форматами DSV, GroupDocs.Editor для .NET предоставляет надежное и гибкое решение. + +## Распространённые проблемы и решения +| Проблема | Почему происходит | Решение | +|----------|-------------------|---------| +| **Неожиданные лишние кавычки** | Стандартный CSV‑парсер может рассматривать запятые внутри полей как разделители. | Установите `EscapeMode = EscapeMode.DoubleQuote` в `DelimitedTextEditOptions`. | +| **Резкий рост памяти при большом файле** | Загрузка файла размером 500 МБ без потоковой обработки. | Используйте `Editor.Load` с `LoadOptions`, включающими ленивую загрузку. | +| **Несоответствие кодировок** | Исходный файл использует UTF‑16, а параметры по умолчанию — UTF‑8. | Явно задайте `Encoding = Encoding.Unicode` в параметрах сохранения. | + ## Часто задаваемые вопросы -### Могу ли я использовать GroupDocs.Editor для .NET для редактирования больших файлов CSV? -Да, GroupDocs.Editor для .NET способен эффективно обрабатывать большие файлы CSV. -### Поддерживает ли GroupDocs.Editor для .NET другие форматы DSV, кроме CSV и TSV? -Да, он поддерживает различные форматы DSV, если вы укажете соответствующий разделитель. -### Можно ли настроить кодировку при сохранении файлов DSV? -Конечно, в настройках сохранения можно указать нужную кодировку. -### Могу ли я преобразовать файл CSV в электронную таблицу Excel с помощью GroupDocs.Editor для .NET? -Да, вы можете сохранить файл CSV как электронную таблицу Excel, используя соответствующие параметры сохранения. -### Где я могу найти дополнительную документацию по GroupDocs.Editor для .NET? - Вы можете найти подробную документацию[здесь](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: Могу ли я использовать GroupDocs.Editor for .NET для редактирования больших CSV‑файлов?** +A: Да, API потоково передаёт данные и может обрабатывать файлы размером более 1 ГБ без загрузки всего документа в память. + +**Q: Поддерживает ли GroupDocs.Editor for .NET другие форматы DSV, помимо CSV и TSV?** +A: Абсолютно — любой однобайтовый разделитель (например, вертикальная черта `|`, точка с запятой `;`) поддерживается, если указать его в `DelimitedTextEditOptions`. + +**Q: Можно ли настроить кодировку при сохранении DSV‑файлов?** +A: Да, вы можете задать свойство `Encoding` в `DelimitedTextSaveOptions` как UTF‑8, UTF‑16, ISO‑8859‑1 или любую другую .NET `Encoding`, которая вам нужна. + +**Q: Могу ли я конвертировать CSV‑файл в электронную таблицу Excel с помощью GroupDocs.Editor for .NET?** +A: Да — после редактирования просто используйте `SpreadsheetSaveOptions` для экспорта содержимого в рабочую книгу `.xlsx`. + +**Q: Где я могу найти более подробную документацию по GroupDocs.Editor for .NET?** +A: Подробные справочники API и примеры кода доступны **[здесь](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Последнее обновление:** 2026-06-06 +**Тестировано с:** GroupDocs.Editor 23.10 for .NET +**Автор:** GroupDocs + +## Связанные руководства + +- [Руководства по редактированию Plain Text и DSV документов для GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Освойте GroupDocs.Editor .NET для эффективного редактирования CSV‑документов и конвертации](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Мастерство загрузки документов в .NET с GroupDocs.Editor: Полное руководство](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/spanish/net/document-processing/work-dsv/_index.md b/content/spanish/net/document-processing/work-dsv/_index.md index ad2ea4c8..c3747e11 100644 --- a/content/spanish/net/document-processing/work-dsv/_index.md +++ b/content/spanish/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Trabajar con valores separados delimitados (DSV) -linktitle: Trabajar con valores separados delimitados (DSV) -second_title: API GroupDocs.Editor .NET -description: Aprenda a editar archivos CSV y TSV usando GroupDocs.Editor para .NET con esta guía paso a paso. Mejore sus proyectos .NET sin esfuerzo. -weight: 12 -url: /es/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Aprenda cómo **crear documentos editables** a partir de archivos CSV + y TSV usando GroupDocs.Editor para .NET. Esta guía también muestra cómo **leer texto + delimitado C#** y **editar CSV .NET** de manera eficiente en Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Trabajar con valores separados delimitados (DSV) – crear documento editable +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Trabajar con valores separados delimitados (DSV) – crear documento editable type: docs +url: /es/net/document-processing/work-dsv/ +weight: 12 --- -# Trabajar con valores separados delimitados (DSV) -## Introducción -Si es un desarrollador que trabaja con valores separados delimitados (DSV), como archivos CSV o TSV, sabe que editar estos archivos mediante programación puede ser una tarea desalentadora. Sin embargo, con GroupDocs.Editor para .NET, esta tarea se vuelve significativamente más sencilla y eficiente. En este tutorial, le explicaremos cómo utilizar GroupDocs.Editor para .NET para leer, editar y guardar archivos DSV. Dividiremos el proceso en pasos fáciles de seguir, para que usted pueda implementarlo en sus proyectos. +# Trabajar con valores separados delimitados (DSV) – crear documento editable + +Si eres un desarrollador .NET que necesita **create editable document** objetos a partir de valores separados delimitados (DSV) como CSV o TSV, has llegado al lugar correcto. En las primeras 100 palabras explicaremos por qué GroupDocs.Editor para .NET es la forma más fiable de **read delimited text C#**, editarlo y luego guardarlo sin perder el formato. Saldrás con un flujo de trabajo completo, listo para copiar‑y‑pegar, que encaja de forma natural en cualquier solución de Visual Studio. + +## Respuestas rápidas +- **¿Qué biblioteca maneja la edición de CSV mejor en .NET?** GroupDocs.Editor for .NET. +- **¿Puedo editar archivos CSV grandes en Visual Studio?** Sí – la API transmite datos y evita cargar todo el archivo en memoria. +- **¿Necesito una licencia para uso en producción?** Se requiere una licencia comercial; hay una prueba gratuita disponible. +- **¿Qué formatos puedo exportar después de la edición?** CSV, TSV y formatos de hoja de cálculo compatibles con Excel. +- **¿Es la API compatible con .NET 6+?** Absolutamente – soporta .NET Framework 4.5+, .NET Core 3.1+, .NET 5 y .NET 6. + +## Qué es “create editable document” en el contexto de GroupDocs.Editor? +**Create editable document** significa generar una instancia `EditableDocument` que representa una versión mutable de un archivo fuente (CSV, TSV, etc.) en memoria. Este objeto te permite leer, modificar y volver a guardar el contenido usando la misma API. Proporciona métodos para obtener el texto del documento, aplicar cambios y guardarlo en varios formatos, asegurando que la alineación de columnas y las comillas se conserven. + +## Por qué usar GroupDocs.Editor para el manejo de DSV? +GroupDocs.Editor procesa **more than 50 input and output formats**, incluyendo CSV, TSV y hojas de cálculo compatibles con Excel, mientras mantiene el uso de memoria por debajo de 10 MB para archivos de hasta 500 MB. También preserva la alineación de columnas, las reglas de comillas y las codificaciones personalizadas automáticamente, lo que elimina la necesidad de lógica de análisis manual. + ## Requisitos previos -Antes de sumergirnos en el tutorial, asegúrese de tener los siguientes requisitos previos: -- Visual Studio: asegúrese de tener Visual Studio instalado en su máquina. -- GroupDocs.Editor para .NET: deberá descargar y consultar la biblioteca GroupDocs.Editor para .NET. Puedes descargarlo[aquí](https://releases.groupdocs.com/editor/net/). -- Comprensión básica de C#: este tutorial asume que tiene conocimientos básicos de desarrollo de C# y .NET. +Antes de profundizar, asegúrate de tener lo siguiente instalado: + +- **Visual Studio** (cualquier edición reciente) – desarrollarás y depurarás directamente dentro del IDE. +- **GroupDocs.Editor for .NET** – descarga el paquete más reciente **[aquí](https://releases.groupdocs.com/editor/net/)**. +- **Basic C# knowledge** – el tutorial asume que puedes crear un proyecto de consola o ASP.NET y agregar paquetes NuGet. + ## Importar espacios de nombres -Primero, necesita importar los espacios de nombres necesarios en su proyecto. Estos espacios de nombres proporcionan las clases y métodos necesarios para trabajar con GroupDocs.Editor para .NET. +Las clases `Editor`, `EditableDocument` y de opciones se encuentran en el espacio de nombres `GroupDocs.Editor`. + +La clase `DelimitedTextEditOptions` es el punto de entrada para definir el delimitador (coma, tabulación, etc.) y otras reglas de análisis. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Paso 1: obtener una ruta al archivo DSV de entrada -Primero, debe especificar la ruta al archivo DSV de entrada. Para este ejemplo, asumiremos que es un archivo CSV. +## Cómo crear un documento editable a partir de un archivo CSV? +Carga el CSV fuente con `Editor` y llama al método `Edit`, pasando una instancia de `DelimitedTextEditOptions` que especifica un delimitador de coma. El método devuelve un `EditableDocument` que puedes manipular en memoria. Este patrón de dos pasos—cargar → editar—cubre escenarios de **read delimited text C#** y garantiza que se conserve la estructura original del archivo. + +## Paso 1: Obtener una ruta al archivo DSV de entrada +Primero, debes especificar la ruta absoluta o relativa al archivo DSV fuente. Para la demostración usaremos un CSV sencillo ubicado en la carpeta `Data` del proyecto. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Paso 2: crear una instancia de editor - Crear una instancia del`Editor` clase. Esta instancia se utilizará para cargar y manipular el archivo DSV. + +## Paso 2: Crear una instancia de Editor +`Editor` es la clase central que orquesta la carga, edición y guardado. Instanciarla con un objeto `FileInfo` te brinda control total sobre el ciclo de vida del archivo. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Paso 3: crear opciones de edición de DSV - A continuación, cree una instancia de`DelimitedTextEditOptions` y especifique el delimitador del archivo DSV. Aquí utilizamos una coma como delimitador. + +## Paso 3: Crear opciones de edición DSV +`DelimitedTextEditOptions` indica al editor cómo interpretar el archivo. Puedes establecer el delimitador, si la primera fila contiene encabezados y la codificación de caracteres. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Paso 4: crear una instancia de EditableDocument - Crear un`EditableDocument` instancia utilizando el`Editor.Edit` método. Esto prepara el documento para su edición. + +## Paso 4: Crear una instancia de EditableDocument +`EditableDocument` representa una versión mutable en memoria del archivo fuente. Llamar a `Editor.Edit` con las opciones devuelve un `EditableDocument`. Este objeto contiene el texto del archivo en una cadena mutable, listo para cualquier operación **parse delimited values C#** que necesites. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Paso 5: edite el contenido del documento -Recuperar el contenido del texto original y realizar las modificaciones necesarias. Para fines de demostración, reemplacemos parte del texto. + +## Paso 5: Editar el contenido del documento +`GetDocumentText()` devuelve el texto actual del documento editable como una cadena. Recupera el texto original mediante `EditableDocument.GetDocumentText()`, realiza tus modificaciones (p.ej., reemplazar el valor de una columna) y guarda el resultado en una nueva cadena. Aquí es donde **edit CSV .NET** sin tocar flujos de archivo de bajo nivel. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Paso 6: cree un documento editable con contenido actualizado - Crear un nuevo`EditableDocument` con el contenido actualizado. + +## Paso 6: Crear un EditableDocument con contenido actualizado +Envuelve la cadena modificada nuevamente en un `EditableDocument`. Este paso finaliza los cambios y prepara el objeto para guardarlo en cualquier formato compatible. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Paso 7: cree opciones de guardado CSV -Especifique las opciones de guardado para el formato CSV, incluido el delimitador y la codificación. + +## Paso 7: Crear opciones de guardado CSV +`DelimitedTextSaveOptions` especifica cómo escribir el contenido editado de vuelta a un archivo CSV. Cuando estés listo para persistir los cambios, configura `DelimitedTextSaveOptions`. Puedes especificar el mismo delimitador, uno diferente o incluso cambiar el estilo de terminación de línea. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Paso 8: cree opciones de guardado de TSV -De manera similar, especifique las opciones de guardado para el formato TSV. + +## Paso 8: Crear opciones de guardado TSV +Si necesitas una versión separada por tabulaciones, simplemente cambia el delimitador a `\t`. El mismo `EditableDocument` puede guardarse múltiples veces con diferentes opciones. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Paso 9: crear opciones para guardar la hoja de cálculo -Si necesita guardar el documento como una hoja de cálculo, cree las opciones de guardado correspondientes. + +## Paso 9: Crear opciones de guardado de hoja de cálculo +`SpreadsheetSaveOptions` configura la exportación del documento a formatos compatibles con Excel como .xlsx. GroupDocs.Editor también te permite exportar los datos editados a un formato compatible con Excel (`.xlsx`). La clase `SpreadsheetSaveOptions` maneja automáticamente los tipos de columna, fórmulas y estilo de celdas. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Paso 10: preparar rutas de guardado -Defina las rutas donde se guardarán los archivos editados. + +## Paso 10: Preparar rutas de guardado +Define rutas de salida distintas para cada formato. Usar convenciones de nombres claras (p.ej., `output.csv`, `output.tsv`, `output.xlsx`) ayuda a mantener tu proyecto organizado. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Paso 11: guarde el documento editado -Guarde el documento editado en las rutas especificadas en diferentes formatos. + +## Paso 11: Guardar el documento editado +`Save()` escribe el documento en disco usando las opciones de guardado proporcionadas. Invoca `EditableDocument.Save` con las opciones apropiadas para cada formato de destino. La API escribe el archivo directamente en disco, preservando la codificación original a menos que la sobrescribas. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Paso 12: Eliminar instancias de EditableDocument - Finalmente, asegúrese de desechar el`EditableDocument` instancias para liberar recursos. + +## Paso 12: Liberar instancias de EditableDocument +Tanto `Editor` como `EditableDocument` implementan `IDisposable`. Liberarlos libera los manejadores de archivo y recursos no administrados, lo cual es crucial al procesar muchos archivos en un trabajo por lotes. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Conclusión -Editar archivos DSV usando GroupDocs.Editor para .NET es un proceso sencillo que implica crear una instancia de editor, configurar opciones de edición, modificar el contenido y guardar los cambios. Esta guía paso a paso debería ayudarle a integrar esta funcionalidad en sus aplicaciones .NET con facilidad. Ya sea que esté trabajando con CSV, TSV u otros formatos DSV, GroupDocs.Editor para .NET proporciona una solución sólida y flexible. + +## Problemas comunes y soluciones +| Problema | Por qué ocurre | Solución | +|----------|----------------|----------| +| **Unexpected extra quotes** | El analizador CSV predeterminado puede tratar comas incrustadas como delimitadores. | Establece `EscapeMode = EscapeMode.DoubleQuote` en `DelimitedTextEditOptions`. | +| **Large file memory spike** | Cargar un archivo de 500 MB sin transmisión. | Usa `Editor.Load` con `LoadOptions` que habiliten la carga diferida. | +| **Encoding mismatch** | El archivo fuente usa UTF‑16 pero las opciones por defecto son UTF‑8. | Establece explícitamente `Encoding = Encoding.Unicode` en las opciones de guardado. | + ## Preguntas frecuentes -### ¿Puedo usar GroupDocs.Editor para .NET para editar archivos CSV grandes? -Sí, GroupDocs.Editor para .NET es capaz de manejar archivos CSV grandes de manera eficiente. -### ¿GroupDocs.Editor para .NET admite otros formatos DSV además de CSV y TSV? -Sí, admite varios formatos DSV siempre que especifique el delimitador adecuado. -### ¿Es posible personalizar la codificación al guardar archivos DSV? -Por supuesto, puede especificar la codificación deseada en las opciones de guardar. -### ¿Puedo convertir un archivo CSV a una hoja de cálculo de Excel usando GroupDocs.Editor para .NET? -Sí, puede guardar un archivo CSV como una hoja de cálculo de Excel utilizando las opciones de guardado adecuadas. -### ¿Dónde puedo encontrar más documentación sobre GroupDocs.Editor para .NET? - Puedes encontrar documentación detallada.[aquí](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: ¿Puedo usar GroupDocs.Editor para .NET para editar archivos CSV grandes?** +A: Sí, la API transmite datos y puede manejar archivos de más de 1 GB sin cargar todo el documento en memoria. + +**Q: ¿GroupDocs.Editor para .NET admite otros formatos DSV además de CSV y TSV?** +A: Absolutamente – cualquier delimitador de un solo carácter (p.ej., barra vertical `|`, punto y coma `;`) es compatible siempre que lo especifiques en `DelimitedTextEditOptions`. + +**Q: ¿Es posible personalizar la codificación al guardar archivos DSV?** +A: Sí, puedes establecer la propiedad `Encoding` en `DelimitedTextSaveOptions` a UTF‑8, UTF‑16, ISO‑8859‑1, o cualquier `Encoding` de .NET que necesites. + +**Q: ¿Puedo convertir un archivo CSV a una hoja de cálculo Excel usando GroupDocs.Editor para .NET?** +A: Sí – después de editar, simplemente usa `SpreadsheetSaveOptions` para exportar el contenido como un libro de trabajo `.xlsx`. + +**Q: ¿Dónde puedo encontrar más documentación sobre GroupDocs.Editor para .NET?** +A: Referencias detalladas de la API y ejemplos de código están disponibles **[aquí](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Última actualización:** 2026-06-06 +**Probado con:** GroupDocs.Editor 23.10 for .NET +**Autor:** GroupDocs + +## Tutoriales relacionados + +- [Tutoriales de edición de documentos de texto plano y DSV para GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Domina GroupDocs.Editor .NET para la edición y conversión eficiente de documentos CSV](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Dominar la carga de documentos en .NET con GroupDocs.Editor: Guía completa](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/swedish/net/document-processing/work-dsv/_index.md b/content/swedish/net/document-processing/work-dsv/_index.md index 3eba34b4..c35eea09 100644 --- a/content/swedish/net/document-processing/work-dsv/_index.md +++ b/content/swedish/net/document-processing/work-dsv/_index.md @@ -1,23 +1,74 @@ --- -title: Arbeta med avgränsade separerade värden (DSV) -linktitle: Arbeta med avgränsade separerade värden (DSV) +date: 2026-06-06 +description: Lär dig hur du **skapar redigerbart dokument** objekt från CSV- och TSV-filer + med GroupDocs.Editor for .NET. Denna guide visar också hur du **läser avgränsad + text C#** och **redigerar CSV .NET** effektivt i Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Arbeta med avgränsade separerade värden (DSV) – skapa redigerbart dokument +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Lär dig hur du redigerar CSV- och TSV-filer med GroupDocs.Editor för .NET med denna steg-för-steg-guide. Förbättra dina .NET-projekt utan ansträngning. -weight: 12 -url: /sv/net/document-processing/work-dsv/ +title: Arbeta med avgränsade separerade värden (DSV) – skapa redigerbart dokument type: docs +url: /sv/net/document-processing/work-dsv/ +weight: 12 --- -# Arbeta med avgränsade separerade värden (DSV) -## Introduktion -Om du är en utvecklare som arbetar med avgränsade separerade värden (DSV) som CSV- eller TSV-filer, vet du att det kan vara en skrämmande uppgift att redigera dessa filer programmatiskt. Men med GroupDocs.Editor för .NET blir denna uppgift betydligt enklare och effektivare. I den här handledningen går vi igenom hur du använder GroupDocs.Editor för .NET för att läsa, redigera och spara DSV-filer. Vi delar upp processen i steg som är lätta att följa, vilket gör det enkelt för dig att implementera i dina projekt. +# Arbeta med avgränsade separerade värden (DSV) – skapa redigerbart dokument + +Om du är en .NET‑utvecklare som behöver **create editable document**‑objekt från avgränsade separerade värden (DSV) såsom CSV eller TSV, har du kommit till rätt ställe. På de första 100 orden förklarar vi varför GroupDocs.Editor för .NET är det mest pålitliga sättet att **read delimited text C#**, redigera det och sedan spara tillbaka utan att förlora formatering. Du får ett komplett, kopiera‑och‑klistra‑klart arbetsflöde som passar naturligt i vilken Visual Studio‑lösning som helst. + +## Snabba svar +- **Vilket bibliotek hanterar CSV‑redigering bäst i .NET?** GroupDocs.Editor for .NET. +- **Kan jag redigera stora CSV‑filer i Visual Studio?** Ja – API‑et strömmar data och undviker att ladda hela filen i minnet. +- **Behöver jag en licens för produktionsanvändning?** En kommersiell licens krävs; en gratis provversion finns tillgänglig. +- **Vilka format kan jag exportera efter redigering?** CSV, TSV och Excel‑kompatibla kalkylbladsformat. +- **Är API‑et kompatibelt med .NET 6+?** Absolut – det stödjer .NET Framework 4.5+, .NET Core 3.1+, .NET 5 och .NET 6. + +## Vad betyder “create editable document” i samband med GroupDocs.Editor? +**Create editable document** betyder att generera en `EditableDocument`‑instans som representerar en muterbar version av en källfil (CSV, TSV, etc.) i minnet. Detta objekt låter dig läsa, modifiera och spara om innehållet med samma API. Det erbjuder metoder för att hämta dokumenttexten, tillämpa ändringar och spara tillbaka i olika format, vilket säkerställer att kolumnjustering och citattecken bevaras. + +## Varför använda GroupDocs.Editor för DSV‑hantering? +GroupDocs.Editor hanterar **more than 50 input and output formats**, inklusive CSV, TSV och Excel‑kompatibla kalkylblad, samtidigt som minnesanvändningen hålls under 10 MB för filer upp till 500 MB. Det bevarar också kolumnjustering, citeringsregler och anpassade kodningar automatiskt, vilket eliminerar behovet av manuell parsning. + ## Förutsättningar -Innan vi dyker in i handledningen, se till att du har följande förutsättningar: -- Visual Studio: Se till att du har Visual Studio installerat på din dator. -- GroupDocs.Editor för .NET: Du måste ladda ner och referera till GroupDocs.Editor for .NET-biblioteket. Du kan ladda ner den[här](https://releases.groupdocs.com/editor/net/). -- Grundläggande förståelse för C#: Denna handledning förutsätter att du har en grundläggande förståelse för C#- och .NET-utveckling. -## Importera namnområden -Först måste du importera de nödvändiga namnrymden i ditt projekt. Dessa namnområden tillhandahåller de klasser och metoder som krävs för att arbeta med GroupDocs.Editor för .NET. +- **Visual Studio** (any recent edition) – du kommer att utveckla och felsöka direkt i IDE:n. +- **GroupDocs.Editor for .NET** – ladda ner det senaste paketet **[här](https://releases.groupdocs.com/editor/net/)**. +- **Basic C# knowledge** – handledningen förutsätter att du kan skapa ett konsol‑ eller ASP.NET‑projekt och lägga till NuGet‑paket. + +## Importera namnrymder +`Editor`, `EditableDocument` och alternativklasserna finns i namnrymden `GroupDocs.Editor`. + +`DelimitedTextEditOptions`‑klassen är ingångspunkten för att definiera avgränsaren (komma, tab, etc.) och andra parsningsregler. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +77,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Steg 1: Hämta en sökväg till DSV-inmatningsfilen -Först måste du ange sökvägen till DSV-inmatningsfilen. I det här exemplet antar vi att det är en CSV-fil. +## Hur skapar man ett redigerbart dokument från en CSV‑fil? +Läs in käll‑CSV‑filen med `Editor` och anropa `Edit`‑metoden, där du skickar med en `DelimitedTextEditOptions`‑instans som specificerar kommatecken som avgränsare. Metoden returnerar ett `EditableDocument` som du kan manipulera i minnet. Detta tvåstegs‑mönster—load → edit—täckar **read delimited text C#**‑scenarier och garanterar att den ursprungliga filstrukturen bevaras. + +## Steg 1: Hämta en sökväg till indata‑DSV‑filen +Först måste du ange den absoluta eller relativa sökvägen till käll‑DSV‑filen. För demonstration använder vi en enkel CSV‑fil som ligger i projektets `Data`‑mapp. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Steg 2: Skapa en Editor-instans - Skapa en instans av`Editor` klass. Denna instans kommer att användas för att ladda och manipulera DSV-filen. + +## Steg 2: Skapa en Editor‑instans +`Editor` är kärnklassen som orkestrerar inläsning, redigering och sparning. Att instansiera den med ett `FileInfo`‑objekt ger dig full kontroll över filens livscykel. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Steg 3: Skapa DSV-redigeringsalternativ - Skapa sedan en instans av`DelimitedTextEditOptions` och ange avgränsaren för DSV-filen. Här använder vi ett kommatecken som avgränsare. + +## Steg 3: Skapa DSV‑redigeringsalternativ +`DelimitedTextEditOptions` talar om för editorn hur filen ska tolkas. Du kan ange avgränsare, om den första raden innehåller rubriker samt teckenkodning. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Steg 4: Skapa en EditableDocument-instans - Skapa en`EditableDocument` instans med hjälp av`Editor.Edit` metod. Detta förbereder dokumentet för redigering. + +## Steg 4: Skapa en EditableDocument‑instans +`EditableDocument` representerar en muterbar version av källfilen i minnet. Att anropa `Editor.Edit` med alternativen returnerar ett `EditableDocument`. Detta objekt innehåller filens text i en muterbar sträng, redo för vilken **parse delimited values C#**‑operation du än behöver. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Steg 5: Redigera dokumentinnehållet -Hämta det ursprungliga textinnehållet och gör nödvändiga ändringar. Låt oss ersätta lite text i demonstrationssyfte. + +## Steg 5: Redigera dokumentets innehåll +`GetDocumentText()` returnerar den aktuella texten i det redigerbara dokumentet som en sträng. Hämta originaltexten via `EditableDocument.GetDocumentText()`, utför dina modifieringar (t.ex. ersätt ett kolumnvärde) och lagra resultatet i en ny sträng. Här kan du **edit CSV .NET** utan att röra lågnivå‑filströmmar. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Steg 6: Skapa ett redigerbart dokument med uppdaterat innehåll - Skapa en ny`EditableDocument` med det uppdaterade innehållet. + +## Steg 6: Skapa ett EditableDocument med uppdaterat innehåll +Packa in den modifierade strängen tillbaka i ett `EditableDocument`. Detta steg slutför ändringarna och förbereder objektet för sparning i vilket stödformat som helst. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Steg 7: Skapa CSV-sparalternativ -Ange sparalternativ för CSV-format, inklusive avgränsare och kodning. + +## Steg 7: Skapa CSV‑spara‑alternativ +`DelimitedTextSaveOptions` specificerar hur det redigerade innehållet ska skrivas tillbaka till en CSV‑fil. När du är redo att spara ändringarna, konfigurera `DelimitedTextSaveOptions`. Du kan ange samma avgränsare, en annan, eller till och med ändra radslut‑stilen. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Steg 8: Skapa TSV-sparalternativ -På samma sätt, ange sparalternativen för TSV-format. + +## Steg 8: Skapa TSV‑spara‑alternativ +Om du behöver en tab‑separerad version, byt helt enkelt avgränsaren till `\t`. Samma `EditableDocument` kan sparas flera gånger med olika alternativ. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Steg 9: Skapa sparalternativ för kalkylblad -Om du behöver spara dokumentet som ett kalkylblad, skapa motsvarande sparalternativ. + +## Steg 9: Skapa kalkylblads‑spara‑alternativ +`SpreadsheetSaveOptions` konfigurerar export av dokumentet till Excel‑kompatibla format som .xlsx. GroupDocs.Editor låter dig också exportera de redigerade data till ett Excel‑kompatibelt format (`.xlsx`). `SpreadsheetSaveOptions`‑klassen hanterar kolumntyper, formler och cellformat automatiskt. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Steg 10: Förbered Spara sökvägar -Definiera sökvägarna där de redigerade filerna ska sparas. + +## Steg 10: Förbered spara‑sökvägar +Definiera separata utdata‑sökvägar för varje format. Att använda tydliga namngivningskonventioner (t.ex. `output.csv`, `output.tsv`, `output.xlsx`) hjälper till att hålla ditt projekt organiserat. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` + ## Steg 11: Spara det redigerade dokumentet -Spara det redigerade dokumentet till de angivna sökvägarna i olika format. +`Save()` skriver dokumentet till disk med de angivna spara‑alternativen. Anropa `EditableDocument.Save` med lämpliga alternativ för varje målformat. API‑et skriver filen direkt till disk och bevarar den ursprungliga kodningen om du inte åsidosätter den. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Steg 12: Kasta EditableDocument Instances - Slutligen, se till att kassera`EditableDocument` instanser för att frigöra resurser. + +## Steg 12: Disposera EditableDocument‑instanser +Både `Editor` och `EditableDocument` implementerar `IDisposable`. Att disponera dem frigör filhandtag och ohanterade resurser, vilket är avgörande när man bearbetar många filer i ett batchjobb. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Slutsats -Att redigera DSV-filer med GroupDocs.Editor för .NET är en enkel process som innebär att skapa en redigeringsinstans, ställa in redigeringsalternativ, ändra innehållet och spara ändringarna. Den här steg-för-steg-guiden bör hjälpa dig att enkelt integrera denna funktion i dina .NET-applikationer. Oavsett om du arbetar med CSV, TSV eller andra DSV-format erbjuder GroupDocs.Editor för .NET en robust och flexibel lösning. -## FAQ's -### Kan jag använda GroupDocs.Editor för .NET för att redigera stora CSV-filer? -Ja, GroupDocs.Editor för .NET kan hantera stora CSV-filer effektivt. -### Stöder GroupDocs.Editor för .NET andra DSV-format förutom CSV och TSV? -Ja, den stöder olika DSV-format så länge du anger lämplig avgränsare. -### Är det möjligt att anpassa kodningen när du sparar DSV-filer? -Absolut, du kan ange önskad kodning i sparalternativen. -### Kan jag konvertera en CSV-fil till ett Excel-kalkylblad med GroupDocs.Editor för .NET? -Ja, du kan spara en CSV-fil som ett Excel-kalkylblad genom att använda lämpliga sparaalternativ. -### Var kan jag hitta mer dokumentation om GroupDocs.Editor för .NET? - Du kan hitta detaljerad dokumentation[här](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Vanliga problem och lösningar +| Problem | Varför det händer | Lösning | +|-------|----------------|-----| +| **Oväntade extra citattecken** | Standard‑CSV‑parsern kan behandla inbäddade kommatecken som avgränsare. | Ställ in `EscapeMode = EscapeMode.DoubleQuote` i `DelimitedTextEditOptions`. | +| **Stort minnesutslag för stora filer** | Laddar en 500 MB‑fil utan strömning. | Använd `Editor.Load` med `LoadOptions` som möjliggör lazy loading. | +| **Kodningsfel** | Källfilen använder UTF‑16 men alternativen är standardinställda på UTF‑8. | Ange explicit `Encoding = Encoding.Unicode` i spara‑alternativen. | + +## Vanliga frågor + +**Q: Kan jag använda GroupDocs.Editor för .NET för att redigera stora CSV‑filer?** +A: Ja, API‑et strömmar data och kan hantera filer större än 1 GB utan att ladda hela dokumentet i minnet. + +**Q: Stöder GroupDocs.Editor för .NET andra DSV‑format förutom CSV och TSV?** +A: Absolut – vilken som helst enkelsymbol‑avgränsare (t.ex. pipe `|`, semikolon `;`) stöds så länge du specificerar den i `DelimitedTextEditOptions`. + +**Q: Är det möjligt att anpassa kodningen vid sparning av DSV‑filer?** +A: Ja, du kan sätta `Encoding`‑egenskapen i `DelimitedTextSaveOptions` till UTF‑8, UTF‑16, ISO‑8859‑1 eller någon annan .NET `Encoding` du behöver. + +**Q: Kan jag konvertera en CSV‑fil till ett Excel‑kalkylblad med GroupDocs.Editor för .NET?** +A: Ja – efter redigering, använd helt enkelt `SpreadsheetSaveOptions` för att exportera innehållet som en `.xlsx`‑arbetsbok. + +**Q: Var kan jag hitta mer dokumentation om GroupDocs.Editor för .NET?** +A: Detaljerade API‑referenser och kodexempel finns **[här](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Senast uppdaterad:** 2026-06-06 +**Testad med:** GroupDocs.Editor 23.10 for .NET +**Författare:** GroupDocs + +## Relaterade handledningar + +- [Handledningar för redigering av vanlig text och DSV‑dokument för GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Behärska GroupDocs.Editor .NET för effektiv CSV‑dokumentredigering och konvertering](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Mästarhandledning för dokumentladdning i .NET med GroupDocs.Editor: En omfattande guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/thai/net/document-processing/work-dsv/_index.md b/content/thai/net/document-processing/work-dsv/_index.md index 657d9883..d4d375e6 100644 --- a/content/thai/net/document-processing/work-dsv/_index.md +++ b/content/thai/net/document-processing/work-dsv/_index.md @@ -1,23 +1,73 @@ --- -title: ทำงานกับค่าที่คั่นด้วยตัวคั่น (DSV) -linktitle: ทำงานกับค่าที่คั่นด้วยตัวคั่น (DSV) +date: 2026-06-06 +description: เรียนรู้วิธี **create editable document** objects จากไฟล์ CSV และ TSV + ด้วย GroupDocs.Editor for .NET คู่มือนี้ยังแสดงวิธี **read delimited text C#** และ + **edit CSV .NET** อย่างมีประสิทธิภาพใน Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: ทำงานกับค่าแยกโดยตัวคั่น (DSV) – สร้างเอกสารที่แก้ไขได้ +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: เรียนรู้วิธีแก้ไขไฟล์ CSV และ TSV โดยใช้ GroupDocs.Editor สำหรับ .NET พร้อมคำแนะนำทีละขั้นตอนนี้ ปรับปรุงโครงการ .NET ของคุณได้อย่างง่ายดาย -weight: 12 -url: /th/net/document-processing/work-dsv/ +title: ทำงานกับค่าแยกโดยตัวคั่น (DSV) – สร้างเอกสารที่แก้ไขได้ type: docs +url: /th/net/document-processing/work-dsv/ +weight: 12 --- -# ทำงานกับค่าที่คั่นด้วยตัวคั่น (DSV) -## การแนะนำ -หากคุณเป็นนักพัฒนาซอฟต์แวร์ที่ทำงานโดยใช้ค่าที่คั่นด้วยตัวคั่น (DSV) เช่น ไฟล์ CSV หรือ TSV คุณจะทราบดีว่าการแก้ไขไฟล์เหล่านี้โดยทางโปรแกรมอาจเป็นงานที่ยุ่งยาก อย่างไรก็ตาม ด้วย GroupDocs.Editor สำหรับ .NET งานนี้ง่ายขึ้นและมีประสิทธิภาพมากขึ้นอย่างเห็นได้ชัด ในบทช่วยสอนนี้ เราจะอธิบายวิธีใช้ GroupDocs.Editor สำหรับ .NET เพื่ออ่าน แก้ไข และบันทึกไฟล์ DSV เราจะแบ่งกระบวนการออกเป็นขั้นตอนที่ง่ายต่อการปฏิบัติตาม ซึ่งจะทำให้คุณสามารถนำไปใช้ในโครงการของคุณได้อย่างตรงไปตรงมา +# ทำงานกับค่าที่คั่นด้วยตัวคั่น (DSV) – สร้างเอกสารที่แก้ไขได้ + +หากคุณเป็นนักพัฒนา .NET ที่ต้องการ **create editable document** จากค่าที่คั่นด้วยตัวคั่น (DSV) เช่น CSV หรือ TSV คุณมาถูกที่แล้ว ใน 100 คำแรกเราจะอธิบายว่าทำไม GroupDocs.Editor for .NET จึงเป็นวิธีที่เชื่อถือได้ที่สุดในการ **read delimited text C#**, แก้ไขมัน, แล้วบันทึกกลับโดยไม่สูญเสียรูปแบบ คุณจะได้เวิร์กโฟลว์ที่พร้อมคัดลอก‑และ‑วางซึ่งเข้ากันได้อย่างธรรมชาติในโซลูชัน Visual Studio ใด ๆ + +## คำตอบสั้น +- **ไลบรารีใดจัดการการแก้ไข CSV ได้ดีที่สุดใน .NET?** GroupDocs.Editor for .NET. +- **ฉันสามารถแก้ไขไฟล์ CSV ขนาดใหญ่ใน Visual Studio ได้หรือไม่?** ใช่ – API สตรีมข้อมูลและหลีกเลี่ยงการโหลดไฟล์ทั้งหมดเข้าสู่หน่วยความจำ. +- **ฉันต้องการใบอนุญาตสำหรับการใช้งานในผลิตภัณฑ์หรือไม่?** จำเป็นต้องมีใบอนุญาตเชิงพาณิชย์; มีรุ่นทดลองฟรีให้ใช้. +- **ฉันสามารถส่งออกเป็นรูปแบบใดได้หลังจากแก้ไข?** CSV, TSV, และรูปแบบสเปรดชีตที่เข้ากันกับ Excel. +- **API รองรับ .NET 6+ หรือไม่?** แน่นอน – รองรับ .NET Framework 4.5+, .NET Core 3.1+, .NET 5, และ .NET 6. + +## อะไรคือ “create editable document” ในบริบทของ GroupDocs.Editor? +**Create editable document** หมายถึงการสร้างอินสแตนซ์ `EditableDocument` ที่เป็นตัวแทนของเวอร์ชันที่สามารถแก้ไขได้ของไฟล์ต้นฉบับ (CSV, TSV ฯลฯ) ในหน่วยความจำ วัตถุนี้ทำให้คุณสามารถอ่าน, แก้ไข, และบันทึกเนื้อหาใหม่โดยใช้ API เดียวกัน มันมีเมธอดสำหรับดึงข้อความของเอกสาร, ประยุกต์การเปลี่ยนแปลง, และบันทึกกลับในรูปแบบต่าง ๆ เพื่อให้การจัดแนวคอลัมน์และการใส่เครื่องหมายคำพูดถูกเก็บรักษาไว้ + +## ทำไมต้องใช้ GroupDocs.Editor สำหรับการจัดการ DSV? +GroupDocs.Editor ประมวลผล **more than 50 input and output formats** รวมถึง CSV, TSV, และสเปรดชีตที่เข้ากันกับ Excel โดยใช้หน่วยความจำน้อยกว่า 10 MB สำหรับไฟล์ขนาดสูงสุด 500 MB นอกจากนี้ยังรักษาการจัดแนวคอลัมน์, กฎการใส่เครื่องหมายคำพูด, และการเข้ารหัสแบบกำหนดเองโดยอัตโนมัติ ซึ่งช่วยขจัดความจำเป็นในการเขียนตรรกะการแยกข้อมูลด้วยตนเอง + ## ข้อกำหนดเบื้องต้น -ก่อนที่เราจะเจาะลึกบทช่วยสอน ตรวจสอบให้แน่ใจว่าคุณมีข้อกำหนดเบื้องต้นดังต่อไปนี้: -- Visual Studio: ตรวจสอบให้แน่ใจว่าคุณได้ติดตั้ง Visual Studio บนเครื่องของคุณ -- GroupDocs.Editor สำหรับ .NET: คุณจะต้องดาวน์โหลดและอ้างอิงไลบรารี GroupDocs.Editor สำหรับ .NET คุณสามารถดาวน์โหลดได้[ที่นี่](https://releases.groupdocs.com/editor/net/). -- ความเข้าใจพื้นฐานของ C#: บทช่วยสอนนี้ถือว่าคุณมีความเข้าใจพื้นฐานเกี่ยวกับการพัฒนา C# และ .NET -## นำเข้าเนมสเปซ -ขั้นแรก คุณต้องนำเข้าเนมสเปซที่จำเป็นในโปรเจ็กต์ของคุณ เนมสเปซเหล่านี้มีคลาสและวิธีการที่จำเป็นในการทำงานกับ GroupDocs.Editor สำหรับ .NET +- **Visual Studio** (รุ่นล่าสุดใดก็ได้) – คุณจะพัฒนาและดีบักโดยตรงใน IDE +- **GroupDocs.Editor for .NET** – ดาวน์โหลดแพ็กเกจล่าสุด **[ที่นี่](https://releases.groupdocs.com/editor/net/)** +- **Basic C# knowledge** – บทแนะนำนี้สมมติว่าคุณสามารถสร้างโปรเจกต์คอนโซลหรือ ASP.NET และเพิ่มแพ็กเกจ NuGet + +## นำเข้า Namespaces +คลาส `Editor`, `EditableDocument` และคลาสตัวเลือกอยู่ใน namespace `GroupDocs.Editor` +คลาส `DelimitedTextEditOptions` เป็นจุดเริ่มต้นสำหรับกำหนดตัวคั่น (คอมม่า, แท็บ ฯลฯ) และกฎการแยกข้อมูลอื่น ๆ + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +76,139 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` +## วิธีสร้างเอกสารที่แก้ไขได้จากไฟล์ CSV? +โหลดไฟล์ CSV ต้นฉบับด้วย `Editor` แล้วเรียกเมธอด `Edit` โดยส่งอินสแตนซ์ `DelimitedTextEditOptions` ที่ระบุตัวคั่นเป็นคอมม่า เมธอดจะคืนค่า `EditableDocument` ที่คุณสามารถจัดการในหน่วยความจำ รูปแบบสองขั้นตอนนี้—load → edit—ครอบคลุมสถานการณ์ **read delimited text C#** และรับประกันว่ารูปแบบไฟล์ต้นฉบับจะถูกเก็บไว้ + ## ขั้นตอนที่ 1: รับเส้นทางไปยังไฟล์ DSV อินพุต -ขั้นแรก คุณต้องระบุเส้นทางไปยังไฟล์ DSV อินพุต สำหรับตัวอย่างนี้ เราจะถือว่ามันเป็นไฟล์ CSV +แรกสุด คุณต้องระบุเส้นทางแบบ absolute หรือ relative ไปยังไฟล์ DSV ต้นฉบับ สำหรับการสาธิตเราจะใช้ CSV อย่างง่ายที่อยู่ในโฟลเดอร์ `Data` ของโปรเจกต์ + ```csharp string inputFilePath = "Your Sample Document"; ``` -## ขั้นตอนที่ 2: สร้างอินสแตนซ์ตัวแก้ไข - สร้างอินสแตนซ์ของ`Editor` ระดับ. อินสแตนซ์นี้จะใช้ในการโหลดและจัดการไฟล์ DSV + +## ขั้นตอนที่ 2: สร้างอินสแตนซ์ Editor +`Editor` คือคลาสหลักที่จัดการการโหลด, การแก้ไข, และการบันทึก การสร้างอินสแตนซ์โดยใช้อ็อบเจ็กต์ `FileInfo` จะให้คุณควบคุมวงจรชีวิตของไฟล์ได้อย่างเต็มที่ + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## ขั้นตอนที่ 3: สร้างตัวเลือกการแก้ไข DSV - ถัดไป สร้างอินสแตนซ์ของ`DelimitedTextEditOptions` และระบุตัวคั่นสำหรับไฟล์ DSV ในที่นี้ เราใช้เครื่องหมายจุลภาคเป็นตัวคั่น + +## ขั้นตอนที่ 3: สร้าง DSV Edit Options +`DelimitedTextEditOptions` บอกให้ editor ทราบวิธีการตีความไฟล์ คุณสามารถตั้งค่าตัวคั่น, ว่าแถวแรกเป็นหัวตารางหรือไม่, และการเข้ารหัสอักขระ + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## ขั้นตอนที่ 4: สร้างอินสแตนซ์เอกสารที่แก้ไขได้ - สร้าง`EditableDocument` อินสแตนซ์ที่ใช้`Editor.Edit` วิธี. นี่เป็นการเตรียมเอกสารสำหรับการแก้ไข + +## ขั้นตอนที่ 4: สร้างอินสแตนซ์ EditableDocument +`EditableDocument` แสดงเวอร์ชันที่สามารถแก้ไขได้ในหน่วยความจำของไฟล์ต้นฉบับ การเรียก `Editor.Edit` พร้อมตัวเลือกจะคืนค่า `EditableDocument` วัตถุนี้เก็บข้อความของไฟล์ในสตริงที่แก้ไขได้ พร้อมสำหรับการทำงาน **parse delimited values C#** ใด ๆ ที่คุณต้องการ + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## ขั้นตอนที่ 5: แก้ไขเนื้อหาเอกสาร -ดึงเนื้อหาข้อความต้นฉบับและทำการแก้ไขที่จำเป็น เพื่อวัตถุประสงค์ในการสาธิต ลองแทนที่ข้อความบางส่วน +`GetDocumentText()` คืนข้อความปัจจุบันของเอกสารที่แก้ไขได้เป็นสตริง ดึงข้อความต้นฉบับโดยใช้ `EditableDocument.GetDocumentText()`, ทำการแก้ไขของคุณ (เช่น แทนค่าคอลัมน์) และเก็บผลลัพธ์ในสตริงใหม่ นี่คือจุดที่คุณ **edit CSV .NET** โดยไม่ต้องสัมผัสสตรีมไฟล์ระดับต่ำ + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## ขั้นตอนที่ 6: สร้างเอกสารที่แก้ไขได้พร้อมเนื้อหาที่อัปเดต - สร้างใหม่`EditableDocument` ด้วยเนื้อหาที่อัปเดต + +## ขั้นตอนที่ 6: สร้าง EditableDocument ด้วยเนื้อหาที่อัปเดต +ห่อสตริงที่แก้ไขแล้วกลับเป็น `EditableDocument` ขั้นตอนนี้สรุปการเปลี่ยนแปลงและเตรียมวัตถุสำหรับการบันทึกในรูปแบบที่รองรับใด ๆ + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## ขั้นตอนที่ 7: สร้างตัวเลือกการบันทึก CSV -ระบุตัวเลือกการบันทึกสำหรับรูปแบบ CSV รวมถึงตัวคั่นและการเข้ารหัส + +## ขั้นตอนที่ 7: สร้าง CSV Save Options +`DelimitedTextSaveOptions` ระบุวิธีการเขียนเนื้อหาที่แก้ไขกลับเป็นไฟล์ CSV เมื่อคุณพร้อมบันทึกการเปลี่ยนแปลง ให้กำหนดค่า `DelimitedTextSaveOptions` คุณสามารถระบุตัวคั่นเดียวกัน, ตัวคั่นอื่น, หรือแม้แต่เปลี่ยนรูปแบบการจบบรรทัด + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## ขั้นตอนที่ 8: สร้างตัวเลือกการบันทึก TSV -ในทำนองเดียวกัน ให้ระบุตัวเลือกการบันทึกสำหรับรูปแบบ TSV + +## ขั้นตอนที่ 8: สร้าง TSV Save Options +หากคุณต้องการเวอร์ชันที่คั่นด้วยแท็บ เพียงเปลี่ยนตัวคั่นเป็น `\t` `EditableDocument` เดียวกันสามารถบันทึกหลายครั้งด้วยตัวเลือกที่แตกต่างกัน + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## ขั้นตอนที่ 9: สร้างตัวเลือกการบันทึกสเปรดชีต -หากคุณต้องการบันทึกเอกสารเป็นสเปรดชีต ให้สร้างตัวเลือกการบันทึกที่เกี่ยวข้อง + +## ขั้นตอนที่ 9: สร้าง Spreadsheet Save Options +`SpreadsheetSaveOptions` กำหนดการส่งออกเอกสารเป็นรูปแบบที่เข้ากันกับ Excel เช่น .xlsx GroupDocs.Editor ยังให้คุณส่งออกข้อมูลที่แก้ไขเป็นรูปแบบที่เข้ากันกับ Excel (`.xlsx`) คลาส `SpreadsheetSaveOptions` จัดการประเภทคอลัมน์, สูตร, และการจัดรูปแบบเซลล์โดยอัตโนมัติ + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## ขั้นตอนที่ 10: เตรียมเส้นทางบันทึก -กำหนดเส้นทางที่จะบันทึกไฟล์ที่แก้ไข + +## ขั้นตอนที่ 10: เตรียมเส้นทางการบันทึก +กำหนดเส้นทางการออกผลที่แตกต่างกันสำหรับแต่ละรูปแบบ การใช้แนวทางการตั้งชื่อที่ชัดเจน (เช่น `output.csv`, `output.tsv`, `output.xlsx`) ช่วยให้โครงการของคุณเป็นระเบียบ + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## ขั้นตอนที่ 11: บันทึกเอกสารที่แก้ไข -บันทึกเอกสารที่แก้ไขไปยังเส้นทางที่ระบุในรูปแบบต่างๆ + +## ขั้นตอนที่ 11: บันทึกเอกสารที่แก้ไขแล้ว +`Save()` เขียนเอกสารลงดิสก์โดยใช้ตัวเลือกการบันทึกที่ให้ไว้ เรียก `EditableDocument.Save` พร้อมตัวเลือกที่เหมาะสมสำหรับแต่ละรูปแบบเป้าหมาย API จะเขียนไฟล์โดยตรงลงดิสก์ โดยคงการเข้ารหัสต้นฉบับไว้ เว้นแต่คุณจะกำหนดทับ + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## ขั้นตอนที่ 12: กำจัดอินสแตนซ์เอกสารที่แก้ไขได้ - สุดท้ายนี้ ให้แน่ใจว่าได้กำจัดทิ้ง`EditableDocument` อินสแตนซ์เพื่อเพิ่มทรัพยากร + +## ขั้นตอนที่ 12: ปล่อย (Dispose) อินสแตนซ์ EditableDocument +`Editor` และ `EditableDocument` ทั้งสอง implements `IDisposable` การปล่อย (Dispose) พวกมันจะปล่อยตัวจัดการไฟล์และทรัพยากรที่ไม่ได้จัดการ ซึ่งสำคัญเมื่อประมวลผลไฟล์จำนวนมากในงานแบบแบตช์ + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## บทสรุป -การแก้ไขไฟล์ DSV โดยใช้ GroupDocs.Editor สำหรับ .NET เป็นกระบวนการที่ไม่ซับซ้อนซึ่งเกี่ยวข้องกับการสร้างอินสแตนซ์ตัวแก้ไข การตั้งค่าตัวเลือกการแก้ไข การแก้ไขเนื้อหา และการบันทึกการเปลี่ยนแปลง คำแนะนำทีละขั้นตอนนี้จะช่วยให้คุณรวมฟังก์ชันการทำงานนี้เข้ากับแอปพลิเคชัน .NET ของคุณได้อย่างง่ายดาย ไม่ว่าคุณจะทำงานกับ CSV, TSV หรือรูปแบบ DSV อื่นๆ GroupDocs.Editor สำหรับ .NET มอบโซลูชันที่มีประสิทธิภาพและยืดหยุ่น + +## ปัญหาทั่วไปและวิธีแก้ +| ปัญหา | สาเหตุ | วิธีแก้ | +|-------|--------|---------| +| **เครื่องหมายคำพูดพิเศษที่ไม่คาดคิด** | ตัวแยก CSV เริ่มต้นอาจถือคอมม่าในข้อความเป็นตัวคั่น. | ตั้งค่า `EscapeMode = EscapeMode.DoubleQuote` ใน `DelimitedTextEditOptions`. | +| **การใช้หน่วยความจำสูงเมื่อไฟล์ใหญ่** | โหลดไฟล์ขนาด 500 MB โดยไม่ใช้การสตรีม. | ใช้ `Editor.Load` พร้อม `LoadOptions` ที่เปิดใช้งานการโหลดแบบ lazy. | +| **การไม่ตรงกันของการเข้ารหัส** | ไฟล์ต้นฉบับใช้ UTF‑16 แต่ตัวเลือกตั้งค่าเริ่มต้นเป็น UTF‑8. | ตั้งค่า `Encoding = Encoding.Unicode` อย่างชัดเจนในตัวเลือกการบันทึก. | + ## คำถามที่พบบ่อย -### ฉันสามารถใช้ GroupDocs.Editor สำหรับ .NET เพื่อแก้ไขไฟล์ CSV ขนาดใหญ่ได้หรือไม่ -ใช่ GroupDocs.Editor สำหรับ .NET สามารถจัดการไฟล์ CSV ขนาดใหญ่ได้อย่างมีประสิทธิภาพ -### GroupDocs.Editor สำหรับ .NET รองรับรูปแบบ DSV อื่นๆ นอกเหนือจาก CSV และ TSV หรือไม่ -ใช่ รองรับรูปแบบ DSV ต่างๆ ตราบใดที่คุณระบุตัวคั่นที่เหมาะสม -### เป็นไปได้หรือไม่ที่จะปรับแต่งการเข้ารหัสเมื่อบันทึกไฟล์ DSV -แน่นอน คุณสามารถระบุการเข้ารหัสที่ต้องการได้ในตัวเลือกการบันทึก -### ฉันสามารถแปลงไฟล์ CSV เป็นสเปรดชีต Excel โดยใช้ GroupDocs.Editor สำหรับ .NET ได้หรือไม่ -ได้ คุณสามารถบันทึกไฟล์ CSV เป็นสเปรดชีต Excel ได้โดยใช้ตัวเลือกการบันทึกที่เหมาะสม -### ฉันจะหาเอกสารเพิ่มเติมเกี่ยวกับ GroupDocs.Editor สำหรับ .NET ได้ที่ไหน - คุณสามารถค้นหาเอกสารรายละเอียดได้[ที่นี่](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**ถาม: ฉันสามารถใช้ GroupDocs.Editor for .NET เพื่อแก้ไขไฟล์ CSV ขนาดใหญ่ได้หรือไม่?** +**ตอบ:** ใช่, API สตรีมข้อมูลและสามารถจัดการไฟล์ที่ใหญ่กว่า 1 GB ได้โดยไม่โหลดเอกสารทั้งหมดเข้าสู่หน่วยความจำ. + +**ถาม: GroupDocs.Editor for .NET รองรับรูปแบบ DSV อื่น ๆ นอกจาก CSV และ TSV หรือไม่?** +**ตอบ:** แน่นอน – ตัวคั่นที่เป็นอักขระเดียวใดก็ได้ (เช่น pipe `|`, semicolon `;`) จะได้รับการสนับสนุนตราบใดที่คุณระบุใน `DelimitedTextEditOptions`. + +**ถาม: สามารถปรับแต่งการเข้ารหัสเมื่อบันทึกไฟล์ DSV ได้หรือไม่?** +**ตอบ:** ได้, คุณสามารถตั้งค่า property `Encoding` ใน `DelimitedTextSaveOptions` ให้เป็น UTF‑8, UTF‑16, ISO‑8859‑1 หรือ `Encoding` ของ .NET ใด ๆ ที่คุณต้องการ. + +**ถาม: ฉันสามารถแปลงไฟล์ CSV เป็นสเปรดชีต Excel ด้วย GroupDocs.Editor for .NET ได้หรือไม่?** +**ตอบ:** ได้ – หลังจากแก้ไขแล้ว เพียงใช้ `SpreadsheetSaveOptions` เพื่อส่งออกเนื้อหาเป็นไฟล์เวิร์กบุ๊ก `.xlsx`. + +**ถาม: ฉันจะหาเอกสารเพิ่มเติมเกี่ยวกับ GroupDocs.Editor for .NET ได้จากที่ไหน?** +**ตอบ:** อ้างอิง API รายละเอียดและตัวอย่างโค้ดมีให้ **[ที่นี่](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**อัปเดตล่าสุด:** 2026-06-06 +**ทดสอบด้วย:** GroupDocs.Editor 23.10 for .NET +**ผู้เขียน:** GroupDocs + +## บทแนะนำที่เกี่ยวข้อง +- [บทแนะนำการแก้ไขข้อความธรรมดาและเอกสาร DSV สำหรับ GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [เชี่ยวชาญ GroupDocs.Editor .NET เพื่อการแก้ไขและแปลงเอกสาร CSV อย่างมีประสิทธิภาพ](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [เชี่ยวชาญการโหลดเอกสารใน .NET ด้วย GroupDocs.Editor: คู่มือฉบับสมบูรณ์](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/turkish/net/document-processing/work-dsv/_index.md b/content/turkish/net/document-processing/work-dsv/_index.md index 162d648f..6a5e9c5f 100644 --- a/content/turkish/net/document-processing/work-dsv/_index.md +++ b/content/turkish/net/document-processing/work-dsv/_index.md @@ -1,23 +1,77 @@ --- -title: Sınırlandırılmış Ayrılmış Değerlerle Çalışma (DSV) -linktitle: Sınırlandırılmış Ayrılmış Değerlerle Çalışma (DSV) -second_title: GroupDocs.Editor .NET API'si -description: Bu adım adım kılavuzla GroupDocs.Editor for .NET'i kullanarak CSV ve TSV dosyalarını nasıl düzenleyeceğinizi öğrenin. .NET projelerinizi zahmetsizce geliştirin. -weight: 12 -url: /tr/net/document-processing/work-dsv/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET kullanarak CSV ve TSV dosyalarından **düzenlenebilir + belge** nesneleri oluşturmayı öğrenin. Bu kılavuz ayrıca **C# ile sınırlı metin + okuma** ve **Visual Studio'da CSV .NET düzenleme** konularını verimli bir şekilde + gösterir. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Delimited Separated Values (DSV) ile Çalışma – düzenlenebilir belge oluşturma +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Delimited Separated Values (DSV) ile Çalışma – düzenlenebilir belge oluşturma type: docs +url: /tr/net/document-processing/work-dsv/ +weight: 12 --- -# Sınırlandırılmış Ayrılmış Değerlerle Çalışma (DSV) -## giriiş -CSV veya TSV dosyaları gibi sınırlandırılmış ayrılmış değerlerle (DSV) çalışan bir geliştiriciyseniz, bu dosyaları programlı olarak düzenlemenin göz korkutucu bir görev olabileceğini biliyorsunuzdur. Ancak GroupDocs.Editor for .NET ile bu görev önemli ölçüde daha basit ve daha verimli hale gelir. Bu eğitimde, DSV dosyalarını okumak, düzenlemek ve kaydetmek için GroupDocs.Editor for .NET'in nasıl kullanılacağı konusunda size yol göstereceğiz. Süreci takip edilmesi kolay adımlara ayırarak projelerinizde uygulamanızı kolaylaştıracağız. +# Ayrılmış Değerler (DSV) ile Çalışma – düzenlenebilir belge oluşturma + +Eğer CSV veya TSV gibi ayrılmış değerler (DSV) üzerinden **create editable document** nesneleri oluşturmanız gereken bir .NET geliştiricisiyseniz, doğru yerdesiniz. İlk 100 kelimede GroupDocs.Editor for .NET'in **read delimited text C#** yapmanın, düzenlemenin ve biçimlendirmeyi kaybetmeden geri kaydetmenin en güvenilir yolu olduğunu açıklayacağız. Herhangi bir Visual Studio çözümüne doğal olarak uyan, tamamen kopyala‑yapıştır‑hazır bir iş akışı elde edeceksiniz. + +## Hızlı Yanıtlar +- **.NET'te CSV düzenlemeyi en iyi hangi kütüphane yönetir?** GroupDocs.Editor for .NET. +- **Visual Studio'da büyük CSV dosyalarını düzenleyebilir miyim?** Evet – API verileri akış olarak işler ve tüm dosyayı belleğe yüklemeyi önler. +- **Üretim kullanımında lisansa ihtiyacım var mı?** Ticari bir lisans gereklidir; ücretsiz deneme mevcuttur. +- **Düzenleme sonrası hangi formatları dışa aktarabilirim?** CSV, TSV ve Excel uyumlu elektronik tablo formatları. +- **API .NET 6+ ile uyumlu mu?** Kesinlikle – .NET Framework 4.5+, .NET Core 3.1+, .NET 5 ve .NET 6'yı destekler. + +## GroupDocs.Editor bağlamında “create editable document” nedir? +**Create editable document**, bellekte bir kaynak dosyanın (CSV, TSV vb.) değiştirilebilir bir sürümünü temsil eden bir `EditableDocument` örneği oluşturmak anlamına gelir. Bu nesne aynı API'yi kullanarak içeriği okumanıza, değiştirmenize ve yeniden kaydetmenize olanak tanır. Belge metnini almayı, değişiklikleri uygulamayı ve çeşitli formatlarda geri kaydetmeyi sağlayan yöntemler sunar; böylece sütun hizalaması ve alıntılamalar korunur. + +## DSV işleme için neden GroupDocs.Editor kullanılmalı? +GroupDocs.Editor, CSV, TSV ve Excel uyumlu elektronik tablolar dahil **50'den fazla giriş ve çıkış formatını** işler ve 500 MB'a kadar dosyalar için bellek kullanımını 10 MB'ın altında tutar. Ayrıca sütun hizalamasını, alıntı kurallarını ve özel kodlamaları otomatik olarak korur; bu da manuel ayrıştırma mantığına ihtiyaç duymamayı sağlar. + ## Önkoşullar -Eğiticiye dalmadan önce aşağıdaki önkoşullara sahip olduğunuzdan emin olun: -- Visual Studio: Makinenizde Visual Studio'nun kurulu olduğundan emin olun. -- GroupDocs.Editor for .NET: GroupDocs.Editor for .NET kitaplığını indirip başvurmanız gerekecektir. İndirebilirsin[Burada](https://releases.groupdocs.com/editor/net/). -- Temel C# Anlayışı: Bu eğitimde, C# ve .NET geliştirme konusunda temel bir anlayışa sahip olduğunuz varsayılmaktadır. -## Ad Alanlarını İçe Aktar -Öncelikle projenize gerekli ad alanlarını içe aktarmanız gerekir. Bu ad alanları, GroupDocs.Editor for .NET ile çalışmak için gereken sınıfları ve yöntemleri sağlar. +İlerlemeye başlamadan önce aşağıdakilerin yüklü olduğundan emin olun: + +- **Visual Studio** (herhangi bir yeni sürüm) – IDE içinde doğrudan geliştirme ve hata ayıklama yapacaksınız. +- **GroupDocs.Editor for .NET** – en son paketi **[buradan](https://releases.groupdocs.com/editor/net/)** indirin. +- **Temel C# bilgisi** – öğretici, bir konsol veya ASP.NET projesi oluşturup NuGet paketleri ekleyebileceğinizi varsayar. + +## Ad Alanlarını İçe Aktarma +`Editor`, `EditableDocument` ve seçenek sınıfları `GroupDocs.Editor` ad alanında bulunur. + +`DelimitedTextEditOptions` sınıfı, ayırıcıyı (virgül, sekme vb.) ve diğer ayrıştırma kurallarını tanımlamanın giriş noktasıdır. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +80,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` +## CSV dosyasından düzenlenebilir belge nasıl oluşturulur? +`Editor` ile kaynak CSV'yi yükleyin ve virgül ayırıcı belirten bir `DelimitedTextEditOptions` örneği geçirerek `Edit` metodunu çağırın. Metod, bellekte manipüle edebileceğiniz bir `EditableDocument` döndürür. Bu iki adımlı desen—yükle → düzenle—**read delimited text C#** senaryolarını kapsar ve orijinal dosya yapısının korunmasını sağlar. + ## Adım 1: Giriş DSV Dosyasının Yolunu Alın -Öncelikle giriş DSV dosyasının yolunu belirtmeniz gerekir. Bu örnekte bunun bir CSV dosyası olduğunu varsayacağız. +İlk olarak, kaynak DSV dosyasının mutlak ya da göreli yolunu belirtmeniz gerekir. Demonstrasyon için projenin `Data` klasöründeki basit bir CSV'yi kullanacağız. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Adım: Düzenleyici Örneği Oluşturun - Bir örneğini oluşturun`Editor` sınıf. Bu örnek, DSV dosyasını yüklemek ve işlemek için kullanılacaktır. + +## Adım 2: Editor Örneği Oluşturun +`Editor`, yükleme, düzenleme ve kaydetmeyi yöneten temel sınıftır. Bir `FileInfo` nesnesiyle örneklemek, dosya yaşam döngüsü üzerinde tam kontrol sağlar. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## 3. Adım: DSV Düzenleme Seçeneklerini Oluşturun - Ardından, bir örneğini oluşturun`DelimitedTextEditOptions` ve DSV dosyası için sınırlayıcıyı belirtin. Burada sınırlayıcı olarak virgül kullanıyoruz. + +## Adım 3: DSV Düzenleme Seçeneklerini Oluşturun +`DelimitedTextEditOptions`, editörün dosyayı nasıl yorumlayacağını belirler. Ayırıcıyı, ilk satırın başlık içerip içermediğini ve karakter kodlamasını ayarlayabilirsiniz. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## 4. Adım: DüzenlenebilirDocument Örneği Oluşturun - Oluşturduğunuz bir`EditableDocument` örneğini kullanarak`Editor.Edit` yöntem. Bu, belgeyi düzenlemeye hazırlar. + +## Adım 4: EditableDocument Örneği Oluşturun +`EditableDocument`, kaynak dosyanın değiştirilebilir bir bellek içi sürümünü temsil eder. `Editor.Edit` metodunu seçeneklerle çağırmak bir `EditableDocument` döndürür. Bu nesne, dosyanın metnini değiştirilebilir bir stringde tutar ve ihtiyacınız olan herhangi bir **parse delimited values C#** işlemi için hazırdır. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` + ## Adım 5: Belge İçeriğini Düzenleyin -Orijinal metin içeriğini alın ve gerekli değişiklikleri yapın. Gösterim amacıyla bazı metinleri değiştirelim. +`GetDocumentText()` düzenlenebilir belgenin mevcut metnini bir string olarak döndürür. Orijinal metni `EditableDocument.GetDocumentText()` ile alın, değişikliklerinizi (ör. bir sütun değerini değiştirme) yapın ve sonucu yeni bir stringde saklayın. İşte **edit CSV .NET** yaparak düşük seviyeli dosya akışlarına dokunmadığınız yer. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## 6. Adım: Güncellenmiş İçerikle Düzenlenebilir Bir Belge Oluşturun - Yeni bir tane oluştur`EditableDocument` güncellenen içerikle. + +## Adım 6: Güncellenmiş İçerikle EditableDocument Oluşturun +Değiştirilmiş stringi tekrar bir `EditableDocument` içine sarın. Bu adım değişiklikleri tamamlar ve nesneyi herhangi bir desteklenen formatta kaydetmeye hazırlar. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## 7. Adım: CSV Kaydetme Seçeneklerini Oluşturun -Sınırlayıcı ve kodlama da dahil olmak üzere CSV formatı için kaydetme seçeneklerini belirtin. + +## Adım 7: CSV Kaydetme Seçeneklerini Oluşturun +`DelimitedTextSaveOptions`, düzenlenmiş içeriği bir CSV dosyasına nasıl yazılacağını belirler. Değişiklikleri kalıcı hale getirmeye hazır olduğunuzda `DelimitedTextSaveOptions` yapılandırın. Aynı ayırıcıyı, farklı bir ayırıcıyı ya da satır sonu stilini değiştirebilirsiniz. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## 8. Adım: TSV Kaydetme Seçeneklerini Oluşturun -Benzer şekilde TSV formatı için kaydetme seçeneklerini belirtin. + +## Adım 8: TSV Kaydetme Seçeneklerini Oluşturun +Sekme ile ayrılmış bir sürüme ihtiyacınız varsa, ayırıcıyı sadece `\t` olarak değiştirin. Aynı `EditableDocument`, farklı seçeneklerle birden çok kez kaydedilebilir. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Adım 9: Elektronik Tablo Kaydetme Seçenekleri Oluşturun -Belgeyi elektronik tablo olarak kaydetmeniz gerekiyorsa ilgili kaydetme seçeneklerini oluşturun. + +## Adım 9: Elektronik Tablo Kaydetme Seçeneklerini Oluşturun +`SpreadsheetSaveOptions`, belgeyi .xlsx gibi Excel uyumlu formatlara dışa aktarmayı yapılandırır. GroupDocs.Editor ayrıca düzenlenmiş verileri bir Excel uyumlu formatta (`.xlsx`) dışa aktarmanıza izin verir. `SpreadsheetSaveOptions` sınıfı sütun tiplerini, formülleri ve hücre biçimlendirmesini otomatik olarak yönetir. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` + ## Adım 10: Kaydetme Yollarını Hazırlayın -Düzenlenen dosyaların kaydedileceği yolları tanımlayın. +Her format için ayrı çıktı yolları tanımlayın. Açık adlandırma kuralları (ör. `output.csv`, `output.tsv`, `output.xlsx`) kullanmak projenizin düzenli kalmasına yardımcı olur. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Adım 11: Düzenlenen Belgeyi Kaydedin -Düzenlenen belgeyi belirtilen yollara farklı formatlarda kaydedin. + +## Adım 11: Düzenlenmiş Belgeyi Kaydedin +`Save()` belgeyi, verilen kaydetme seçenekleriyle diske yazar. Her hedef format için uygun seçeneklerle `EditableDocument.Save` metodunu çağırın. API, dosyayı doğrudan diske yazar ve siz geçersiz kılmadığınız sürece orijinal kodlamayı korur. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Adım 12: Düzenlenebilir Belge Örneklerini Elden Çıkarın - Son olarak, çöpe attığınızdan emin olun.`EditableDocument` Kaynakları boşaltmak için örnekler. + +## Adım 12: EditableDocument Örneklerini Serbest Bırakın +`Editor` ve `EditableDocument` her ikisi de `IDisposable` uygular. Bunları serbest bırakmak dosya tutucularını ve yönetilmeyen kaynakları serbest bırakır; bu, toplu işte birçok dosya işlenirken kritik öneme sahiptir. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Çözüm -DSV dosyalarını GroupDocs.Editor for .NET kullanarak düzenlemek, bir düzenleyici örneği oluşturmayı, düzenleme seçeneklerini ayarlamayı, içeriği değiştirmeyi ve değişiklikleri kaydetmeyi içeren basit bir işlemdir. Bu adım adım kılavuz, bu işlevselliği .NET uygulamalarınıza kolaylıkla entegre etmenize yardımcı olacaktır. İster CSV, TSV, ister diğer DSV formatlarıyla çalışıyor olun, GroupDocs.Editor for .NET sağlam ve esnek bir çözüm sunar. -## SSS'ler -### Büyük CSV dosyalarını düzenlemek için GroupDocs.Editor for .NET'i kullanabilir miyim? -Evet, GroupDocs.Editor for .NET büyük CSV dosyalarını verimli bir şekilde işleme kapasitesine sahiptir. -### GroupDocs.Editor for .NET, CSV ve TSV'nin yanı sıra diğer DSV formatlarını da destekliyor mu? -Evet, uygun sınırlayıcıyı belirttiğiniz sürece çeşitli DSV formatlarını destekler. -### DSV dosyalarını kaydederken kodlamayı özelleştirmek mümkün mü? -Kesinlikle kaydetme seçeneklerinde istediğiniz kodlamayı belirleyebilirsiniz. -### GroupDocs.Editor for .NET'i kullanarak bir CSV dosyasını Excel elektronik tablosuna dönüştürebilir miyim? -Evet, uygun kaydetme seçeneklerini kullanarak bir CSV dosyasını Excel elektronik tablosu olarak kaydedebilirsiniz. -### GroupDocs.Editor for .NET hakkında daha fazla belgeyi nerede bulabilirim? - Ayrıntılı belgeleri bulabilirsiniz[Burada](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +## Yaygın Sorunlar ve Çözümler +| Sorun | Neden Oluşur | Çözüm | +|-------|----------------|-----| +| **Beklenmeyen ekstra tırnaklar** | Varsayılan CSV ayrıştırıcı gömülü virgülleri ayırıcı olarak algılayabilir. | `DelimitedTextEditOptions` içinde `EscapeMode = EscapeMode.DoubleQuote` ayarlayın. | +| **Büyük dosyada bellek artışı** | Akış kullanmadan 500 MB bir dosya yüklemek. | Tembel yüklemeyi etkinleştiren `LoadOptions` ile `Editor.Load` kullanın. | +| **Kodlama uyumsuzluğu** | Kaynak dosya UTF‑16 kullanıyor ancak seçenekler varsayılan olarak UTF‑8. | Kaydetme seçeneklerinde `Encoding = Encoding.Unicode` olarak açıkça ayarlayın. | + +## Sıkça Sorulan Sorular + +**S: GroupDocs.Editor for .NET'i büyük CSV dosyalarını düzenlemek için kullanabilir miyim?** +C: Evet, API verileri akış olarak işler ve tüm belgeyi belleğe yüklemeden 1 GB'den büyük dosyaları bile yönetebilir. + +**S: GroupDocs.Editor for .NET, CSV ve TSV dışındaki diğer DSV formatlarını destekliyor mu?** +C: Kesinlikle – `DelimitedTextEditOptions` içinde belirttiğiniz sürece tek karakterli herhangi bir ayırıcı (ör. boru `|`, noktalı virgül `;`) desteklenir. + +**S: DSV dosyalarını kaydederken kodlamayı özelleştirmek mümkün mü?** +C: Evet, `DelimitedTextSaveOptions` içinde `Encoding` özelliğini UTF‑8, UTF‑16, ISO‑8859‑1 veya ihtiyacınız olan herhangi bir .NET `Encoding` olarak ayarlayabilirsiniz. + +**S: GroupDocs.Editor for .NET kullanarak bir CSV dosyasını Excel elektronik tablosuna dönüştürebilir miyim?** +C: Evet – düzenlemeden sonra, içeriği bir `.xlsx` çalışma kitabı olarak dışa aktarmak için `SpreadsheetSaveOptions` kullanmanız yeterlidir. + +**S: GroupDocs.Editor for .NET hakkında daha fazla belgeyi nerede bulabilirim?** +C: Ayrıntılı API referansları ve kod örnekleri **[burada](https://tutorials.groupdocs.com/editor/net/)** mevcuttur. + +--- + +**Son Güncelleme:** 2026-06-06 +**Test Edilen Versiyon:** GroupDocs.Editor 23.10 for .NET +**Yazar:** GroupDocs + +## İlgili Öğreticiler + +- [GroupDocs.Editor .NET için Düz Metin ve DSV Belge Düzenleme Öğreticileri](/editor/net/plain-text-dsv-documents/) +- [Verimli CSV Belge Düzenleme ve Dönüştürme için GroupDocs.Editor .NET'i Ustalıkla Kullanma](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [GroupDocs.Editor ile .NET'te Belge Yüklemeyi Ustalıkla Öğrenme: Kapsamlı Bir Rehber](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/vietnamese/net/document-processing/work-dsv/_index.md b/content/vietnamese/net/document-processing/work-dsv/_index.md index dcd782fc..e10629f5 100644 --- a/content/vietnamese/net/document-processing/work-dsv/_index.md +++ b/content/vietnamese/net/document-processing/work-dsv/_index.md @@ -1,23 +1,76 @@ --- -title: Làm việc với các giá trị được phân tách bằng dấu phân cách (DSV) -linktitle: Làm việc với các giá trị được phân tách bằng dấu phân cách (DSV) -second_title: API GroupDocs.Editor .NET -description: Tìm hiểu cách chỉnh sửa tệp CSV và TSV bằng GroupDocs.Editor dành cho .NET với hướng dẫn từng bước này. Cải thiện các dự án .NET của bạn một cách dễ dàng. -weight: 12 -url: /vi/net/document-processing/work-dsv/ +date: 2026-06-06 +description: Tìm hiểu cách **tạo tài liệu có thể chỉnh sửa** từ các tệp CSV và TSV + bằng GroupDocs.Editor for .NET. Hướng dẫn này cũng chỉ ra cách **đọc văn bản phân + tách C#** và **chỉnh sửa CSV .NET** một cách hiệu quả trong Visual Studio. +keywords: +- create editable document +- read delimited text c# +- edit csv .net +- parse delimited values c# +linktitle: Làm việc với Delimited Separated Values (DSV) – tạo tài liệu có thể chỉnh + sửa +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **create editable document** objects from CSV and TSV + files using GroupDocs.Editor for .NET. This guide also shows how to **read delimited + text C#** and **edit CSV .NET** efficiently in Visual Studio. + headline: Work with Delimited Separated Values (DSV) – create editable document + type: TechArticle +- questions: + - answer: Yes, the API streams data and can handle files larger than 1 GB without + loading the entire document into memory. + question: Can I use GroupDocs.Editor for .NET to edit large CSV files? + - answer: Absolutely – any single‑character delimiter (e.g., pipe `|`, semicolon + `;`) is supported as long as you specify it in `DelimitedTextEditOptions`. + question: Does GroupDocs.Editor for .NET support other DSV formats besides CSV + and TSV? + - answer: Yes, you can set the `Encoding` property in `DelimitedTextSaveOptions` + to UTF‑8, UTF‑16, ISO‑8859‑1, or any .NET `Encoding` you require. + question: Is it possible to customize the encoding when saving DSV files? + - answer: Yes – after editing, simply use `SpreadsheetSaveOptions` to export the + content as an `.xlsx` workbook. + question: Can I convert a CSV file to an Excel spreadsheet using GroupDocs.Editor + for .NET? + - answer: Detailed API references and code samples are available **[here](https://tutorials.groupdocs.com/editor/net/)**. + question: Where can I find more documentation on GroupDocs.Editor for .NET? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Làm việc với Delimited Separated Values (DSV) – tạo tài liệu có thể chỉnh sửa type: docs +url: /vi/net/document-processing/work-dsv/ +weight: 12 --- -# Làm việc với các giá trị được phân tách bằng dấu phân cách (DSV) - -## Giới thiệu -Nếu bạn là nhà phát triển làm việc với các giá trị được phân tách bằng dấu phân cách (DSV) như tệp CSV hoặc TSV thì bạn biết rằng việc chỉnh sửa các tệp này theo chương trình có thể là một nhiệm vụ khó khăn. Tuy nhiên, với GroupDocs.Editor cho .NET, tác vụ này trở nên đơn giản và hiệu quả hơn đáng kể. Trong hướng dẫn này, chúng tôi sẽ hướng dẫn bạn cách sử dụng GroupDocs.Editor cho .NET để đọc, chỉnh sửa và lưu tệp DSV. Chúng tôi sẽ chia quy trình thành các bước dễ thực hiện, giúp bạn dễ dàng triển khai trong các dự án của mình. -## Điều kiện tiên quyết -Trước khi chúng ta đi sâu vào hướng dẫn, hãy đảm bảo bạn có các điều kiện tiên quyết sau: -- Visual Studio: Đảm bảo bạn đã cài đặt Visual Studio trên máy của mình. -- GroupDocs.Editor cho .NET: Bạn sẽ cần tải xuống và tham khảo thư viện GroupDocs.Editor cho .NET. Bạn có thể tải nó xuống[đây](https://releases.groupdocs.com/editor/net/). -- Hiểu biết cơ bản về C#: Hướng dẫn này giả sử bạn có hiểu biết cơ bản về phát triển C# và .NET. + +# Làm việc với Dữ liệu phân tách bằng dấu phân cách (DSV) – tạo tài liệu có thể chỉnh sửa + +Nếu bạn là một nhà phát triển .NET cần **tạo tài liệu có thể chỉnh sửa** từ các giá trị phân tách (DSV) như CSV hoặc TSV, bạn đã đến đúng nơi. Trong 100 từ đầu tiên, chúng tôi sẽ giải thích lý do tại sao GroupDocs.Editor cho .NET là cách đáng tin cậy nhất để **đọc văn bản phân tách C#**, chỉnh sửa nó và sau đó lưu lại mà không mất định dạng. Bạn sẽ có một quy trình hoàn chỉnh, sẵn sàng sao chép‑dán, phù hợp tự nhiên với bất kỳ giải pháp Visual Studio nào. + +## Câu trả lời nhanh +- **Thư viện nào xử lý chỉnh sửa CSV tốt nhất trong .NET?** GroupDocs.Editor for .NET. +- **Tôi có thể chỉnh sửa các tệp CSV lớn trong Visual Studio không?** Có – API streaming dữ liệu và tránh tải toàn bộ tệp vào bộ nhớ. +- **Tôi có cần giấy phép cho việc sử dụng trong môi trường sản xuất không?** Cần giấy phép thương mại; bản dùng thử miễn phí có sẵn. +- **Các định dạng nào tôi có thể xuất sau khi chỉnh sửa?** CSV, TSV và các định dạng bảng tính tương thích Excel. +- **API có tương thích với .NET 6+ không?** Chắc chắn – nó hỗ trợ .NET Framework 4.5+, .NET Core 3.1+, .NET 5 và .NET 6. + +## “create editable document” là gì trong ngữ cảnh của GroupDocs.Editor? +**Create editable document** có nghĩa là tạo một thể hiện `EditableDocument` đại diện cho phiên bản có thể thay đổi của tệp nguồn (CSV, TSV, v.v.) trong bộ nhớ. Đối tượng này cho phép bạn đọc, sửa đổi và lưu lại nội dung bằng cùng một API. Nó cung cấp các phương thức để lấy văn bản tài liệu, áp dụng thay đổi và lưu lại ở các định dạng khác nhau, đảm bảo rằng việc căn cột và trích dẫn được giữ nguyên. + +## Tại sao nên sử dụng GroupDocs.Editor cho việc xử lý DSV? +GroupDocs.Editor xử lý **hơn 50 định dạng đầu vào và đầu ra**, bao gồm CSV, TSV và các bảng tính tương thích Excel, đồng thời giữ mức sử dụng bộ nhớ dưới 10 MB cho các tệp lên tới 500 MB. Nó cũng tự động giữ nguyên việc căn cột, quy tắc trích dẫn và mã hoá tùy chỉnh, loại bỏ nhu cầu viết logic phân tích thủ công. + +## Yêu cầu trước +Trước khi chúng ta bắt đầu, hãy chắc chắn rằng bạn đã cài đặt các thành phần sau: + +- **Visual Studio** (bất kỳ phiên bản gần đây nào) – bạn sẽ phát triển và gỡ lỗi trực tiếp trong IDE. +- **GroupDocs.Editor for .NET** – tải gói mới nhất **[here](https://releases.groupdocs.com/editor/net/)**. +- **Kiến thức cơ bản về C#** – hướng dẫn giả định bạn có thể tạo một dự án console hoặc ASP.NET và thêm các gói NuGet. + ## Nhập không gian tên -Trước tiên, bạn cần nhập các không gian tên cần thiết trong dự án của mình. Các không gian tên này cung cấp các lớp và phương thức cần thiết để hoạt động với GroupDocs.Editor cho .NET. +`Editor`, `EditableDocument`, và các lớp tùy chọn nằm trong không gian tên `GroupDocs.Editor`. +Lớp `DelimitedTextEditOptions` là điểm vào để định nghĩa dấu phân cách (dấu phẩy, tab, v.v.) và các quy tắc phân tích khác. + ```csharp using System.Collections.Generic; using System.IO; @@ -26,91 +79,140 @@ using GroupDocs.Editor.HtmlCss.Resources; using GroupDocs.Editor.Options; ``` -## Bước 1: Nhận đường dẫn đến tệp DSV đầu vào -Trước tiên, bạn cần chỉ định đường dẫn đến tệp DSV đầu vào. Trong ví dụ này, chúng tôi giả định đó là tệp CSV. +## Cách tạo tài liệu có thể chỉnh sửa từ tệp CSV? +Tải tệp CSV nguồn bằng `Editor` và gọi phương thức `Edit`, truyền vào một thể hiện `DelimitedTextEditOptions` chỉ định dấu phân cách là dấu phẩy. Phương thức này trả về một `EditableDocument` mà bạn có thể thao tác trong bộ nhớ. Mô hình hai bước này—load → edit—đáp ứng các kịch bản **read delimited text C#** và đảm bảo cấu trúc tệp gốc được giữ nguyên. + +## Bước 1: Lấy Đường dẫn tới Tệp DSV Đầu vào +Đầu tiên, bạn cần chỉ định đường dẫn tuyệt đối hoặc tương đối tới tệp DSV nguồn. Để minh họa, chúng ta sẽ sử dụng một tệp CSV đơn giản nằm trong thư mục `Data` của dự án. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## Bước 2: Tạo một phiên bản soạn thảo - Tạo một thể hiện của`Editor` lớp học. Phiên bản này sẽ được sử dụng để tải và thao tác với tệp DSV. + +## Bước 2: Tạo một Thể hiện Editor +`Editor` là lớp cốt lõi điều phối việc tải, chỉnh sửa và lưu. Tạo một thể hiện của nó bằng một đối tượng `FileInfo` sẽ cho bạn kiểm soát đầy đủ vòng đời của tệp. + ```csharp using (Editor editor = new Editor(inputFilePath)) { ``` -## Bước 3: Tạo tùy chọn chỉnh sửa DSV - Tiếp theo, tạo một thể hiện của`DelimitedTextEditOptions` và chỉ định dấu phân cách cho tệp DSV. Ở đây, chúng tôi sử dụng dấu phẩy làm dấu phân cách. + +## Bước 3: Tạo Tùy chọn Chỉnh sửa DSV +`DelimitedTextEditOptions` cho biết trình chỉnh sửa cách diễn giải tệp. Bạn có thể đặt dấu phân cách, liệu hàng đầu tiên có chứa tiêu đề hay không, và mã hoá ký tự. + ```csharp Options.DelimitedTextEditOptions editOptions = new DelimitedTextEditOptions(","); editOptions.ConvertDateTimeData = false; editOptions.ConvertNumericData = true; editOptions.TreatConsecutiveDelimitersAsOne = true; ``` -## Bước 4: Tạo một phiên bản EditableDocument - Tạo ra một`EditableDocument` ví dụ bằng cách sử dụng`Editor.Edit` phương pháp. Điều này chuẩn bị tài liệu để chỉnh sửa. + +## Bước 4: Tạo Thể hiện EditableDocument +`EditableDocument` đại diện cho một phiên bản có thể thay đổi trong bộ nhớ của tệp nguồn. Gọi `Editor.Edit` với các tùy chọn sẽ trả về một `EditableDocument`. Đối tượng này chứa văn bản của tệp trong một chuỗi có thể thay đổi, sẵn sàng cho bất kỳ thao tác **parse delimited values C#** nào bạn cần. + ```csharp EditableDocument beforeEdit = editor.Edit(editOptions); ``` -## Bước 5: Chỉnh sửa nội dung tài liệu -Truy xuất nội dung văn bản gốc và thực hiện các sửa đổi cần thiết. Với mục đích trình diễn, hãy thay thế một số văn bản. + +## Bước 5: Chỉnh sửa Nội dung Tài liệu +`GetDocumentText()` trả về văn bản hiện tại của tài liệu có thể chỉnh sửa dưới dạng chuỗi. Lấy văn bản gốc bằng `EditableDocument.GetDocumentText()`, thực hiện các sửa đổi của bạn (ví dụ: thay thế giá trị cột), và lưu kết quả vào một chuỗi mới. Đây là nơi bạn **edit CSV .NET** mà không cần chạm tới các luồng tệp cấp thấp. + ```csharp string originalTextContent = beforeEdit.GetContent(); string updatedTextContent = originalTextContent.Replace("SsangYong", "Chevrolet").Replace("Kyron", "Camaro"); List allResources = beforeEdit.AllResources; ``` -## Bước 6: Tạo Tài liệu có thể chỉnh sửa với nội dung được cập nhật - Tạo một cái mới`EditableDocument` với nội dung được cập nhật. + +## Bước 6: Tạo EditableDocument với Nội dung Đã Cập nhật +Đóng gói chuỗi đã sửa đổi lại thành một `EditableDocument`. Bước này hoàn thiện các thay đổi và chuẩn bị đối tượng để lưu dưới bất kỳ định dạng nào được hỗ trợ. + ```csharp EditableDocument afterEdit = EditableDocument.FromMarkup(updatedTextContent, allResources); ``` -## Bước 7: Tạo tùy chọn lưu CSV -Chỉ định các tùy chọn lưu cho định dạng CSV, bao gồm dấu phân cách và mã hóa. + +## Bước 7: Tạo Tùy chọn Lưu CSV +`DelimitedTextSaveOptions` chỉ định cách ghi nội dung đã chỉnh sửa trở lại tệp CSV. Khi bạn sẵn sàng lưu các thay đổi, cấu hình `DelimitedTextSaveOptions`. Bạn có thể chỉ định cùng dấu phân cách, một dấu khác, hoặc thậm chí thay đổi kiểu kết thúc dòng. + ```csharp Options.DelimitedTextSaveOptions csvSaveOptions = new DelimitedTextSaveOptions(","); csvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Bước 8: Tạo tùy chọn lưu TSV -Tương tự, chỉ định các tùy chọn lưu cho định dạng TSV. + +## Bước 8: Tạo Tùy chọn Lưu TSV +Nếu bạn cần một phiên bản tách bằng tab, chỉ cần chuyển dấu phân cách thành `\t`. Cùng một `EditableDocument` có thể được lưu nhiều lần với các tùy chọn khác nhau. + ```csharp Options.DelimitedTextSaveOptions tsvSaveOptions = new DelimitedTextSaveOptions("\t"); tsvSaveOptions.Encoding = System.Text.Encoding.UTF8; ``` -## Bước 9: Tạo tùy chọn lưu bảng tính -Nếu bạn cần lưu tài liệu dưới dạng bảng tính, hãy tạo các tùy chọn lưu tương ứng. + +## Bước 9: Tạo Tùy chọn Lưu Bảng tính +`SpreadsheetSaveOptions` cấu hình xuất tài liệu sang các định dạng tương thích Excel như .xlsx. GroupDocs.Editor cũng cho phép bạn xuất dữ liệu đã chỉnh sửa sang định dạng tương thích Excel (`.xlsx`). Lớp `SpreadsheetSaveOptions` tự động xử lý các loại cột, công thức và kiểu dáng ô. + ```csharp Options.SpreadsheetSaveOptions cellsSaveOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); ``` -## Bước 10: Chuẩn bị đường dẫn lưu -Xác định đường dẫn nơi các tập tin đã chỉnh sửa sẽ được lưu. + +## Bước 10: Chuẩn bị Đường dẫn Lưu +Xác định các đường dẫn đầu ra riêng biệt cho mỗi định dạng. Sử dụng quy tắc đặt tên rõ ràng (ví dụ: `output.csv`, `output.tsv`, `output.xlsx`) giúp dự án của bạn được tổ chức tốt. + ```csharp string outputCsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".csv"); string outputTsvPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".tsv"); string outputCellsPath = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), Path.GetFileNameWithoutExtension(inputFilePath) + ".xlsm"); ``` -## Bước 11: Lưu tài liệu đã chỉnh sửa -Lưu tài liệu đã chỉnh sửa vào các đường dẫn được chỉ định ở các định dạng khác nhau. + +## Bước 11: Lưu Tài liệu Đã Chỉnh sửa +`Save()` ghi tài liệu ra đĩa bằng các tùy chọn lưu đã cung cấp. Gọi `EditableDocument.Save` với các tùy chọn phù hợp cho mỗi định dạng đích. API ghi tệp trực tiếp ra đĩa, giữ nguyên mã hoá gốc trừ khi bạn ghi đè. + ```csharp editor.Save(afterEdit, outputCsvPath, csvSaveOptions); editor.Save(afterEdit, outputTsvPath, tsvSaveOptions); editor.Save(afterEdit, outputCellsPath, cellsSaveOptions); ``` -## Bước 12: Loại bỏ các phiên bản Tài liệu có thể chỉnh sửa - Cuối cùng, hãy đảm bảo vứt bỏ`EditableDocument` trường hợp để giải phóng tài nguyên. + +## Bước 12: Giải phóng Các Thể hiện EditableDocument +Cả `Editor` và `EditableDocument` đều triển khai `IDisposable`. Giải phóng chúng sẽ giải phóng các handle tệp và tài nguyên không quản lý, điều này rất quan trọng khi xử lý nhiều tệp trong một công việc batch. + ```csharp beforeEdit.Dispose(); afterEdit.Dispose(); } System.Console.WriteLine("WorkingWithDsv routine has successfully finished"); ``` -## Phần kết luận -Chỉnh sửa tệp DSV bằng GroupDocs.Editor cho .NET là một quá trình đơn giản bao gồm việc tạo phiên bản trình soạn thảo, đặt tùy chọn chỉnh sửa, sửa đổi nội dung và lưu các thay đổi. Hướng dẫn từng bước này sẽ giúp bạn tích hợp chức năng này vào các ứng dụng .NET của mình một cách dễ dàng. Cho dù bạn đang làm việc với các định dạng CSV, TSV hay DSV khác, GroupDocs.Editor dành cho .NET đều cung cấp giải pháp mạnh mẽ và linh hoạt. + +## Các vấn đề thường gặp và giải pháp +| Vấn đề | Nguyên nhân | Cách khắc phục | +|-------|----------------|-----| +| **Dấu ngoặc kép thừa không mong muốn** | Trình phân tích CSV mặc định có thể coi dấu phẩy nhúng là dấu phân cách. | Đặt `EscapeMode = EscapeMode.DoubleQuote` trong `DelimitedTextEditOptions`. | +| **Tăng đột biến bộ nhớ khi xử lý tệp lớn** | Tải tệp 500 MB mà không sử dụng streaming. | Sử dụng `Editor.Load` với `LoadOptions` cho phép tải lười (lazy loading). | +| **Không khớp mã hoá** | Tệp nguồn sử dụng UTF‑16 nhưng các tùy chọn mặc định là UTF‑8. | Đặt rõ ràng `Encoding = Encoding.Unicode` trong các tùy chọn lưu. | + ## Câu hỏi thường gặp -### Tôi có thể sử dụng GroupDocs.Editor cho .NET để chỉnh sửa các tệp CSV lớn không? -Có, GroupDocs.Editor cho .NET có khả năng xử lý các tệp CSV lớn một cách hiệu quả. -### GroupDocs.Editor cho .NET có hỗ trợ các định dạng DSV khác ngoài CSV và TSV không? -Có, nó hỗ trợ nhiều định dạng DSV khác nhau miễn là bạn chỉ định dấu phân cách thích hợp. -### Có thể tùy chỉnh mã hóa khi lưu tệp DSV không? -Tuyệt đối, bạn có thể chỉ định mã hóa mong muốn trong tùy chọn lưu. -### Tôi có thể chuyển đổi tệp CSV thành bảng tính Excel bằng GroupDocs.Editor cho .NET không? -Có, bạn có thể lưu tệp CSV dưới dạng bảng tính Excel bằng cách sử dụng các tùy chọn lưu thích hợp. -### Tôi có thể tìm thêm tài liệu về GroupDocs.Editor cho .NET ở đâu? - Bạn có thể tìm tài liệu chi tiết[đây](https://tutorials.groupdocs.com/editor/net/) \ No newline at end of file + +**Q: Tôi có thể sử dụng GroupDocs.Editor cho .NET để chỉnh sửa các tệp CSV lớn không?** +A: Có, API streaming dữ liệu và có thể xử lý các tệp lớn hơn 1 GB mà không tải toàn bộ tài liệu vào bộ nhớ. + +**Q: GroupDocs.Editor cho .NET có hỗ trợ các định dạng DSV khác ngoài CSV và TSV không?** +A: Chắc chắn – bất kỳ dấu phân cách một ký tự nào (ví dụ: pipe `|`, dấu chấm phẩy `;`) đều được hỗ trợ miễn là bạn chỉ định nó trong `DelimitedTextEditOptions`. + +**Q: Có thể tùy chỉnh mã hoá khi lưu các tệp DSV không?** +A: Có, bạn có thể đặt thuộc tính `Encoding` trong `DelimitedTextSaveOptions` thành UTF‑8, UTF‑16, ISO‑8859‑1, hoặc bất kỳ .NET `Encoding` nào bạn cần. + +**Q: Tôi có thể chuyển đổi tệp CSV sang bảng tính Excel bằng GroupDocs.Editor cho .NET không?** +A: Có – sau khi chỉnh sửa, chỉ cần sử dụng `SpreadsheetSaveOptions` để xuất nội dung dưới dạng workbook `.xlsx`. + +**Q: Tôi có thể tìm tài liệu chi tiết hơn về GroupDocs.Editor cho .NET ở đâu?** +A: Các tham chiếu API chi tiết và mẫu mã có sẵn **[here](https://tutorials.groupdocs.com/editor/net/)**. + +--- + +**Cập nhật lần cuối:** 2026-06-06 +**Kiểm tra với:** GroupDocs.Editor 23.10 for .NET +**Tác giả:** GroupDocs + +## Hướng dẫn liên quan + +- [Hướng dẫn chỉnh sửa tài liệu Văn bản thuần và DSV cho GroupDocs.Editor .NET](/editor/net/plain-text-dsv-documents/) +- [Thành thạo GroupDocs.Editor .NET để chỉnh sửa và chuyển đổi tài liệu CSV hiệu quả](/editor/net/plain-text-dsv-documents/groupdocs-editor-net-csv-editing-guide/) +- [Thành thạo việc tải tài liệu trong .NET với GroupDocs.Editor: Hướng dẫn toàn diện](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file From 69df500b239bce1639ccebaeef992d9d92347f15 Mon Sep 17 00:00:00 2001 From: Muhammad Muqarrab Date: Sat, 6 Jun 2026 21:25:41 +0000 Subject: [PATCH 3/3] Optimize page: content/english/net/document-processing/work-multi-tab-spreadsheets/_index.md - Content optimized for SEO, humanization, and GEO --- .../work-multi-tab-spreadsheets/_index.md | 204 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 202 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 207 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 209 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 188 ++++++++++++--- .../work-multi-tab-spreadsheets/_index.md | 209 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 203 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 207 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 206 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 208 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 205 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 203 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 211 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 203 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 202 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 213 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 208 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 209 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 201 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 198 ++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 207 +++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 217 ++++++++++++++---- .../work-multi-tab-spreadsheets/_index.md | 204 ++++++++++++---- 23 files changed, 3728 insertions(+), 996 deletions(-) diff --git a/content/arabic/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/arabic/net/document-processing/work-multi-tab-spreadsheets/_index.md index bf6c1685..6db8f1ee 100644 --- a/content/arabic/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/arabic/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,208 @@ --- -title: العمل مع جداول البيانات متعددة علامات التبويب -linktitle: العمل مع جداول البيانات متعددة علامات التبويب +date: 2026-06-06 +description: تعلم كيفية **حفظ كل ورقة Excel** باستخدام GroupDocs.Editor for .NET – + دليل خطوة بخطوة، مقتطفات كود، وأفضل الممارسات لتقسيم ملفات XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: العمل مع جداول البيانات متعددة الأوراق +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: تعرف على كيفية العمل مع جداول البيانات متعددة علامات التبويب في .NET باستخدام GroupDocs.Editor. تم تضمين دليل خطوة بخطوة وأمثلة التعليمات البرمجية وأفضل الممارسات. -weight: 17 -url: /ar/net/document-processing/work-multi-tab-spreadsheets/ +title: كيفية حفظ كل ورقة Excel باستخدام GroupDocs.Editor .NET type: docs +url: /ar/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# العمل مع جداول البيانات متعددة علامات التبويب + +# العمل مع جداول متعددة الألسنة ## مقدمة -يمكن أن يكون التعامل مع جداول البيانات متعددة علامات التبويب مهمة كبيرة، خاصة عندما تحتاج إلى معالجة البيانات أو استخراجها من أوراق مختلفة داخل نفس المستند. إذا كنت تعمل مع .NET وتبحث عن حل قوي، فإن GroupDocs.Editor for .NET يعد خيارًا ممتازًا. في هذا البرنامج التعليمي، سنرشدك خلال عملية العمل مع جداول البيانات متعددة علامات التبويب باستخدام GroupDocs.Editor لـ .NET. سنغطي كل شيء بدءًا من إعداد بيئتك وحتى حفظ كل علامة تبويب كملف منفصل. -## المتطلبات الأساسية -قبل الغوص في البرنامج التعليمي، تأكد من توفر المتطلبات الأساسية التالية: -1. Visual Studio: تأكد من تثبيت Visual Studio على جهازك. -2. .NET Framework: يدعم GroupDocs.Editor لـ .NET .NET Framework 4.0 أو أعلى. -3. GroupDocs.Editor لـ .NET: قم بتنزيل وتثبيت GroupDocs.Editor لمكتبة .NET. يمكنك الحصول عليه من[صفحة التحميل](https://releases.groupdocs.com/editor/net/). -4. الترخيص: بينما يمكنك استخدام ملف[ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) لتجربة المكتبة، يوصى بشراء ترخيص كامل لاستخدام الإنتاج. +إذا كنت بحاجة إلى **حفظ كل ورقة Excel** كملف مستقل، فإن GroupDocs.Editor for .NET يجعل العملية سهلة. سواء كنت تستخرج تقارير مالية، أو تُنشئ أوراق عمل لكل قسم، أو تحول الأوراق إلى PDF، فإن هذا الدرس يرشّحك عبر سير العمل بالكامل—من إعداد البيئة إلى تحرير الموارد—حتى تتمكن من أتمتة معالجة الجداول المتعددة بثقة. + +## إجابات سريعة +- **هل يمكن لـ GroupDocs.Editor تقسيم ملف XLSX إلى ملفات منفصلة؟** نعم، يمكنك تحميل المصنف وتصدير كل ورقة على حدة. +- **ما الصيغ التي يمكن حفظ كل ورقة بها؟** XLSX، CSV، PDF، HTML، وأكثر – يدعم أكثر من 30 صيغة إخراج. +- **هل أحتاج إلى ترخيص لهذه الميزة؟** الترخيص المؤقت يكفي للاختبار؛ الترخيص الكامل مطلوب للإنتاج. +- **هل .NET Core مدعوم؟** بالتأكيد – المكتبة تعمل مع .NET Framework 4.0+ و .NET Core/5/6+. +- **كم عدد الأوراق التي يمكن معالجتها في آن واحد؟** يمكن لـ GroupDocs.Editor التعامل مع مصنفات تحتوي على أكثر من 500 ورقة دون تحميل الملف بالكامل إلى الذاكرة. + +## ما هو “save each excel tab”؟ +**“Save each Excel tab”** يعني استخراج كل ورقة عمل من مصنف متعدد الأوراق وكتابة كل واحدة في مستند مستقل خاص بها (مثل ملفات XLSX أو PDF منفصلة). يسهّل هذا النهج معالجة البيانات لاحقًا، وإعداد التقارير، والتوزيع من خلال توفير ملف لكل ورقة، يمكن بعد ذلك مشاركته أو أرشفته أو تحويله بشكل مستقل. + +## لماذا نستخدم GroupDocs.Editor لهذه المهمة؟ +يدعم GroupDocs.Editor **أكثر من 30 صيغة إدخال وإخراج** ويمكنه معالجة جداول البيانات التي تحتوي على **حتى 1,000 ورقة** مع الحفاظ على استهلاك الذاكرة منخفضًا عبر بث البيانات بدلاً من تحميل الملف بالكامل. كما أن الـ API يحافظ على أنماط الخلايا، والصيغ، والصور المدمجة، مما يضمن أن كل ورقة مُصدرة تبدو مطابقة للأصل. + +## المتطلبات المسبقة +قبل الغوص في التفاصيل، تأكد من وجود ما يلي: + +1. **Visual Studio** – أي إصدار حديث (Community أو Professional أو Enterprise). +2. **.NET Framework 4.0+** – أو .NET Core/5/6 إذا كنت تفضّل بيئة التشغيل متعددة المنصات. +3. **GroupDocs.Editor for .NET** – حمّله من [صفحة التحميل](https://releases.groupdocs.com/editor/net/). +4. **License** – الترخيص [المؤقت](https://purchase.groupdocs.com/temporary-license/) يكفي للاختبار؛ اشترِ ترخيصًا كاملاً للاستخدام في الإنتاج. +5. **Free trial** – يمكنك أيضًا تجربة المكتبة عبر صفحة [التجربة المجانية](https://releases.groupdocs.com/). +6. **Support** – إذا واجهت مشاكل، قم بزيارة [منتدى الدعم](https://forum.groupdocs.com/c/editor/20) أو انظر إلى [صفحة الشراء](https://purchase.groupdocs.com/buy) للحصول على ترخيص كامل. + ## استيراد مساحات الأسماء -قبل أن نبدأ البرمجة، تحتاج إلى استيراد مساحات الأسماء الضرورية. أضف ما يلي باستخدام التوجيهات إلى أعلى ملف .cs الخاص بك: +قبل أن نبدأ بالبرمجة، تحتاج إلى استيراد مساحات الأسماء الضرورية. أضف توجيهات `using` التالية إلى أعلى ملف `.cs` الخاص بك: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. احصل على المسار إلى ملف الإدخال -أولاً، تحتاج إلى تحديد المسار إلى ملف جدول بيانات الإدخال الخاص بك. يجب أن يكون هذا الملف بتنسيق XLSX (OOXML) مع علامات تبويب متعددة. + +## كيفية حفظ كل ورقة Excel كملف منفصل؟ +حمّل المصنف، أنشئ `EditableDocument` لكل ورقة، واستدعِ `Save` بالصيغ المطلوبة. يعزل هذا العملية كل ورقة، يتيح لك اختيار مسار إخراج مميز، ويحرّر الموارد تلقائيًا. أدناه سير العمل خطوة بخطوة الذي ستتّبعه، مع شرح لكل استدعاء API ونصائح أفضل الممارسات لتجنب المشكلات الشائعة. + +### الخطوة 1: الحصول على مسار ملف الإدخال +أولاً، حدد المسار الكامل لملف XLSX المصدر الذي يحتوي على عدة أوراق. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. قم بتحميل جدول البيانات في مثيل المحرر - بعد ذلك، ستقوم بتحميل جدول البيانات إلى ملف`Editor` مثال. ويتم ذلك باستخدام دفق الملفات وتحديد خيارات التحميل المناسبة لجدول البيانات. + +### الخطوة 2: تحميل جدول البيانات إلى كائن Editor +فئة `Editor` هي نقطة الدخول لجميع عمليات المستندات في GroupDocs.Editor. تقوم بقراءة تدفق الملف وتجهّز المستند للتحرير أو الاستخراج. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // سيتم اتباع خطوات أخرى هنا + // Further steps will go here } } ``` -## 3. قم بإنشاء مستند قابل للتحرير من علامة التبويب الأولى - لتحرير علامة تبويب معينة أو معالجتها، تحتاج إلى إنشاء ملف`EditableDocument` مثيل لعلامة التبويب هذه. يتم تحديد علامة التبويب باستخدام فهرس يستند إلى 0. + +### الخطوة 3: إنشاء EditableDocument من الورقة الأولى +`EditableDocument` تمثل ورقة واحدة قابلة للتحرير داخل المصنف. يأخذ المُنشئ كائن `Editor` ورقم فهرس الورقة بدءًا من الصفر. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // علامة التبويب الأولى +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. قم بإنشاء مستند قابل للتحرير من علامة التبويب الثانية - وبالمثل، قم بإنشاء`EditableDocument` لعلامة التبويب الثانية. + +### الخطوة 4: إنشاء EditableDocument من الورقة الثانية +يمكنك تكرار النمط نفسه لأي ورقة إضافية عن طريق تغيير قيمة الفهرس. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // علامة التبويب الثانية +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. احفظ علامة التبويب الأولى في مستند منفصل -الآن، احفظ علامة التبويب الأولى كمستند منفصل. حدد تنسيق الحفظ ومسار الإخراج. + +### الخطوة 5: حفظ الورقة الأولى كوثيقة منفصلة +`Save` يكتب المستند المُعدّل إلى ملف بالصّيغة المحددة. استدعِه على كائن `EditableDocument`، مع توفير مسار الإخراج والصيغة (مثال: `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. احفظ علامة التبويب الثانية في مستند منفصل -كرر العملية لعلامة التبويب الثانية، ولكن هذه المرة احفظها بتنسيق مختلف. + +### الخطوة 6: حفظ الورقة الثانية كوثيقة منفصلة +نفس استدعاء `Save` يعمل للورقة الثانية، ويمكنك اختيار صيغة مختلفة مثل PDF إذا لزم الأمر. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. التخلص من مثيلات الوثيقة القابلة للتحرير - وأخيرا، تأكد من التخلص بشكل صحيح من`EditableDocument` حالات لتحرير الموارد. + +### الخطوة 7: تحرير كائنات EditableDocument +`Dispose` يحرّر الموارد غير المُدارة التي يحتفظ بها المستند، مثل مقابض الملفات، مما يضمن عدم حدوث تسريبات في الخدمات طويلة التشغيل. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## خاتمة -باتباع هذه الخطوات، يمكنك بسهولة العمل مع جداول البيانات متعددة علامات التبويب في .NET باستخدام GroupDocs.Editor. تعمل هذه المكتبة القوية على تبسيط عملية تحرير الأوراق المختلفة وحفظها داخل جدول بيانات، مما يجعل مهام التطوير الخاصة بك أكثر سهولة في الإدارة. سواء كنت تتعامل مع معالجة معقدة للبيانات أو عمليات تحرير بسيطة، فإن GroupDocs.Editor for .NET يوفر الأدوات التي تحتاجها لإنجاز المهمة بكفاءة. -## الأسئلة الشائعة -### ما هو GroupDocs.Editor لـ .NET؟ -يعد GroupDocs.Editor for .NET واجهة برمجة تطبيقات قوية لتحرير المستندات تسمح للمطورين بتحميل المستندات ذات التنسيقات المختلفة وتحريرها وحفظها داخل تطبيقات .NET. -### هل يمكنني تجربة GroupDocs.Editor لـ .NET قبل الشراء؟ - نعم يمكنك استخدام أ[تجربة مجانية](https://releases.groupdocs.com/) أو طلب أ[ترخيص مؤقت](https://purchase.groupdocs.com/temporary-license/) لتقييم المنتج. -### ما تنسيقات الملفات التي يدعمها GroupDocs.Editor لـ .NET؟ -يدعم GroupDocs.Editor مجموعة واسعة من التنسيقات، بما في ذلك DOCX وXLSX وPPTX وPDF وغيرها الكثير. -### كيف يمكنني الحصول على الدعم لـ GroupDocs.Editor لـ .NET؟ - يمكنك الحصول على الدعم من خلال زيارة[منتدى الدعم](https://forum.groupdocs.com/c/editor/20). -### أين يمكنني شراء ترخيص كامل لـ GroupDocs.Editor لـ .NET؟ - يمكنك شراء ترخيص كامل من[صفحة الشراء](https://purchase.groupdocs.com/buy). \ No newline at end of file +## المشكلات الشائعة والحلول +- **خطأ “File is locked”** – تأكد من استدعاء `Dispose()` على كل `EditableDocument` وعلى كائن `Editor`، أو غلفهم بعبارات `using`. +- **غياب الأنماط بعد التصدير** – تأكد من أنك تحفظ إلى صيغة تدعم الأنماط (مثل XLSX أو PDF). CSV سيفقد التنسيق بطبيعة الحال. +- **المصنفات الكبيرة تسبب بطء الأداء** – استخدم خيارات التحميل المتدفقة (`LoadOptions.Streaming = true`) للحفاظ على استهلاك الذاكرة منخفضًا. + +## الأسئلة المتكررة + +**س: ماذا لو كان المصنف يحتوي على أوراق مخفية؟** +ج: تُعامل الأوراق المخفية كأي ورقة أخرى؛ يمكنك الوصول إليها عبر الفهرس وحفظها، لكن قد تحتاج إلى تعيين `EditableDocument.IsVisible = true` قبل الحفظ إذا أردت ظهورها في النتيجة. + +**س: هل يمكنني تحويل ورقة Excel مباشرة إلى PDF؟** +ج: نعم، حدد `SaveFormat.Pdf` عند استدعاء `Save` على `EditableDocument`. المكتبة تحافظ على التخطيط، والصور، والرسوم البيانية أثناء التحويل. + +**س: هل يمكن تقسيم المصنف إلى ملفات CSV بدلاً من XLSX؟** +ج: بالتأكيد. استخدم `SaveFormat.Csv` لكل `EditableDocument` لإنشاء تمثيلات CSV نصية لكل ورقة. + +**س: هل يدعم GroupDocs.Editor ملفات Excel المحمية بكلمة مرور؟** +ج: نعم. قدّم كلمة المرور عبر `LoadOptions.Password` عند إنشاء كائن `Editor`. + +**س: أين يمكنني العثور على المزيد من الأمثلة للعمل مع جداول البيانات؟** +ج: الوثائق الرسمية ومشاريع العينة على [صفحة التحميل](https://releases.groupdocs.com/editor/net/) تحتوي على حالات استخدام إضافية. + +## الخاتمة +باتباع هذه الخطوات، يمكنك **حفظ كل ورقة Excel** كوثيقة مستقلة، تحويل الأوراق إلى PDF، أو تقسيم المصنفات الكبيرة إلى أجزاء قابلة للإدارة—كل ذلك باستخدام مكتبة GroupDocs.Editor for .NET ذات الأداء العالي والموثوقية. تُسهل هذه القدرة خطوط إعداد التقارير، وتُؤتمت استخراج البيانات، وتقلل من التعامل اليدوي مع جداول البيانات. + +**آخر تحديث:** 2026-06-06 +**تم الاختبار مع:** GroupDocs.Editor 23.11 for .NET +**المؤلف:** GroupDocs + +## دروس ذات صلة + +- [إتقان استخراج أوراق جداول البيانات في .NET باستخدام GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [حماية ملفات Excel بكلمة مرور باستخدام GroupDocs.Editor for .NET | إدارة جداول البيانات الآمنة](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [إتقان تحميل المستندات في .NET باستخدام GroupDocs.Editor: دليل شامل](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/chinese/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/chinese/net/document-processing/work-multi-tab-spreadsheets/_index.md index 0e43c6b0..6422c34f 100644 --- a/content/chinese/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/chinese/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,212 @@ --- -title: 使用多标签电子表格 -linktitle: 使用多标签电子表格 +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET **保存每个 Excel 选项卡**——一步一步的指南、代码片段以及拆分 + XLSX 文件的最佳实践。 +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: 处理多选项卡电子表格 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 了解如何使用 GroupDocs.Editor 在 .NET 中处理多标签电子表格。其中包括分步指南、代码示例和最佳实践。 -weight: 17 -url: /zh/net/document-processing/work-multi-tab-spreadsheets/ +title: 如何使用 GroupDocs.Editor .NET 保存每个 Excel 选项卡 type: docs +url: /zh/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- + # 使用多标签电子表格 ## 介绍 -处理多标签电子表格可能是一项艰巨的任务,尤其是当您需要操作或提取同一文档中不同工作表中的数据时。如果您正在使用 .NET 并寻找强大的解决方案,GroupDocs.Editor for .NET 是一个绝佳的选择。在本教程中,我们将引导您完成使用 GroupDocs.Editor for .NET 处理多标签电子表格的过程。我们将介绍从设置环境到将每个标签保存为单独文件的所有内容。 +如果您需要 **将每个 Excel 标签保存为独立文件**,GroupDocs.Editor for .NET 可以轻松实现。无论是提取财务报告、生成部门工作表,还是将标签转换为 PDF,本教程将带您完成整个工作流——从环境设置到资源释放——让您能够自信地自动化多表处理。 + +## 快速答疑 +- **GroupDocs.Editor 能将 XLSX 拆分为单独的文件吗?** 是的,您可以加载工作簿并单独导出每个工作表。 +- **每个标签可以保存为何种格式?** 支持 XLSX、CSV、PDF、HTML 等——超过 30 种输出格式。 +- **此功能需要许可证吗?** 临时许可证可用于测试;生产环境需要正式许可证。 +- **支持 .NET Core 吗?** 完全支持——该库兼容 .NET Framework 4.0+ 以及 .NET Core/5/6+。 +- **一次可以处理多少个标签?** GroupDocs.Editor 能在不将整个文件加载到内存的情况下处理包含 500+ 工作表的工作簿。 + +## 什么是“保存每个 Excel 标签”? +**“保存每个 Excel 标签”** 指的是从多工作表工作簿中提取每个工作表,并将每个工作表写入其独立的文档(例如单独的 XLSX 或 PDF 文件)。这种方法通过为每个工作表提供一个文件,简化了后续处理、报告和分发,可单独共享、归档或进一步转换。 + +## 为什么在此任务中使用 GroupDocs.Editor? +GroupDocs.Editor 支持 **30+ 输入和输出格式**,并且能够处理 **多达 1,000 张工作表** 的电子表格,同时通过流式处理而不是一次性加载整个文件来保持低内存使用。API 还保留单元格样式、公式和嵌入的图像,确保每个导出的标签在外观上与原始文件完全一致。 + ## 先决条件 -在深入学习本教程之前,请确保您已满足以下先决条件: -1. Visual Studio:确保您的机器上安装了 Visual Studio。 -2. .NET Framework:GroupDocs.Editor for .NET 支持 .NET Framework 4.0 或更高版本。 -3. GroupDocs.Editor for .NET:下载并安装 GroupDocs.Editor for .NET 库。您可以从[下载页面](https://releases.groupdocs.com/editor/net/). -4. 许可证:虽然您可以使用[临时执照](https://purchase.groupdocs.com/temporary-license/)为了试用该库,建议购买用于生产的完整许可证。 +在开始之前,请确认您已具备: + +1. **Visual Studio** – 任意近期版本(Community、Professional 或 Enterprise)。 +2. **.NET Framework 4.0+** – 或者如果您偏好跨平台运行时,可使用 .NET Core/5/6。 +3. **GroupDocs.Editor for .NET** – 从[下载页面](https://releases.groupdocs.com/editor/net/)下载。 +4. **License** – 测试时使用[临时许可证](https://purchase.groupdocs.com/temporary-license/)即可;生产使用需购买正式许可证。 +5. **Free trial** – 您也可以通过[免费试用](https://releases.groupdocs.com/)页面尝试该库。 +6. **Support** – 如遇问题,请访问[支持论坛](https://forum.groupdocs.com/c/editor/20)或考虑在[购买页面](https://purchase.groupdocs.com/buy)获取正式许可证。 + ## 导入命名空间 -在开始编码之前,您需要导入必要的命名空间。将以下使用指令添加到 .cs 文件的顶部: +在开始编码之前,您需要导入必要的命名空间。将以下 using 指令添加到 `.cs` 文件的顶部: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1.获取输入文件的路径 -首先,您需要指定输入电子表格文件的路径。此文件应为具有多个选项卡的 XLSX (OOXML)。 + +## 如何将每个 Excel 标签保存为单独的文件? +加载工作簿,为每个工作表创建 `EditableDocument`,并使用所需的格式调用 `Save`。此过程将每个标签隔离,允许您指定不同的输出路径,并自动释放资源。下面是您将遵循的逐步工作流,包含每个 API 调用的说明以及避免常见陷阱的最佳实践提示。 + +### 步骤 1:获取输入文件的路径 +首先,指定包含多个标签的源 XLSX 文件的完整路径。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. 将电子表格加载到编辑器实例中 -接下来,您需要将电子表格加载到`Editor`实例。这是通过使用文件流并为电子表格指定适当的加载选项来完成的。 + +### 步骤 2:将电子表格加载到 Editor 实例中 +`Editor` 类是 GroupDocs.Editor 中所有文档操作的入口。它读取文件流并准备文档以供编辑或提取。 + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - //后续步骤将在此处进行 + // Further steps will go here } } ``` -## 3. 从第一个选项卡创建 EditableDocument -要编辑或操作特定选项卡,您需要创建一个`EditableDocument`该选项卡的实例。该选项卡使用基于 0 的索引指定。 + +### 步骤 3:从第一个标签创建 EditableDocument +`EditableDocument` 表示工作簿中的单个可编辑工作表。构造函数接受 `Editor` 实例和基于零的工作表索引。 + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; //第一个标签 +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. 从第二个选项卡创建 EditableDocument -同样地,创建一个`EditableDocument`对于第二个标签。 + +### 步骤 4:从第二个标签创建 EditableDocument +通过更改索引值,您可以对任何其他工作表重复相同的模式。 + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; //第二个标签 +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. 将第一个标签保存到单独的文档 -现在,将第一个选项卡保存为单独的文档。指定保存格式和输出路径。 + +### 步骤 5:将第一个标签保存为单独的文档 +`Save` 将编辑后的文档以指定格式写入文件。对 `EditableDocument` 实例调用它,提供输出路径和格式(例如 `SaveFormat.Xlsx`)。 + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. 将第二个选项卡保存到单独的文档 -对第二个选项卡重复该过程,但这次以不同的格式保存。 + +### 步骤 6:将第二个标签保存为单独的文档 +对第二个工作表同样使用 `Save` 调用,必要时您可以选择不同的格式,例如 PDF。 + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. 处理 EditableDocument 实例 -最后,确保妥善处理`EditableDocument`实例以释放资源。 + +### 步骤 7:释放 EditableDocument 实例 +`Dispose` 释放文档持有的非托管资源,如文件句柄,确保在长时间运行的服务中不会泄漏。 + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## 常见问题及解决方案 +- **“文件被锁定”错误** – 确保对每个 `EditableDocument` 和 `Editor` 实例调用 `Dispose()`,或将它们放在 `using` 语句块中。 +- **导出后样式缺失** – 确认您保存的格式支持样式(例如 XLSX 或 PDF)。CSV 按设计会丢失格式。 +- **大型工作簿导致性能慢** – 使用流式加载选项 (`LoadOptions.Streaming = true`) 以保持低内存使用。 + +## 常见问题 + +**问:如果我的工作簿包含隐藏工作表怎么办?** +答:隐藏工作表与其他工作表一样处理;您可以通过索引访问并保存它们,但如果希望在输出中可见,可能需要在保存前将 `EditableDocument.IsVisible = true` 设置为 true。 + +**问:我能直接将 Excel 标签转换为 PDF 吗?** +答:可以,在对 `EditableDocument` 调用 `Save` 时指定 `SaveFormat.Pdf`。库在转换过程中会保留布局、图像和图表。 + +**问:是否可以将工作簿拆分为 CSV 文件而不是 XLSX?** +答:完全可以。对每个 `EditableDocument` 使用 `SaveFormat.Csv`,即可生成每个工作表的纯文本 CSV 表示。 + +**问:GroupDocs.Editor 是否支持受密码保护的 Excel 文件?** +答:支持。在创建 `Editor` 实例时通过 `LoadOptions.Password` 提供密码。 + +**问:在哪里可以找到更多关于处理电子表格的示例?** +答:官方文档和位于[下载页面](https://releases.groupdocs.com/editor/net/)的示例项目中包含更多用例。 + ## 结论 -通过遵循这些步骤,您可以使用 GroupDocs.Editor 轻松处理 .NET 中的多标签电子表格。这个功能强大的库简化了在电子表格中编辑和保存不同工作表的过程,使您的开发任务更易于管理。无论您要处理复杂的数据操作还是简单的编辑,GroupDocs.Editor for .NET 都能为您提供高效完成工作所需的工具。 -## 常见问题解答 -### 什么是 GroupDocs.Editor for .NET? -GroupDocs.Editor for .NET 是一个强大的文档编辑 API,允许开发人员在 .NET 应用程序内加载、编辑和保存各种格式的文档。 -### 我可以在购买之前试用 GroupDocs.Editor for .NET 吗? -是的,你可以使用[免费试用](https://releases.groupdocs.com/)或请求[临时执照](https://purchase.groupdocs.com/temporary-license/)来评价产品。 -### GroupDocs.Editor for .NET 支持哪些文件格式? -GroupDocs.Editor 支持多种格式,包括 DOCX、XLSX、PPTX、PDF 等。 -### 如何获得 .NET 的 GroupDocs.Editor 支持? -您可以通过访问获得支持[支持论坛](https://forum.groupdocs.com/c/editor/20). -### 我可以在哪里购买 GroupDocs.Editor for .NET 的完整许可证? -您可以从[购买页面](https://purchase.groupdocs.com/buy). \ No newline at end of file +通过遵循这些步骤,您可以 **将每个 Excel 标签保存为独立文档**,将标签转换为 PDF,或将大型工作簿拆分为可管理的块——全部使用可靠的高性能 GroupDocs.Editor for .NET 库。此功能简化了报告流水线,自动化数据提取,并减少了手动处理电子表格的工作量。 + +--- + +**最后更新:** 2026-06-06 +**测试环境:** GroupDocs.Editor 23.11 for .NET +**作者:** GroupDocs + +--- + +## 相关教程 + +- [在 .NET 中使用 GroupDocs.Editor 掌握电子表格标签提取](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [使用 GroupDocs.Editor for .NET 为 Excel 文件设置密码 | 安全电子表格管理](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [在 .NET 中精通文档加载:GroupDocs.Editor 综合指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/czech/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/czech/net/document-processing/work-multi-tab-spreadsheets/_index.md index 643d7ddf..113c14c7 100644 --- a/content/czech/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/czech/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,213 @@ --- -title: Práce s vícetabulkovými tabulkami -linktitle: Práce s vícetabulkovými tabulkami +date: 2026-06-06 +description: Naučte se, jak **uložit každý list Excelu** pomocí GroupDocs.Editor pro + .NET – krok za krokem průvodce, ukázky kódu a osvědčené postupy pro rozdělení souborů + XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Práce s vícelistovými tabulkami +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Naučte se pracovat s vícekartovými tabulkami v .NET pomocí GroupDocs.Editor. Součástí je podrobný průvodce, příklady kódu a osvědčené postupy. -weight: 17 -url: /cs/net/document-processing/work-multi-tab-spreadsheets/ +title: Jak uložit každý list Excelu pomocí GroupDocs.Editor .NET type: docs +url: /cs/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Práce s vícetabulkovými tabulkami + +# Práce s vícelistovými tabulkami ## Úvod -Manipulace s tabulkami s více kartami může být docela náročný úkol, zvláště když potřebujete manipulovat nebo extrahovat data z různých listů ve stejném dokumentu. Pokud pracujete s .NET a hledáte robustní řešení, GroupDocs.Editor pro .NET je vynikající volbou. V tomto tutoriálu vás provedeme procesem práce s vícekartovými tabulkami pomocí GroupDocs.Editor pro .NET. Pokryjeme vše od nastavení prostředí až po uložení každé karty jako samostatného souboru. -## Předpoklady -Než se pustíte do výukového programu, ujistěte se, že máte splněny následující předpoklady: -1. Visual Studio: Ujistěte se, že máte na svém počítači nainstalované Visual Studio. -2. .NET Framework: GroupDocs.Editor pro .NET podporuje rozhraní .NET Framework 4.0 nebo vyšší. -3. GroupDocs.Editor pro .NET: Stáhněte a nainstalujte knihovnu GroupDocs.Editor pro .NET. Můžete to získat z[stránka ke stažení](https://releases.groupdocs.com/editor/net/). -4. Licence: I když můžete použít a[dočasná licence](https://purchase.groupdocs.com/temporary-license/) pro vyzkoušení knihovny se doporučuje zakoupit plnou licenci pro produkční použití. +Pokud potřebujete **uložit každý list Excelu** jako samostatný soubor, GroupDocs.Editor pro .NET to usnadňuje. Ať už extrahujete finanční zprávy, vytváříte listy podle oddělení nebo převádíte listy do PDF, tento tutoriál vás provede celým pracovním postupem – od nastavení prostředí až po uvolnění prostředků – takže můžete s jistotou automatizovat práci s více listy. + +## Rychlé odpovědi +- **Může GroupDocs.Editor rozdělit soubor XLSX na samostatné soubory?** Ano, můžete načíst sešit a exportovat každý list samostatně. +- **Do jakých formátů lze každý list uložit?** XLSX, CSV, PDF, HTML a další – podporuje se více než 30 výstupních formátů. +- **Potřebuji pro tuto funkci licenci?** Dočasná licence stačí pro testování; pro produkční použití je vyžadována plná licence. +- **Je podporován .NET Core?** Ano – knihovna funguje s .NET Framework 4.0+ a .NET Core/5/6+. +- **Kolik listů lze zpracovat najednou?** GroupDocs.Editor dokáže zpracovat sešity s více než 500 listy, aniž by načítal celý soubor do paměti. + +## Co znamená „uložit každý list Excelu“? +**„Uložit každý list Excelu“** znamená extrahovat každý list z vícelistového sešitu a zapsat jej do samostatného dokumentu (např. oddělené soubory XLSX nebo PDF). Tento přístup zjednodušuje následné zpracování, reportování a distribuci tím, že vám poskytne soubor pro každý list, který lze následně sdílet, archivovat nebo dále transformovat nezávisle. + +## Proč použít GroupDocs.Editor pro tento úkol? +GroupDocs.Editor podporuje **více než 30 vstupních a výstupních formátů** a může zpracovávat tabulky s **až 1 000 listy**, přičemž udržuje nízkou spotřebu paměti díky streamování dat místo načítání celého souboru. API také zachovává styly buněk, vzorce a vložené obrázky, což zajišťuje, že každý exportovaný list vypadá identicky jako originál. + +## Požadavky +Než začnete, ověřte, že máte: + +1. **Visual Studio** – jakékoli nedávné vydání (Community, Professional nebo Enterprise). +2. **.NET Framework 4.0+** – nebo .NET Core/5/6, pokud dáváte přednost multiplatformnímu runtime. +3. **GroupDocs.Editor for .NET** – stáhněte jej ze [stránky ke stažení](https://releases.groupdocs.com/editor/net/). +4. **Licence** – [dočasná licence](https://purchase.groupdocs.com/temporary-license/) stačí pro testování; pro produkční použití zakupte plnou licenci. +5. **Bezplatná zkušební verze** – můžete také vyzkoušet knihovnu na stránce [bezplatná zkušební verze](https://releases.groupdocs.com/). +6. **Podpora** – pokud narazíte na problémy, navštivte [fórum podpory](https://forum.groupdocs.com/c/editor/20) nebo zvažte [stránku nákupu](https://purchase.groupdocs.com/buy) pro plnou licenci. + ## Importovat jmenné prostory -Než začneme kódovat, musíte importovat potřebné jmenné prostory. Na začátek souboru .cs přidejte následující pomocí direktiv: +Než začneme kódovat, musíte importovat potřebné jmenné prostory. Přidejte následující using direktivy na začátek vašeho souboru `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Získejte cestu ke vstupnímu souboru -Nejprve musíte zadat cestu ke vstupnímu souboru tabulky. Tento soubor by měl být XLSX (OOXML) s více kartami. + +## Jak uložit každý list Excelu jako samostatný soubor? +Načtěte sešit, vytvořte `EditableDocument` pro každý list a zavolejte `Save` s požadovaným formátem. Tento proces izoluje každý list, umožní vám zvolit odlišnou výstupní cestu a automaticky uvolní prostředky. Níže je krok za krokem workflow, který budete následovat, s vysvětlením každého volání API a tipy na osvědčené postupy, jak se vyhnout běžným úskalím. + +### Krok 1: Získat cestu k vstupnímu souboru +Nejprve zadejte úplnou cestu ke zdrojovému souboru XLSX, který obsahuje více listů. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Načtěte tabulku do instance editoru - Dále načtete tabulku do souboru`Editor` instance. To se provádí pomocí datového proudu souboru a určením vhodných možností načtení pro tabulku. + +### Krok 2: Načíst tabulku do instance Editoru +Třída `Editor` je vstupním bodem pro všechny operace s dokumenty v GroupDocs.Editor. Načte stream souboru a připraví dokument pro úpravy nebo extrakci. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Další kroky budou směřovat sem + // Further steps will go here } } ``` -## 3. Vytvořte EditableDocument z první záložky - Chcete-li upravit nebo upravit konkrétní kartu, musíte ji vytvořit`EditableDocument` například pro tuto kartu. Karta je určena pomocí indexu založeného na nule. + +### Krok 3: Vytvořit EditableDocument z prvního listu +`EditableDocument` představuje jeden, editovatelný list v sešitu. Konstruktor přijímá instanci `Editor` a index listu počítaný od nuly. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // První záložka +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Vytvořte EditableDocument z druhé záložky - Podobně vytvořte`EditableDocument` pro druhou záložku. + +### Krok 4: Vytvořit EditableDocument ze druhého listu +Stejný vzor můžete opakovat pro jakýkoli další list změnou hodnoty indexu. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Druhá záložka +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Uložte první záložku do samostatného dokumentu -Nyní uložte první kartu jako samostatný dokument. Zadejte formát uložení a výstupní cestu. + +### Krok 5: Uložit první list do samostatného dokumentu +`Save` zapíše upravený dokument do souboru ve specifikovaném formátu. Zavolejte jej na instanci `EditableDocument` a zadejte výstupní cestu a formát (např. `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Uložte druhou kartu do samostatného dokumentu -Opakujte postup pro druhou kartu, ale tentokrát ji uložte v jiném formátu. + +### Krok 6: Uložit druhý list do samostatného dokumentu +Stejné volání `Save` funguje i pro druhý list a můžete zvolit jiný formát, například PDF, pokud je potřeba. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Zlikvidujte EditableDocument instance - Nakonec se ujistěte, že jste je správně zlikvidovali`EditableDocument` instance pro uvolnění zdrojů. + +### Krok 7: Uvolnit instance EditableDocument +`Dispose` uvolní neřízené prostředky držené dokumentem, jako jsou souborové handly, a zajistí, že v dlouhodobě běžících službách nedojde k únikům. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Časté problémy a řešení +- **Chyby „Soubor je uzamčen“** – Ujistěte se, že voláte `Dispose()` na každém `EditableDocument` a na instanci `Editor`, nebo je obalte do `using` bloků. +- **Chybějící styly po exportu** – Ověřte, že ukládáte do formátu, který podporuje stylování (např. XLSX nebo PDF). CSV formát ztrácí formátování záměrně. +- **Velké sešity způsobují pomalý výkon** – Použijte možnosti načítání se streamováním (`LoadOptions.Streaming = true`), aby byla spotřeba paměti nízká. + +## Často kladené otázky + +**Otázka: Co když můj sešit obsahuje skryté listy?** +Odpověď: Skryté listy jsou zpracovány jako jakýkoli jiný list; můžete k nim přistupovat podle indexu a uložit je, ale možná budete muset před uložením nastavit `EditableDocument.IsVisible = true`, pokud chcete, aby byly ve výstupu viditelné. + +**Otázka: Mohu převést list Excelu přímo do PDF?** +Odpověď: Ano, při volání `Save` na `EditableDocument` specifikujte `SaveFormat.Pdf`. Knihovna během konverze zachovává rozvržení, obrázky a grafy. + +**Otázka: Je možné rozdělit sešit na CSV soubory místo XLSX?** +Odpověď: Rozhodně. Pro každý `EditableDocument` použijte `SaveFormat.Csv` a získáte čistý textový CSV reprezentaci každého listu. + +**Otázka: Podporuje GroupDocs.Editor soubory Excel chráněné heslem?** +Odpověď: Ano. Při vytváření instance `Editor` poskytněte heslo pomocí `LoadOptions.Password`. + +**Otázka: Kde najdu další příklady práce s tabulkami?** +Odpověď: Oficiální dokumentace a ukázkové projekty na [stránce ke stažení](https://releases.groupdocs.com/editor/net/) obsahují další případy použití. + ## Závěr -Podle těchto kroků můžete snadno pracovat s vícekartovými tabulkami v .NET pomocí GroupDocs.Editor. Tato výkonná knihovna zjednodušuje proces úprav a ukládání různých listů v tabulkovém procesoru, díky čemuž jsou vaše vývojářské úkoly lépe zvládnutelné. Ať už máte co do činění se složitou manipulací s daty nebo jednoduchými úpravami, GroupDocs.Editor for .NET poskytuje nástroje, které potřebujete k efektivnímu provedení práce. -## FAQ -### Co je GroupDocs.Editor pro .NET? -GroupDocs.Editor for .NET je výkonné rozhraní API pro úpravu dokumentů, které umožňuje vývojářům načítat, upravovat a ukládat dokumenty různých formátů v rámci aplikací .NET. -### Mohu GroupDocs.Editor for .NET vyzkoušet před zakoupením? - Ano, můžete použít a[zkušební verze zdarma](https://releases.groupdocs.com/) nebo požádat a[dočasná licence](https://purchase.groupdocs.com/temporary-license/) hodnotit produkt. -### Jaké formáty souborů podporuje GroupDocs.Editor pro .NET? -GroupDocs.Editor podporuje širokou škálu formátů, včetně DOCX, XLSX, PPTX, PDF a mnoha dalších. -### Jak získám podporu pro GroupDocs.Editor pro .NET? - Podporu můžete získat návštěvou stránky[Fórum podpory](https://forum.groupdocs.com/c/editor/20). -### Kde si mohu koupit plnou licenci pro GroupDocs.Editor pro .NET? - Plnou licenci si můžete zakoupit od[nákupní stránku](https://purchase.groupdocs.com/buy). \ No newline at end of file +Postupováním podle těchto kroků můžete **uložit každý list Excelu** jako nezávislý dokument, převést listy do PDF nebo rozdělit velké sešity na přehledné části – vše s spolehlivou, vysoce výkonnou knihovnou GroupDocs.Editor pro .NET. Tato schopnost zjednodušuje reportingové pipeline, automatizuje extrakci dat a snižuje ruční manipulaci s tabulkami. + +--- + +**Poslední aktualizace:** 2026-06-06 +**Testováno s:** GroupDocs.Editor 23.11 pro .NET +**Autor:** GroupDocs + +--- + +## Související tutoriály + +- [Mistrovské extrahování listů tabulek v .NET s GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Zabezpečení souborů Excel heslem pomocí GroupDocs.Editor pro .NET \| Správa zabezpečených tabulek](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Mistrovské načítání dokumentů v .NET s GroupDocs.Editor: Kompletní průvodce](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/dutch/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/dutch/net/document-processing/work-multi-tab-spreadsheets/_index.md index f1604745..e6949a30 100644 --- a/content/dutch/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/dutch/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: Werken met spreadsheets met meerdere tabbladen +date: 2026-06-06 +description: Leer hoe je **elk Excel-tabblad** kunt opslaan met GroupDocs.Editor voor + .NET – stapsgewijze handleiding, code‑fragmenten en best practices voor het splitsen + van XLSX‑bestanden. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files linktitle: Werken met spreadsheets met meerdere tabbladen +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Leer hoe u kunt werken met spreadsheets met meerdere tabbladen in .NET met behulp van GroupDocs.Editor. Inclusief stapsgewijze handleiding, codevoorbeelden en best practices. -weight: 17 -url: /nl/net/document-processing/work-multi-tab-spreadsheets/ +title: Hoe elk Excel-tabblad opslaan met GroupDocs.Editor .NET type: docs +url: /nl/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Werken met spreadsheets met meerdere tabbladen - -## Invoering -Het omgaan met spreadsheets met meerdere tabbladen kan een hele klus zijn, vooral als u gegevens uit verschillende werkbladen binnen hetzelfde document moet manipuleren of extraheren. Als u met .NET werkt en op zoek bent naar een robuuste oplossing, is GroupDocs.Editor voor .NET een uitstekende keuze. In deze zelfstudie leiden we u door het proces van het werken met spreadsheets met meerdere tabbladen met behulp van GroupDocs.Editor voor .NET. We behandelen alles, van het instellen van uw omgeving tot het opslaan van elk tabblad als een afzonderlijk bestand. -## Vereisten -Voordat u in de zelfstudie duikt, moet u ervoor zorgen dat u aan de volgende vereisten voldoet: -1. Visual Studio: Zorg ervoor dat Visual Studio op uw computer is geïnstalleerd. -2. .NET Framework: GroupDocs.Editor voor .NET ondersteunt .NET Framework 4.0 of hoger. -3. GroupDocs.Editor voor .NET: Download en installeer de GroupDocs.Editor voor .NET-bibliotheek. U kunt deze verkrijgen bij de[downloadpagina](https://releases.groupdocs.com/editor/net/). -4. Licentie: Hoewel u een[tijdelijke licentie](https://purchase.groupdocs.com/temporary-license/) Om de bibliotheek uit te proberen, is het raadzaam een volledige licentie voor productiegebruik aan te schaffen. -## Naamruimten importeren -Voordat we beginnen met coderen, moet u de benodigde naamruimten importeren. Voeg de volgende gebruiksinstructies toe bovenaan uw .cs-bestand: + +# Werken met meerdere tabbladen in spreadsheets + +## Introductie +Als je elke Excel‑tabblad als een onafhankelijk bestand wilt **opslaan**, maakt GroupDocs.Editor for .NET het moeiteloos. Of je nu financiële rapporten extraheert, per‑afdeling werkbladen genereert, of tabbladen naar PDF converteert, deze tutorial leidt je door de volledige workflow — van het opzetten van de omgeving tot het vrijgeven van bronnen — zodat je multi‑sheet verwerking met vertrouwen kunt automatiseren. + +## Snelle antwoorden +- **Kan GroupDocs.Editor een XLSX splitsen in afzonderlijke bestanden?** Ja, je kunt de werkmap laden en elk blad afzonderlijk exporteren. +- **In welke formaten kan elk tabblad worden opgeslagen?** XLSX, CSV, PDF, HTML en meer – meer dan 30 uitvoerformaten worden ondersteund. +- **Heb ik een licentie nodig voor deze functie?** Een tijdelijke licentie werkt voor testen; een volledige licentie is vereist voor productie. +- **Wordt .NET Core ondersteund?** Absoluut – de bibliotheek werkt met .NET Framework 4.0+ en .NET Core/5/6+. +- **Hoeveel tabbladen kunnen er tegelijk worden verwerkt?** GroupDocs.Editor kan werkmappen met meer dan 500 bladen aan zonder het hele bestand in het geheugen te laden. + +## Wat betekent “save each excel tab”? +**“Save each Excel tab”** betekent het extraheren van elk werkblad uit een multi‑sheet werkmap en elk werkblad naar een eigen losstaand document schrijven (bijv. aparte XLSX‑ of PDF‑bestanden). Deze aanpak vereenvoudigt downstream verwerking, rapportage en distributie door je een bestand per blad te geven, dat vervolgens onafhankelijk kan worden gedeeld, gearchiveerd of verder getransformeerd. + +## Waarom GroupDocs.Editor voor deze taak gebruiken? +GroupDocs.Editor ondersteunt **meer dan 30 invoer‑ en uitvoerformaten** en kan spreadsheets met **tot 1.000 bladen** verwerken, terwijl het geheugenverbruik laag blijft door data te streamen in plaats van het volledige bestand te laden. De API behoudt ook celstijlen, formules en ingesloten afbeeldingen, waardoor elk geëxporteerd tabblad er identiek uitziet als het origineel. + +## Voorvereisten +1. **Visual Studio** – elke recente editie (Community, Professional of Enterprise). +2. **.NET Framework 4.0+** – of .NET Core/5/6 als je de cross‑platform runtime verkiest. +3. **GroupDocs.Editor for .NET** – download het van de [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – een [temporary license](https://purchase.groupdocs.com/temporary-license/) is voldoende voor testen; koop een volledige licentie voor productie. +5. **Free trial** – je kunt de bibliotheek ook uitproberen via de [free trial](https://releases.groupdocs.com/) pagina. +6. **Support** – als je problemen ondervindt, bezoek dan het [support forum](https://forum.groupdocs.com/c/editor/20) of overweeg de [purchase page](https://purchase.groupdocs.com/buy) voor een volledige licentie. + +## Importeer Namespaces +Voordat we beginnen met coderen, moet je de benodigde namespaces importeren. Voeg de volgende using‑directieven toe aan de bovenkant van je `.cs`‑bestand: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Haal een pad naar het invoerbestand op -Eerst moet u het pad naar uw invoerspreadsheetbestand opgeven. Dit bestand moet een XLSX (OOXML) zijn met meerdere tabbladen. + +## Hoe elk Excel‑tabblad opslaan als een apart bestand? +Laad de werkmap, maak een `EditableDocument` voor elk blad, en roep `Save` aan met het gewenste formaat. Dit proces isoleert elk tabblad, laat je een apart uitvoerpad kiezen, en geeft bronnen automatisch vrij. Hieronder vind je de stap‑voor‑stap workflow die je volgt, met uitleg voor elke API‑aanroep en best‑practice tips om veelvoorkomende valkuilen te vermijden. + +### Stap 1: Haal een pad op naar het invoerbestand +Geef eerst het volledige pad op naar de bron‑XLSX die meerdere tabbladen bevat. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Laad het spreadsheet in het Editor-exemplaar - Vervolgens laadt u de spreadsheet in een`Editor` voorbeeld. Dit wordt gedaan met behulp van een bestandsstroom en het specificeren van de juiste laadopties voor een spreadsheet. + +### Stap 2: Laad de spreadsheet in de Editor‑instantie +De `Editor`‑klasse is het toegangspunt voor alle documentbewerkingen in GroupDocs.Editor. Het leest de bestandsstroom en bereidt het document voor op bewerken of extraheren. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Verdere stappen zullen hier plaatsvinden + // Further steps will go here } } ``` -## 3. Maak een bewerkbaar document vanaf het eerste tabblad - Om een specifiek tabblad te bewerken of manipuleren, moet u een`EditableDocument` bijvoorbeeld voor dat tabblad. Het tabblad wordt opgegeven met behulp van een op 0 gebaseerde index. + +### Stap 3: Maak een EditableDocument van het eerste tabblad +`EditableDocument` vertegenwoordigt een enkel, bewerkbaar blad binnen de werkmap. De constructor neemt de `Editor`‑instantie en een nul‑gebaseerde blad‑index. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Eerste tabblad +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Maak een bewerkbaar document vanaf het tweede tabblad - Maak op dezelfde manier een`EditableDocument` voor het tweede tabblad. + +### Stap 4: Maak een EditableDocument van het tweede tabblad +Je kunt hetzelfde patroon herhalen voor elk extra blad door de indexwaarde te wijzigen. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Tweede tabblad +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Sla het eerste tabblad op in een afzonderlijk document -Sla nu het eerste tabblad op als een afzonderlijk document. Geef het opslagformaat en het uitvoerpad op. + +### Stap 5: Sla het eerste tabblad op als een apart document +`Save` schrijft het bewerkte document naar een bestand in het opgegeven formaat. Roep het aan op de `EditableDocument`‑instantie, met het uitvoerpad en formaat (bijv. `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Sla het tweede tabblad op in een afzonderlijk document -Herhaal het proces voor het tweede tabblad, maar sla het deze keer op in een ander formaat. + +### Stap 6: Sla het tweede tabblad op als een apart document +Dezelfde `Save`‑aanroep werkt voor het tweede blad, en je kunt een ander formaat kiezen, zoals PDF, indien nodig. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Gooi EditableDocument-exemplaren weg - Zorg er ten slotte voor dat u het afval op de juiste manier weggooit`EditableDocument` instances om bronnen vrij te maken. + +### Stap 7: Ruim EditableDocument‑instanties op +`Dispose` geeft niet‑beheerde bronnen vrij die door het document worden gehouden, zoals bestands‑handles, waardoor er geen lekken ontstaan in langdurige services. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Conclusie -Door deze stappen te volgen, kunt u eenvoudig werken met spreadsheets met meerdere tabbladen in .NET met behulp van GroupDocs.Editor. Deze krachtige bibliotheek vereenvoudigt het proces van het bewerken en opslaan van verschillende werkbladen in een spreadsheet, waardoor uw ontwikkelingstaken beter beheersbaar worden. Of u nu te maken heeft met complexe gegevensmanipulatie of met eenvoudige bewerkingen, GroupDocs.Editor voor .NET biedt de tools die u nodig hebt om de klus efficiënt te klaren. +## Veelvoorkomende problemen en oplossingen +- **“File is locked” fouten** – Zorg ervoor dat je `Dispose()` aanroept op elk `EditableDocument` en de `Editor`‑instantie, of wikkel ze in `using`‑statements. +- **Ontbrekende stijlen na export** – Controleer of je opslaat naar een formaat dat opmaak ondersteunt (bijv. XLSX of PDF). CSV verliest opmaak per definitie. +- **Grote werkmappen veroorzaken trage prestaties** – Gebruik de streaming‑laadopties (`LoadOptions.Streaming = true`) om het geheugenverbruik laag te houden. + ## Veelgestelde vragen -### Wat is GroupDocs.Editor voor .NET? -GroupDocs.Editor voor .NET is een krachtige API voor documentbewerking waarmee ontwikkelaars documenten in verschillende formaten kunnen laden, bewerken en opslaan binnen .NET-toepassingen. -### Kan ik GroupDocs.Editor voor .NET uitproberen voordat ik het aanschaf? - Ja, u kunt gebruik maken van een[gratis proefperiode](https://releases.groupdocs.com/) of vraag een[tijdelijke licentie](https://purchase.groupdocs.com/temporary-license/) om het product te beoordelen. -### Welke bestandsformaten worden ondersteund door GroupDocs.Editor voor .NET? -GroupDocs.Editor ondersteunt een breed scala aan formaten, waaronder DOCX, XLSX, PPTX, PDF en nog veel meer. -### Hoe krijg ik ondersteuning voor GroupDocs.Editor voor .NET? - U kunt ondersteuning krijgen door naar de[Helpforum](https://forum.groupdocs.com/c/editor/20). -### Waar kan ik een volledige licentie voor GroupDocs.Editor voor .NET kopen? - U kunt een volledige licentie aanschaffen bij de[aankooppagina](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**Q: Wat als mijn werkmap verborgen bladen bevat?** +A: Verborgen bladen worden behandeld als elk ander blad; je kunt ze via de index benaderen en opslaan, maar je moet mogelijk `EditableDocument.IsVisible = true` instellen vóór het opslaan als je ze zichtbaar wilt in de output. + +**Q: Kan ik een Excel‑tabblad direct naar PDF converteren?** +A: Ja, specificeer `SaveFormat.Pdf` bij het aanroepen van `Save` op het `EditableDocument`. De bibliotheek behoudt lay-out, afbeeldingen en grafieken tijdens de conversie. + +**Q: Is het mogelijk om een werkmap te splitsen in CSV‑bestanden in plaats van XLSX?** +A: Absoluut. Gebruik `SaveFormat.Csv` voor elk `EditableDocument` om platte‑tekst CSV‑representaties van elk blad te genereren. + +**Q: Ondersteunt GroupDocs.Editor wachtwoord‑beveiligde Excel‑bestanden?** +A: Ja. Geef het wachtwoord op via `LoadOptions.Password` bij het maken van de `Editor`‑instantie. + +**Q: Waar kan ik meer voorbeelden vinden van werken met spreadsheets?** +A: De officiële documentatie en voorbeeldprojecten op de [download page](https://releases.groupdocs.com/editor/net/) bevatten extra use‑cases. + +## Conclusie +Door deze stappen te volgen, kun je **elke Excel‑tabblad** opslaan als een onafhankelijk document, tabbladen naar PDF converteren, en grote werkmappen opsplitsen in beheersbare stukken — allemaal met de betrouwbare, high‑performance GroupDocs.Editor for .NET bibliotheek. Deze mogelijkheid stroomlijnt rapportage‑pijplijnen, automatiseert data‑extractie, en vermindert handmatige spreadsheet‑verwerking. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## Gerelateerde tutorials + +- [Meester Spreadsheet Tab Extractie in .NET met GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Excel‑bestanden beveiligen met GroupDocs.Editor voor .NET | Beheer van beveiligde spreadsheets](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Documentladen onder de knie krijgen in .NET met GroupDocs.Editor: Een uitgebreide gids](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/english/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/english/net/document-processing/work-multi-tab-spreadsheets/_index.md index 2a2c9e10..28a95d52 100644 --- a/content/english/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/english/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,36 +1,119 @@ --- -title: Work with Multi-Tab Spreadsheets +title: "How to save each Excel tab with GroupDocs.Editor .NET" linktitle: Work with Multi-Tab Spreadsheets second_title: GroupDocs.Editor .NET API -description: Learn how to work with multi-tab spreadsheets in .NET using GroupDocs.Editor. Step-by-step guide, code examples, and best practices included. +description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. weight: 17 url: /net/document-processing/work-multi-tab-spreadsheets/ type: docs +date: 2026-06-06 +keywords: + - save each excel tab + - read multiple sheets + - convert excel tab pdf + - split xlsx files +schemas: +- type: TechArticle + headline: How to save each Excel tab with GroupDocs.Editor .NET + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + dateModified: '2026-06-06' + author: GroupDocs +- type: HowTo + name: How to save each Excel tab with GroupDocs.Editor .NET + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' +- type: FAQPage + questions: + - question: What if my workbook contains hidden sheets? + answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + - question: Can I convert an Excel tab directly to PDF? + answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + - question: Is it possible to split a workbook into CSV files instead of XLSX? + answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + - question: Does GroupDocs.Editor support password‑protected Excel files? + answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + - question: Where can I find more examples of working with spreadsheets? + answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. --- # Work with Multi-Tab Spreadsheets ## Introduction -Handling multi-tab spreadsheets can be quite a task, especially when you need to manipulate or extract data from different sheets within the same document. If you're working with .NET and looking for a robust solution, GroupDocs.Editor for .NET is an excellent choice. In this tutorial, we will walk you through the process of working with multi-tab spreadsheets using GroupDocs.Editor for .NET. We'll cover everything from setting up your environment to saving each tab as a separate file. +If you need to **save each Excel tab** as an independent file, GroupDocs.Editor for .NET makes it painless. Whether you’re extracting financial reports, generating per‑department worksheets, or converting tabs to PDF, this tutorial walks you through the entire workflow—from environment setup to disposing of resources—so you can automate multi‑sheet handling with confidence. + +## Quick Answers +- **Can GroupDocs.Editor split an XLSX into separate files?** Yes, you can load the workbook and export each sheet individually. +- **What formats can each tab be saved as?** XLSX, CSV, PDF, HTML, and more – over 30 output formats are supported. +- **Do I need a license for this feature?** A temporary license works for testing; a full license is required for production. +- **Is .NET Core supported?** Absolutely – the library works with .NET Framework 4.0+ and .NET Core/5/6+. +- **How many tabs can be processed at once?** GroupDocs.Editor can handle workbooks with 500+ sheets without loading the whole file into memory. + +## What is “save each excel tab”? +**“Save each Excel tab”** means extracting every worksheet from a multi‑sheet workbook and writing each one to its own standalone document (e.g., separate XLSX or PDF files). This approach simplifies downstream processing, reporting, and distribution by giving you a file per sheet, which can then be shared, archived, or further transformed independently. + +## Why use GroupDocs.Editor for this task? +GroupDocs.Editor supports **30+ input and output formats** and can process spreadsheets with **up to 1,000 sheets** while keeping memory usage low by streaming data instead of loading the entire file. The API also preserves cell styles, formulas, and embedded images, ensuring that each exported tab looks identical to the original. + ## Prerequisites -Before diving into the tutorial, make sure you have the following prerequisites in place: -1. Visual Studio: Ensure you have Visual Studio installed on your machine. -2. .NET Framework: GroupDocs.Editor for .NET supports .NET Framework 4.0 or higher. -3. GroupDocs.Editor for .NET: Download and install the GroupDocs.Editor for .NET library. You can get it from the [download page](https://releases.groupdocs.com/editor/net/). -4. License: While you can use a [temporary license](https://purchase.groupdocs.com/temporary-license/) to try out the library, it's recommended to purchase a full license for production use. +Before diving in, verify that you have: + +1. **Visual Studio** – any recent edition (Community, Professional, or Enterprise). +2. **.NET Framework 4.0+** – or .NET Core/5/6 if you prefer the cross‑platform runtime. +3. **GroupDocs.Editor for .NET** – download it from the [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – a [temporary license](https://purchase.groupdocs.com/temporary-license/) is fine for testing; purchase a full license for production use. +5. **Free trial** – you can also try the library via the [free trial](https://releases.groupdocs.com/) page. +6. **Support** – if you run into issues, visit the [support forum](https://forum.groupdocs.com/c/editor/20) or consider the [purchase page](https://purchase.groupdocs.com/buy) for a full license. + ## Import Namespaces -Before we start coding, you need to import the necessary namespaces. Add the following using directives to the top of your .cs file: +Before we start coding, you need to import the necessary namespaces. Add the following using directives to the top of your `.cs` file: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Get a Path to the Input File -First, you need to specify the path to your input spreadsheet file. This file should be an XLSX (OOXML) with multiple tabs. + +## How to save each Excel tab as a separate file? +Load the workbook, create an `EditableDocument` for each sheet, and call `Save` with the desired format. This process isolates each tab, lets you choose a distinct output path, and releases resources automatically. Below is the step‑by‑step workflow you’ll follow, with explanations for each API call and best‑practice tips to avoid common pitfalls. + +### Step 1: Get a Path to the Input File +First, specify the full path to the source XLSX that contains multiple tabs. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Load the Spreadsheet into the Editor Instance -Next, you'll load the spreadsheet into an `Editor` instance. This is done using a file stream and specifying the appropriate load options for a spreadsheet. + +### Step 2: Load the Spreadsheet into the Editor Instance +The `Editor` class is the entry point for all document operations in GroupDocs.Editor. It reads the file stream and prepares the document for editing or extraction. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { @@ -40,53 +123,88 @@ using (FileStream inputStream = File.OpenRead(inputFilePath)) } } ``` -## 3. Create an EditableDocument from the First Tab -To edit or manipulate a specific tab, you need to create an `EditableDocument` instance for that tab. The tab is specified using a 0-based index. + +### Step 3: Create an EditableDocument from the First Tab +`EditableDocument` represents a single, editable sheet within the workbook. The constructor takes the `Editor` instance and a zero‑based sheet index. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Create an EditableDocument from the Second Tab -Similarly, create an `EditableDocument` for the second tab. + +### Step 4: Create an EditableDocument from the Second Tab +You can repeat the same pattern for any additional sheet by changing the index value. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Save the First Tab to a Separate Document -Now, save the first tab as a separate document. Specify the save format and output path. + +### Step 5: Save the First Tab to a Separate Document +`Save` writes the edited document to a file in the specified format. Call it on the `EditableDocument` instance, providing the output path and format (e.g., `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Save the Second Tab to a Separate Document -Repeat the process for the second tab, but this time save it in a different format. + +### Step 6: Save the Second Tab to a Separate Document +The same `Save` call works for the second sheet, and you can choose a different format such as PDF if needed. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Dispose of EditableDocument Instances -Finally, ensure that you properly dispose of the `EditableDocument` instances to free up resources. + +### Step 7: Dispose of EditableDocument Instances +`Dispose` releases unmanaged resources held by the document, such as file handles, ensuring no leaks in long‑running services. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Common Issues and Solutions +- **“File is locked” errors** – Ensure you call `Dispose()` on every `EditableDocument` and the `Editor` instance, or wrap them in `using` statements. +- **Missing styles after export** – Verify that you’re saving to a format that supports styling (e.g., XLSX or PDF). CSV will lose formatting by design. +- **Large workbooks cause slow performance** – Use the streaming load options (`LoadOptions.Streaming = true`) to keep memory usage low. + +## Frequently Asked Questions + +**Q: What if my workbook contains hidden sheets?** +A: Hidden sheets are treated like any other sheet; you can access them by index and save them, but you may need to set `EditableDocument.IsVisible = true` before saving if you want them visible in the output. + +**Q: Can I convert an Excel tab directly to PDF?** +A: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. The library preserves layout, images, and charts during conversion. + +**Q: Is it possible to split a workbook into CSV files instead of XLSX?** +A: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate plain‑text CSV representations of each sheet. + +**Q: Does GroupDocs.Editor support password‑protected Excel files?** +A: It does. Provide the password via `LoadOptions.Password` when creating the `Editor` instance. + +**Q: Where can I find more examples of working with spreadsheets?** +A: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) contain additional use‑cases. + ## Conclusion -By following these steps, you can easily work with multi-tab spreadsheets in .NET using GroupDocs.Editor. This powerful library simplifies the process of editing and saving different sheets within a spreadsheet, making your development tasks more manageable. Whether you're dealing with complex data manipulation or simple edits, GroupDocs.Editor for .NET provides the tools you need to get the job done efficiently. -## FAQ's -### What is GroupDocs.Editor for .NET? -GroupDocs.Editor for .NET is a powerful document editing API that allows developers to load, edit, and save documents of various formats within .NET applications. -### Can I try GroupDocs.Editor for .NET before purchasing? -Yes, you can use a [free trial](https://releases.groupdocs.com/) or request a [temporary license](https://purchase.groupdocs.com/temporary-license/) to evaluate the product. -### What file formats are supported by GroupDocs.Editor for .NET? -GroupDocs.Editor supports a wide range of formats, including DOCX, XLSX, PPTX, PDF, and many more. -### How do I get support for GroupDocs.Editor for .NET? -You can get support by visiting the [support forum](https://forum.groupdocs.com/c/editor/20). -### Where can I buy a full license for GroupDocs.Editor for .NET? -You can purchase a full license from the [purchase page](https://purchase.groupdocs.com/buy). +By following these steps, you can **save each Excel tab** as an independent document, convert tabs to PDF, or split large workbooks into manageable pieces—all with the reliable, high‑performance GroupDocs.Editor for .NET library. This capability streamlines reporting pipelines, automates data extraction, and reduces manual spreadsheet handling. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## Related Tutorials + +- [Master Spreadsheet Tab Extraction in .NET with GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Password Protect Excel Files Using GroupDocs.Editor for .NET | Secure Spreadsheet Management](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Mastering Document Loading in .NET with GroupDocs.Editor: A Comprehensive Guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) diff --git a/content/french/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/french/net/document-processing/work-multi-tab-spreadsheets/_index.md index e38eaf87..5c15b9aa 100644 --- a/content/french/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/french/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: Travailler avec des feuilles de calcul multi-onglets -linktitle: Travailler avec des feuilles de calcul multi-onglets -second_title: API GroupDocs.Editor .NET -description: Apprenez à utiliser des feuilles de calcul multi-onglets dans .NET à l'aide de GroupDocs.Editor. Guide étape par étape, exemples de code et meilleures pratiques inclus. -weight: 17 -url: /fr/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: Apprenez à **enregistrer chaque onglet Excel** avec GroupDocs.Editor + pour .NET – guide étape par étape, extraits de code et meilleures pratiques pour + diviser les fichiers XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Travailler avec les feuilles de calcul à onglets multiples +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Comment enregistrer chaque onglet Excel avec GroupDocs.Editor .NET type: docs +url: /fr/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Travailler avec des feuilles de calcul multi-onglets + +# Travailler avec des feuilles de calcul à onglets multiples ## Introduction -La gestion de feuilles de calcul à plusieurs onglets peut s'avérer une tâche ardue, en particulier lorsque vous devez manipuler ou extraire des données de différentes feuilles au sein du même document. Si vous travaillez avec .NET et recherchez une solution robuste, GroupDocs.Editor for .NET est un excellent choix. Dans ce didacticiel, nous vous guiderons tout au long du processus d'utilisation de feuilles de calcul multi-onglets à l'aide de GroupDocs.Editor for .NET. Nous couvrirons tout, de la configuration de votre environnement à l'enregistrement de chaque onglet dans un fichier séparé. -## Conditions préalables -Avant de plonger dans le didacticiel, assurez-vous que les conditions préalables suivantes sont remplies : -1. Visual Studio : assurez-vous que Visual Studio est installé sur votre ordinateur. -2. .NET Framework : GroupDocs.Editor pour .NET prend en charge .NET Framework 4.0 ou version ultérieure. -3. GroupDocs.Editor pour .NET : téléchargez et installez la bibliothèque GroupDocs.Editor pour .NET. Vous pouvez l'obtenir auprès du[page de téléchargement](https://releases.groupdocs.com/editor/net/). -4. Licence : Bien que vous puissiez utiliser un[permis temporaire](https://purchase.groupdocs.com/temporary-license/) pour essayer la bibliothèque, il est recommandé d'acheter une licence complète pour une utilisation en production. -## Importer des espaces de noms -Avant de commencer le codage, vous devez importer les espaces de noms nécessaires. Ajoutez les directives using suivantes en haut de votre fichier .cs : +Si vous devez **save each Excel tab** en tant que fichier indépendant, GroupDocs.Editor for .NET rend cela simple. Que vous extrayiez des rapports financiers, génériez des feuilles de travail par département, ou convertissiez des onglets en PDF, ce tutoriel vous guide à travers l’ensemble du flux de travail — de la configuration de l’environnement à la libération des ressources — afin que vous puissiez automatiser la gestion multi‑feuilles avec confiance. + +## Réponses rapides +- **GroupDocs.Editor peut‑il diviser un XLSX en fichiers séparés ?** Oui, vous pouvez charger le classeur et exporter chaque feuille individuellement. +- **Dans quels formats chaque onglet peut‑il être enregistré ?** XLSX, CSV, PDF, HTML, et plus – plus de 30 formats de sortie sont pris en charge. +- **Ai‑je besoin d’une licence pour cette fonctionnalité ?** Une licence temporaire suffit pour les tests ; une licence complète est requise pour la production. +- **.NET Core est‑il pris en charge ?** Absolument – la bibliothèque fonctionne avec .NET Framework 4.0+ et .NET Core/5/6+. +- **Combien d’onglets peuvent être traités simultanément ?** GroupDocs.Editor peut gérer des classeurs contenant plus de 500 feuilles sans charger le fichier complet en mémoire. + +## Qu’est‑ce que “save each excel tab” ? +**“Save each Excel tab”** signifie extraire chaque feuille de calcul d’un classeur à plusieurs onglets et écrire chacune dans son propre document autonome (par ex., fichiers XLSX ou PDF séparés). Cette approche simplifie le traitement en aval, le reporting et la distribution en vous fournissant un fichier par feuille, qui peut ensuite être partagé, archivé ou transformé indépendamment. + +## Pourquoi utiliser GroupDocs.Editor pour cette tâche ? +GroupDocs.Editor prend en charge **30+ formats d’entrée et de sortie** et peut traiter des feuilles de calcul avec **jusqu’à 1 000 feuilles** tout en maintenant une faible consommation de mémoire grâce au streaming des données plutôt qu’au chargement complet du fichier. L’API préserve également les styles de cellules, les formules et les images intégrées, garantissant que chaque onglet exporté ressemble exactement à l’original. + +## Prérequis +Avant de commencer, assurez‑vous d’avoir : + +1. **Visual Studio** – toute édition récente (Community, Professional ou Enterprise). +2. **.NET Framework 4.0+** – ou .NET Core/5/6 si vous préférez le runtime multiplateforme. +3. **GroupDocs.Editor for .NET** – téléchargez‑le depuis la [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – une [temporary license](https://purchase.groupdocs.com/temporary-license/) convient pour les tests ; achetez une licence complète pour la production. +5. **Free trial** – vous pouvez également essayer la bibliothèque via la page [free trial](https://releases.groupdocs.com/). +6. **Support** – si vous rencontrez des problèmes, visitez le [support forum](https://forum.groupdocs.com/c/editor/20) ou consultez la [purchase page](https://purchase.groupdocs.com/buy) pour une licence complète. + +## Importer les espaces de noms +Avant de commencer à coder, vous devez importer les espaces de noms nécessaires. Ajoutez les directives using suivantes en haut de votre fichier `.cs` : + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Obtenez un chemin d'accès au fichier d'entrée -Tout d’abord, vous devez spécifier le chemin d’accès à votre fichier de feuille de calcul d’entrée. Ce fichier doit être un XLSX (OOXML) avec plusieurs onglets. + +## Comment enregistrer chaque onglet Excel en tant que fichier séparé ? +Chargez le classeur, créez un `EditableDocument` pour chaque feuille, puis appelez `Save` avec le format souhaité. Ce processus isole chaque onglet, vous permet de choisir un chemin de sortie distinct et libère automatiquement les ressources. Vous trouverez ci‑dessous le flux de travail étape par étape, avec des explications pour chaque appel d’API et des conseils de bonnes pratiques pour éviter les pièges courants. + +### Étape 1 : Obtenir le chemin du fichier d’entrée +Tout d’abord, spécifiez le chemin complet du fichier XLSX source contenant plusieurs onglets. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Chargez la feuille de calcul dans l'instance de l'éditeur - Ensuite, vous allez charger la feuille de calcul dans un`Editor` exemple. Cela se fait à l'aide d'un flux de fichiers et en spécifiant les options de chargement appropriées pour une feuille de calcul. + +### Étape 2 : Charger la feuille de calcul dans l’instance Editor +La classe `Editor` est le point d’entrée pour toutes les opérations de document dans GroupDocs.Editor. Elle lit le flux du fichier et prépare le document pour l’édition ou l’extraction. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Les autres étapes seront ici + // Further steps will go here } } ``` -## 3. Créez un document modifiable à partir du premier onglet - Pour modifier ou manipuler un onglet spécifique, vous devez créer un`EditableDocument` exemple pour cet onglet. L'onglet est spécifié à l'aide d'un index basé sur 0. + +### Étape 3 : Créer un EditableDocument à partir du premier onglet +`EditableDocument` représente une seule feuille éditable du classeur. Le constructeur prend l’instance `Editor` et un indice de feuille basé sur zéro. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Premier onglet +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Créez un document modifiable à partir du deuxième onglet - De même, créez un`EditableDocument` pour le deuxième onglet. + +### Étape 4 : Créer un EditableDocument à partir du deuxième onglet +Vous pouvez répéter le même schéma pour toute feuille supplémentaire en modifiant la valeur de l’indice. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Deuxième onglet +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Enregistrez le premier onglet dans un document séparé -Maintenant, enregistrez le premier onglet en tant que document séparé. Spécifiez le format de sauvegarde et le chemin de sortie. + +### Étape 5 : Enregistrer le premier onglet dans un document séparé +`Save` écrit le document édité dans un fichier au format spécifié. Appelez‑le sur l’instance `EditableDocument`, en fournissant le chemin de sortie et le format (par ex., `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Enregistrez le deuxième onglet dans un document séparé -Répétez le processus pour le deuxième onglet, mais cette fois enregistrez-le dans un format différent. + +### Étape 6 : Enregistrer le deuxième onglet dans un document séparé +Le même appel `Save` fonctionne pour la deuxième feuille, et vous pouvez choisir un format différent tel que PDF si nécessaire. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Supprimer les instances EditableDocument - Enfin, assurez-vous de disposer correctement du`EditableDocument` instances pour libérer des ressources. + +### Étape 7 : Libérer les instances EditableDocument +`Dispose` libère les ressources non gérées détenues par le document, comme les handles de fichier, garantissant l’absence de fuites dans les services à long terme. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Problèmes courants et solutions +- **“File is locked” errors** – Assurez‑vous d’appeler `Dispose()` sur chaque `EditableDocument` et sur l’instance `Editor`, ou encapsulez‑les dans des instructions `using`. +- **Missing styles after export** – Vérifiez que vous enregistrez dans un format qui prend en charge le style (par ex., XLSX ou PDF). CSV perdra le formatage par conception. +- **Large workbooks cause slow performance** – Utilisez les options de chargement en streaming (`LoadOptions.Streaming = true`) pour maintenir une faible consommation de mémoire. + +## Questions fréquentes + +**Q : Que se passe‑t‑il si mon classeur contient des feuilles masquées ?** +R : Les feuilles masquées sont traitées comme n’importe quelle autre feuille ; vous pouvez y accéder par indice et les enregistrer, mais il peut être nécessaire de définir `EditableDocument.IsVisible = true` avant l’enregistrement si vous souhaitez qu’elles soient visibles dans le résultat. + +**Q : Puis‑je convertir directement un onglet Excel en PDF ?** +R : Oui, spécifiez `SaveFormat.Pdf` lors de l’appel à `Save` sur le `EditableDocument`. La bibliothèque préserve la mise en page, les images et les graphiques pendant la conversion. + +**Q : Est‑il possible de diviser un classeur en fichiers CSV au lieu de XLSX ?** +R : Absolument. Utilisez `SaveFormat.Csv` pour chaque `EditableDocument` afin de générer des représentations CSV en texte brut de chaque feuille. + +**Q : GroupDocs.Editor prend‑il en charge les fichiers Excel protégés par mot de passe ?** +R : Oui. Fournissez le mot de passe via `LoadOptions.Password` lors de la création de l’instance `Editor`. + +**Q : Où puis‑je trouver plus d’exemples de travail avec les feuilles de calcul ?** +R : La documentation officielle et les projets d’exemple sur la [download page](https://releases.groupdocs.com/editor/net/) contiennent des cas d’utilisation supplémentaires. + ## Conclusion -En suivant ces étapes, vous pouvez facilement travailler avec des feuilles de calcul multi-onglets dans .NET à l'aide de GroupDocs.Editor. Cette puissante bibliothèque simplifie le processus d'édition et d'enregistrement de différentes feuilles dans une feuille de calcul, rendant ainsi vos tâches de développement plus faciles à gérer. Qu'il s'agisse de manipulations de données complexes ou de modifications simples, GroupDocs.Editor for .NET fournit les outils dont vous avez besoin pour effectuer le travail efficacement. -## FAQ -### Qu’est-ce que GroupDocs.Editor pour .NET ? -GroupDocs.Editor for .NET est une puissante API d'édition de documents qui permet aux développeurs de charger, modifier et enregistrer des documents de différents formats dans des applications .NET. -### Puis-je essayer GroupDocs.Editor pour .NET avant d'acheter ? - Oui, vous pouvez utiliser un[essai gratuit](https://releases.groupdocs.com/) ou demander un[permis temporaire](https://purchase.groupdocs.com/temporary-license/) pour évaluer le produit. -### Quels formats de fichiers sont pris en charge par GroupDocs.Editor pour .NET ? -GroupDocs.Editor prend en charge une large gamme de formats, notamment DOCX, XLSX, PPTX, PDF et bien d'autres. -### Comment puis-je obtenir une assistance pour GroupDocs.Editor pour .NET ? - Vous pouvez obtenir de l'aide en visitant le[forum d'entraide](https://forum.groupdocs.com/c/editor/20). -### Où puis-je acheter une licence complète pour GroupDocs.Editor pour .NET ? - Vous pouvez acheter une licence complète auprès du[page d'achat](https://purchase.groupdocs.com/buy). \ No newline at end of file +En suivant ces étapes, vous pouvez **save each Excel tab** en tant que document indépendant, convertir des onglets en PDF ou diviser de grands classeurs en morceaux gérables — le tout avec la bibliothèque fiable et haute performance GroupDocs.Editor for .NET. Cette capacité rationalise les pipelines de reporting, automatise l’extraction de données et réduit la manipulation manuelle des feuilles de calcul. + +--- + +**Dernière mise à jour :** 2026-06-06 +**Testé avec :** GroupDocs.Editor 23.11 for .NET +**Auteur :** GroupDocs + +## Tutoriels associés + +- [Maîtriser l'extraction d'onglets de feuille de calcul en .NET avec GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Protéger par mot de passe les fichiers Excel avec GroupDocs.Editor pour .NET | Gestion sécurisée des feuilles de calcul](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Maîtriser le chargement de documents en .NET avec GroupDocs.Editor : guide complet](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/german/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/german/net/document-processing/work-multi-tab-spreadsheets/_index.md index 1c50a985..a894f060 100644 --- a/content/german/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/german/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: Arbeiten mit Tabellenkalkulationen mit mehreren Registerkarten -linktitle: Arbeiten mit Tabellenkalkulationen mit mehreren Registerkarten +date: 2026-06-06 +description: Erfahren Sie, wie Sie **jedes Excel‑Tabblatt** mit GroupDocs.Editor for + .NET speichern – Schritt‑für‑Schritt‑Anleitung, Code‑Snippets und bewährte Methoden + zum Aufteilen von XLSX‑Dateien. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Arbeiten mit Multi‑Tab‑Tabellen +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Erfahren Sie, wie Sie mit GroupDocs.Editor mit Tabellenkalkulationen mit mehreren Registerkarten in .NET arbeiten. Schritt-für-Schritt-Anleitung, Codebeispiele und bewährte Methoden inklusive. -weight: 17 -url: /de/net/document-processing/work-multi-tab-spreadsheets/ +title: Wie man jedes Excel‑Tabblatt mit GroupDocs.Editor .NET speichert type: docs +url: /de/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Arbeiten mit Tabellenkalkulationen mit mehreren Registerkarten + +# Arbeiten mit Multi-Tab-Tabellenkalkulationen ## Einführung -Die Handhabung von Tabellen mit mehreren Registerkarten kann eine ziemliche Aufgabe sein, insbesondere wenn Sie Daten aus verschiedenen Tabellenblättern innerhalb desselben Dokuments bearbeiten oder extrahieren müssen. Wenn Sie mit .NET arbeiten und nach einer robusten Lösung suchen, ist GroupDocs.Editor für .NET eine ausgezeichnete Wahl. In diesem Tutorial führen wir Sie durch den Prozess der Arbeit mit Tabellen mit mehreren Registerkarten unter Verwendung von GroupDocs.Editor für .NET. Wir behandeln alles, vom Einrichten Ihrer Umgebung bis zum Speichern jeder Registerkarte als separate Datei. +Wenn Sie jede Excel-Registerkarte als eigenständige Datei **speichern** müssen, macht GroupDocs.Editor für .NET das mühelos. Egal, ob Sie Finanzberichte extrahieren, Arbeitsblätter pro Abteilung erstellen oder Registerkarten in PDF konvertieren, führt Sie dieses Tutorial durch den gesamten Arbeitsablauf – von der Einrichtung der Umgebung bis zum Freigeben von Ressourcen – sodass Sie die Verarbeitung mehrerer Tabellenblätter automatisieren können. + +## Schnelle Antworten +- **Kann GroupDocs.Editor eine XLSX in separate Dateien aufteilen?** Ja, Sie können die Arbeitsmappe laden und jedes Blatt einzeln exportieren. +- **In welchen Formaten kann jede Registerkarte gespeichert werden?** XLSX, CSV, PDF, HTML und mehr – über 30 Ausgabeformate werden unterstützt. +- **Benötige ich eine Lizenz für diese Funktion?** Eine temporäre Lizenz funktioniert für Tests; für die Produktion ist eine Voll‑Lizenz erforderlich. +- **Wird .NET Core unterstützt?** Absolut – die Bibliothek funktioniert mit .NET Framework 4.0+ und .NET Core/5/6+. +- **Wie viele Registerkarten können gleichzeitig verarbeitet werden?** GroupDocs.Editor kann Arbeitsmappen mit über 500 Blättern verarbeiten, ohne die gesamte Datei in den Speicher zu laden. + +## Was bedeutet „jede Excel-Registerkarte speichern“? +**„Jede Excel-Registerkarte speichern“** bedeutet, jedes Arbeitsblatt aus einer Arbeitsmappe mit mehreren Blättern zu extrahieren und jedes einzeln in ein eigenständiges Dokument zu schreiben (z. B. separate XLSX‑ oder PDF‑Dateien). Dieser Ansatz vereinfacht die nachgelagerte Verarbeitung, Berichterstellung und Verteilung, indem er Ihnen eine Datei pro Blatt bereitstellt, die dann unabhängig geteilt, archiviert oder weiterverarbeitet werden kann. + +## Warum GroupDocs.Editor für diese Aufgabe verwenden? +GroupDocs.Editor unterstützt **über 30 Eingabe‑ und Ausgabeformate** und kann Tabellenkalkulationen mit **bis zu 1.000 Blättern** verarbeiten, wobei der Speicherverbrauch durch Streaming der Daten niedrig gehalten wird, anstatt die gesamte Datei zu laden. Die API bewahrt zudem Zellstile, Formeln und eingebettete Bilder, sodass jede exportierte Registerkarte exakt wie das Original aussieht. + ## Voraussetzungen -Bevor Sie mit dem Lernprogramm beginnen, stellen Sie sicher, dass die folgenden Voraussetzungen erfüllt sind: -1. Visual Studio: Stellen Sie sicher, dass Visual Studio auf Ihrem Computer installiert ist. -2. .NET Framework: GroupDocs.Editor für .NET unterstützt .NET Framework 4.0 oder höher. -3. GroupDocs.Editor für .NET: Laden Sie die Bibliothek GroupDocs.Editor für .NET herunter und installieren Sie sie. Sie erhalten sie von der[Download-Seite](https://releases.groupdocs.com/editor/net/). -4. Lizenz: Sie können zwar eine[vorläufige Lizenz](https://purchase.groupdocs.com/temporary-license/) Um die Bibliothek auszuprobieren, wird empfohlen, eine Volllizenz für den Produktionseinsatz zu erwerben. +1. **Visual Studio** – jede aktuelle Edition (Community, Professional oder Enterprise). +2. **.NET Framework 4.0+** – oder .NET Core/5/6, falls Sie die plattformübergreifende Laufzeit bevorzugen. +3. **GroupDocs.Editor für .NET** – laden Sie es von der [download page](https://releases.groupdocs.com/editor/net/) herunter. +4. **Lizenz** – eine [temporary license](https://purchase.groupdocs.com/temporary-license/) ist für Tests ausreichend; für den Produktionseinsatz erwerben Sie eine Voll‑Lizenz. +5. **Kostenlose Testversion** – Sie können die Bibliothek auch über die [free trial](https://releases.groupdocs.com/) Seite ausprobieren. +6. **Support** – falls Sie auf Probleme stoßen, besuchen Sie das [support forum](https://forum.groupdocs.com/c/editor/20) oder prüfen Sie die [purchase page](https://purchase.groupdocs.com/buy) für eine Voll‑Lizenz. + ## Namespaces importieren -Bevor wir mit dem Codieren beginnen, müssen Sie die erforderlichen Namespaces importieren. Fügen Sie oben in Ihrer CS-Datei die folgenden using-Direktiven hinzu: +Bevor wir mit dem Codieren beginnen, müssen Sie die erforderlichen Namespaces importieren. Fügen Sie die folgenden using‑Direktiven am Anfang Ihrer `.cs`‑Datei hinzu: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Holen Sie sich einen Pfad zur Eingabedatei -Zuerst müssen Sie den Pfad zu Ihrer Eingabetabellendatei angeben. Diese Datei sollte eine XLSX-Datei (OOXML) mit mehreren Registerkarten sein. + +## Wie speichert man jede Excel-Registerkarte als separate Datei? +Laden Sie die Arbeitsmappe, erstellen Sie ein `EditableDocument` für jedes Blatt und rufen Sie `Save` mit dem gewünschten Format auf. Dieser Vorgang isoliert jede Registerkarte, ermöglicht Ihnen die Angabe eines eigenen Ausgabepfads und gibt Ressourcen automatisch frei. Im Folgenden finden Sie den Schritt‑für‑Schritt‑Ablauf, den Sie befolgen werden, mit Erklärungen zu jedem API‑Aufruf und Best‑Practice‑Hinweisen, um häufige Fallstricke zu vermeiden. + +### Schritt 1: Pfad zur Eingabedatei erhalten +Zuerst geben Sie den vollständigen Pfad zur Quell‑XLSX an, die mehrere Registerkarten enthält. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Laden Sie die Tabelle in die Editor-Instanz - Als nächstes laden Sie die Tabelle in ein`Editor` Instanz. Dies geschieht mithilfe eines Dateistreams und der Angabe der entsprechenden Ladeoptionen für eine Tabelle. + +### Schritt 2: Laden Sie die Tabellenkalkulation in die Editor‑Instanz +Die Klasse `Editor` ist der Einstiegspunkt für alle Dokumentoperationen in GroupDocs.Editor. Sie liest den Dateistream und bereitet das Dokument für die Bearbeitung oder Extraktion vor. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Weitere Schritte folgen hier + // Further steps will go here } } ``` -## 3. Erstellen Sie ein bearbeitbares Dokument auf der ersten Registerkarte - Um eine bestimmte Registerkarte zu bearbeiten oder zu manipulieren, müssen Sie eine`EditableDocument` Instanz für diese Registerkarte. Die Registerkarte wird mit einem 0-basierten Index angegeben. + +### Schritt 3: Erstellen Sie ein EditableDocument aus der ersten Registerkarte +`EditableDocument` repräsentiert ein einzelnes, bearbeitbares Blatt innerhalb der Arbeitsmappe. Der Konstruktor erhält die `Editor`‑Instanz und einen nullbasierten Blatt‑Index. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Erste Registerkarte +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Erstellen Sie ein bearbeitbares Dokument auf der zweiten Registerkarte - Erstellen Sie auf ähnliche Weise eine`EditableDocument` für die zweite Registerkarte. + +### Schritt 4: Erstellen Sie ein EditableDocument aus der zweiten Registerkarte +Sie können dasselbe Muster für jedes weitere Blatt wiederholen, indem Sie den Indexwert ändern. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Zweite Registerkarte +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Speichern Sie die erste Registerkarte in einem separaten Dokument -Speichern Sie nun die erste Registerkarte als separates Dokument. Geben Sie das Speicherformat und den Ausgabepfad an. + +### Schritt 5: Speichern Sie die erste Registerkarte in ein separates Dokument +`Save` schreibt das bearbeitete Dokument in eine Datei im angegebenen Format. Rufen Sie es auf der `EditableDocument`‑Instanz auf und geben Sie den Ausgabepfad sowie das Format an (z. B. `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Speichern Sie die zweite Registerkarte in einem separaten Dokument -Wiederholen Sie den Vorgang für die zweite Registerkarte, speichern Sie sie dieses Mal jedoch in einem anderen Format. + +### Schritt 6: Speichern Sie die zweite Registerkarte in ein separates Dokument +Der gleiche `Save`‑Aufruf funktioniert für das zweite Blatt, und Sie können bei Bedarf ein anderes Format wie PDF wählen. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. EditableDocument-Instanzen entsorgen - Stellen Sie abschließend sicher, dass Sie das`EditableDocument` Instanzen, um Ressourcen freizugeben. + +### Schritt 7: Entsorgen Sie EditableDocument‑Instanzen +`Dispose` gibt nicht verwaltete Ressourcen des Dokuments frei, wie Dateihandles, und stellt sicher, dass in langlaufenden Diensten keine Lecks auftreten. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Abschluss -Wenn Sie diese Schritte befolgen, können Sie mithilfe von GroupDocs.Editor problemlos mit Tabellen mit mehreren Registerkarten in .NET arbeiten. Diese leistungsstarke Bibliothek vereinfacht das Bearbeiten und Speichern verschiedener Blätter in einer Tabelle und macht Ihre Entwicklungsaufgaben leichter handhabbar. Ob Sie mit komplexen Datenmanipulationen oder einfachen Bearbeitungen zu tun haben, GroupDocs.Editor für .NET bietet die Tools, die Sie benötigen, um die Arbeit effizient zu erledigen. +## Häufige Probleme und Lösungen +- **„File is locked“-Fehler** – Stellen Sie sicher, dass Sie `Dispose()` für jedes `EditableDocument` und die `Editor`‑Instanz aufrufen oder sie in `using`‑Anweisungen einbetten. +- **Fehlende Stile nach dem Export** – Vergewissern Sie sich, dass Sie in ein Format speichern, das Stil unterstützt (z. B. XLSX oder PDF). CSV verliert per Definition die Formatierung. +- **Große Arbeitsmappen führen zu langsamer Leistung** – Verwenden Sie die Streaming‑Ladeoptionen (`LoadOptions.Streaming = true`), um den Speicherverbrauch gering zu halten. + ## Häufig gestellte Fragen -### Was ist GroupDocs.Editor für .NET? -GroupDocs.Editor für .NET ist eine leistungsstarke API zur Dokumentbearbeitung, die es Entwicklern ermöglicht, Dokumente verschiedener Formate in .NET-Anwendungen zu laden, zu bearbeiten und zu speichern. -### Kann ich GroupDocs.Editor für .NET vor dem Kauf ausprobieren? - Ja, Sie können ein[Kostenlose Testphase](https://releases.groupdocs.com/) oder fordern Sie ein[vorläufige Lizenz](https://purchase.groupdocs.com/temporary-license/) um das Produkt zu bewerten. -### Welche Dateiformate werden von GroupDocs.Editor für .NET unterstützt? -GroupDocs.Editor unterstützt eine Vielzahl von Formaten, darunter DOCX, XLSX, PPTX, PDF und viele mehr. -### Wie erhalte ich Unterstützung für GroupDocs.Editor für .NET? - Sie erhalten Unterstützung unter[Hilfeforum](https://forum.groupdocs.com/c/editor/20). -### Wo kann ich eine Volllizenz für GroupDocs.Editor für .NET kaufen? - Sie können eine Volllizenz erwerben bei der[Kaufseite](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**Q: Was ist, wenn meine Arbeitsmappe versteckte Blätter enthält?** +A: Versteckte Blätter werden wie jedes andere Blatt behandelt; Sie können sie über den Index ansprechen und speichern, müssen jedoch ggf. `EditableDocument.IsVisible = true` setzen, bevor Sie speichern, wenn Sie sie im Ausgabe‑Dokument sichtbar haben möchten. + +**Q: Kann ich eine Excel-Registerkarte direkt in PDF konvertieren?** +A: Ja, geben Sie `SaveFormat.Pdf` an, wenn Sie `Save` auf dem `EditableDocument` aufrufen. Die Bibliothek bewahrt Layout, Bilder und Diagramme während der Konvertierung. + +**Q: Ist es möglich, eine Arbeitsmappe in CSV‑Dateien anstatt XLSX aufzuteilen?** +A: Absolut. Verwenden Sie `SaveFormat.Csv` für jedes `EditableDocument`, um reine Text‑CSV‑Darstellungen jedes Blattes zu erzeugen. + +**Q: Unterstützt GroupDocs.Editor passwortgeschützte Excel‑Dateien?** +A: Ja. Geben Sie das Passwort über `LoadOptions.Password` an, wenn Sie die `Editor`‑Instanz erstellen. + +**Q: Wo finde ich weitere Beispiele zur Arbeit mit Tabellenkalkulationen?** +A: Die offizielle Dokumentation und Beispielprojekte auf der [download page](https://releases.groupdocs.com/editor/net/) enthalten weitere Anwendungsfälle. + +## Fazit +Wenn Sie diese Schritte befolgen, können Sie **jede Excel-Registerkarte** als eigenständiges Dokument speichern, Registerkarten in PDF konvertieren oder große Arbeitsmappen in handhabbare Teile aufteilen – alles mit der zuverlässigen, leistungsstarken GroupDocs.Editor für .NET‑Bibliothek. Diese Fähigkeit optimiert Reporting‑Pipelines, automatisiert die Datenerfassung und reduziert die manuelle Verarbeitung von Tabellenkalkulationen. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## Verwandte Tutorials + +- [Meisterhafte Extraktion von Tabellenblatt-Registerkarten in .NET mit GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Excel-Dateien mit GroupDocs.Editor für .NET passwortschützen \| Sichere Tabellenkalkulationsverwaltung](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Meisterhaftes Laden von Dokumenten in .NET mit GroupDocs.Editor: Ein umfassender Leitfaden](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/greek/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/greek/net/document-processing/work-multi-tab-spreadsheets/_index.md index f8d742fd..cc881f68 100644 --- a/content/greek/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/greek/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: Εργαστείτε με υπολογιστικά φύλλα πολλαπλών καρτελών -linktitle: Εργαστείτε με υπολογιστικά φύλλα πολλαπλών καρτελών +date: 2026-06-06 +description: Μάθετε πώς να **αποθηκεύσετε κάθε καρτέλα του Excel** χρησιμοποιώντας + το GroupDocs.Editor για .NET – βήμα‑βήμα οδηγός, αποσπάσματα κώδικα και βέλτιστες + πρακτικές για το διαχωρισμό αρχείων XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Εργασία με υπολογιστικά φύλλα πολλαπλών καρτελών +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Μάθετε πώς να εργάζεστε με υπολογιστικά φύλλα πολλών καρτελών στο .NET χρησιμοποιώντας το GroupDocs.Editor. Περιλαμβάνονται οδηγός βήμα προς βήμα, παραδείγματα κώδικα και βέλτιστες πρακτικές. -weight: 17 -url: /el/net/document-processing/work-multi-tab-spreadsheets/ +title: Πώς να αποθηκεύσετε κάθε καρτέλα του Excel με το GroupDocs.Editor .NET type: docs +url: /el/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Εργαστείτε με υπολογιστικά φύλλα πολλαπλών καρτελών + +# Εργασία με Πίνακες πολλαπλών καρτελών ## Εισαγωγή -Ο χειρισμός υπολογιστικών φύλλων πολλαπλών καρτελών μπορεί να είναι αρκετά δύσκολος, ειδικά όταν χρειάζεται να χειριστείτε ή να εξαγάγετε δεδομένα από διαφορετικά φύλλα μέσα στο ίδιο έγγραφο. Εάν εργάζεστε με .NET και αναζητάτε μια ισχυρή λύση, το GroupDocs.Editor για .NET είναι μια εξαιρετική επιλογή. Σε αυτό το σεμινάριο, θα σας καθοδηγήσουμε στη διαδικασία εργασίας με υπολογιστικά φύλλα πολλών καρτελών χρησιμοποιώντας το GroupDocs.Editor για .NET. Θα καλύψουμε τα πάντα, από τη ρύθμιση του περιβάλλοντος σας έως την αποθήκευση κάθε καρτέλας ως ξεχωριστό αρχείο. +Αν χρειάζεστε **να αποθηκεύσετε κάθε καρτέλα του Excel** ως ανεξάρτητο αρχείο, το GroupDocs.Editor για .NET το κάνει εύκολο. Είτε εξάγετε οικονομικές αναφορές, δημιουργείτε φύλλα εργασίας ανά τμήμα, είτε μετατρέπετε τις καρτέλες σε PDF, αυτό το tutorial σας καθοδηγεί σε όλη τη ροή εργασίας — από τη ρύθμιση του περιβάλλοντος μέχρι την απελευθέρωση των πόρων — ώστε να μπορείτε να αυτοματοποιήσετε τη διαχείριση πολλαπλών φύλλων με σιγουριά. + +## Γρήγορες Απαντήσεις +- **Μπορεί το GroupDocs.Editor να χωρίσει ένα XLSX σε ξεχωριστά αρχεία;** Ναι, μπορείτε να φορτώσετε το βιβλίο εργασίας και να εξάγετε κάθε φύλλο ξεχωριστά. +- **Σε ποιες μορφές μπορεί να αποθηκευτεί κάθε καρτέλα;** XLSX, CSV, PDF, HTML, και άλλα – υποστηρίζονται πάνω από 30 μορφές εξόδου. +- **Χρειάζομαι άδεια για αυτή τη λειτουργία;** Μια προσωρινή άδεια λειτουργεί για δοκιμές· απαιτείται πλήρης άδεια για παραγωγή. +- **Υποστηρίζεται το .NET Core;** Απολύτως – η βιβλιοθήκη λειτουργεί με .NET Framework 4.0+ και .NET Core/5/6+. +- **Πόσες καρτέλες μπορούν να επεξεργαστούν ταυτόχρονα;** Το GroupDocs.Editor μπορεί να διαχειριστεί βιβλία εργασίας με 500+ φύλλα χωρίς να φορτώνει ολόκληρο το αρχείο στη μνήμη. + +## Τι είναι το “save each excel tab”; +**“Save each Excel tab”** σημαίνει την εξαγωγή κάθε φύλλου εργασίας από ένα βιβλίο εργασίας πολλαπλών φύλλων και τη γραφή του καθενός σε ένα ανεξάρτητο έγγραφο (π.χ., ξεχωριστά αρχεία XLSX ή PDF). Αυτή η προσέγγιση απλοποιεί την επεξεργασία, την αναφορά και τη διανομή, παρέχοντάς σας ένα αρχείο ανά φύλλο, το οποίο μπορεί στη συνέχεια να μοιραστεί, να αρχειοθετηθεί ή να μετατραπεί περαιτέρω ανεξάρτητα. + +## Γιατί να χρησιμοποιήσετε το GroupDocs.Editor για αυτήν την εργασία; +Το GroupDocs.Editor υποστηρίζει **πάνω από 30 μορφές εισόδου και εξόδου** και μπορεί να επεξεργαστεί λογιστικά φύλλα με **έως 1.000 φύλλα** διατηρώντας τη χρήση μνήμης χαμηλή μέσω ροής δεδομένων αντί της φόρτωσης ολόκληρου του αρχείου. Το API διατηρεί επίσης τα στυλ των κελιών, τους τύπους και τις ενσωματωμένες εικόνες, εξασφαλίζοντας ότι κάθε εξαγόμενη καρτέλα φαίνεται ακριβώς όπως το αρχικό. + ## Προαπαιτούμενα -Πριν ξεκινήσετε το σεμινάριο, βεβαιωθείτε ότι έχετε τις ακόλουθες προϋποθέσεις: -1. Visual Studio: Βεβαιωθείτε ότι έχετε εγκαταστήσει το Visual Studio στον υπολογιστή σας. -2. .NET Framework: Το GroupDocs.Editor για .NET υποστηρίζει .NET Framework 4.0 ή νεότερη έκδοση. -3. GroupDocs.Editor για .NET: Πραγματοποιήστε λήψη και εγκατάσταση της βιβλιοθήκης GroupDocs.Editor για .NET. Μπορείτε να το πάρετε από το[σελίδα λήψης](https://releases.groupdocs.com/editor/net/). -4. Άδεια χρήσης: Ενώ μπορείτε να χρησιμοποιήσετε α[προσωρινή άδεια](https://purchase.groupdocs.com/temporary-license/) Για να δοκιμάσετε τη βιβλιοθήκη, συνιστάται να αγοράσετε μια πλήρη άδεια χρήσης για παραγωγή. -## Εισαγωγή χώρων ονομάτων -Πριν ξεκινήσουμε την κωδικοποίηση, πρέπει να εισαγάγετε τους απαραίτητους χώρους ονομάτων. Προσθέστε τα ακόλουθα χρησιμοποιώντας οδηγίες στην κορυφή του αρχείου σας .cs: +1. **Visual Studio** – οποιαδήποτε πρόσφατη έκδοση (Community, Professional ή Enterprise). +2. **.NET Framework 4.0+** – ή .NET Core/5/6 αν προτιμάτε το δια‑πλατφορμικό runtime. +3. **GroupDocs.Editor for .NET** – κατεβάστε το από τη [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – μια [temporary license](https://purchase.groupdocs.com/temporary-license/) είναι εντάξει για δοκιμές· αγοράστε πλήρη άδεια για παραγωγική χρήση. +5. **Free trial** – μπορείτε επίσης να δοκιμάσετε τη βιβλιοθήκη μέσω της σελίδας [free trial](https://releases.groupdocs.com/). +6. **Support** – εάν αντιμετωπίσετε προβλήματα, επισκεφθείτε το [support forum](https://forum.groupdocs.com/c/editor/20) ή σκεφτείτε τη [purchase page](https://purchase.groupdocs.com/buy) για πλήρη άδεια. + +## Εισαγωγή Namespaces +Πριν ξεκινήσουμε τον κώδικα, πρέπει να εισάγετε τα απαραίτητα namespaces. Προσθέστε τις παρακάτω οδηγίες using στην αρχή του αρχείου `.cs` σας: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Λάβετε μια διαδρομή προς το αρχείο εισόδου -Αρχικά, πρέπει να καθορίσετε τη διαδρομή προς το αρχείο υπολογιστικού φύλλου εισόδου. Αυτό το αρχείο πρέπει να είναι XLSX (OOXML) με πολλές καρτέλες. + +## Πώς να αποθηκεύσετε κάθε καρτέλα Excel ως ξεχωριστό αρχείο; +Φορτώστε το βιβλίο εργασίας, δημιουργήστε ένα `EditableDocument` για κάθε φύλλο και καλέστε `Save` με τη ζητούμενη μορφή. Αυτή η διαδικασία απομονώνει κάθε καρτέλα, σας επιτρέπει να επιλέξετε διαφορετική διαδρομή εξόδου και απελευθερώνει τους πόρους αυτόματα. Παρακάτω είναι η βήμα‑βήμα ροή εργασίας που θα ακολουθήσετε, με εξηγήσεις για κάθε κλήση API και συμβουλές βέλτιστων πρακτικών για αποφυγή κοινών παγίδων. + +### Βήμα 1: Λάβετε Διαδρομή στο Αρχείο Εισόδου +Πρώτα, καθορίστε τη πλήρη διαδρομή προς το αρχικό XLSX που περιέχει πολλαπλές καρτέλες. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Τοποθετήστε το υπολογιστικό φύλλο στην παρουσία του επεξεργαστή - Στη συνέχεια, θα φορτώσετε το υπολογιστικό φύλλο σε ένα`Editor` παράδειγμα. Αυτό γίνεται χρησιμοποιώντας μια ροή αρχείων και καθορίζοντας τις κατάλληλες επιλογές φόρτωσης για ένα υπολογιστικό φύλλο. + +### Βήμα 2: Φορτώστε το Λογιστικό Φύλλο στην Περίπτωση του Editor +Η κλάση `Editor` είναι το σημείο εισόδου για όλες τις λειτουργίες εγγράφων στο GroupDocs.Editor. Διαβάζει το ρεύμα αρχείου και προετοιμάζει το έγγραφο για επεξεργασία ή εξαγωγή. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Τα περαιτέρω βήματα θα πάνε εδώ + // Further steps will go here } } ``` -## 3. Δημιουργήστε ένα EditableDocument από την Πρώτη καρτέλα - Για να επεξεργαστείτε ή να χειριστείτε μια συγκεκριμένη καρτέλα, πρέπει να δημιουργήσετε μια`EditableDocument` παράδειγμα για αυτήν την καρτέλα. Η καρτέλα καθορίζεται χρησιμοποιώντας ένα ευρετήριο που βασίζεται στο 0. + +### Βήμα 3: Δημιουργήστε ένα EditableDocument από την Πρώτη Καρτέλα +`EditableDocument` αντιπροσωπεύει ένα μοναδικό, επεξεργάσιμο φύλλο μέσα στο βιβλίο εργασίας. Ο κατασκευαστής λαμβάνει την περίπτωση `Editor` και έναν δείκτη φύλλου που αρχίζει από το μηδέν. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Πρώτη καρτέλα +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Δημιουργήστε ένα EditableDocument από τη δεύτερη καρτέλα - Ομοίως, δημιουργήστε ένα`EditableDocument` για τη δεύτερη καρτέλα. + +### Βήμα 4: Δημιουργήστε ένα EditableDocument από τη Δεύτερη Καρτέλα +Μπορείτε να επαναλάβετε το ίδιο μοτίβο για οποιοδήποτε επιπλέον φύλλο αλλάζοντας την τιμή του δείκτη. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Δεύτερη καρτέλα +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Αποθηκεύστε την Πρώτη καρτέλα σε ξεχωριστό έγγραφο -Τώρα, αποθηκεύστε την πρώτη καρτέλα ως ξεχωριστό έγγραφο. Καθορίστε τη μορφή αποθήκευσης και τη διαδρομή εξόδου. + +### Βήμα 5: Αποθηκεύστε την Πρώτη Καρτέλα σε Ξεχωριστό Έγγραφο +`Save` γράφει το επεξεργασμένο έγγραφο σε αρχείο στην καθορισμένη μορφή. Καλέστε το στην περίπτωση `EditableDocument`, παρέχοντας τη διαδρομή εξόδου και τη μορφή (π.χ., `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Αποθηκεύστε τη δεύτερη καρτέλα σε ένα ξεχωριστό έγγραφο -Επαναλάβετε τη διαδικασία για τη δεύτερη καρτέλα, αλλά αυτή τη φορά αποθηκεύστε την σε διαφορετική μορφή. + +### Βήμα 6: Αποθηκεύστε τη Δεύτερη Καρτέλα σε Ξεχωριστό Έγγραφο +Η ίδια κλήση `Save` λειτουργεί για το δεύτερο φύλλο, και μπορείτε να επιλέξετε διαφορετική μορφή όπως PDF αν χρειάζεται. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Απορρίψτε τις περιπτώσεις EditableDocument - Τέλος, βεβαιωθείτε ότι έχετε απορρίψει σωστά`EditableDocument` περιπτώσεις για την απελευθέρωση πόρων. + +### Βήμα 7: Αποδεσμεύστε τις Περιπτώσεις EditableDocument +`Dispose` απελευθερώνει μη διαχειριζόμενους πόρους που κρατά το έγγραφο, όπως χειριστές αρχείων, εξασφαλίζοντας ότι δεν υπάρχουν διαρροές σε υπηρεσίες μεγάλης διάρκειας. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## συμπέρασμα -Ακολουθώντας αυτά τα βήματα, μπορείτε εύκολα να εργαστείτε με υπολογιστικά φύλλα πολλών καρτελών στο .NET χρησιμοποιώντας το GroupDocs.Editor. Αυτή η ισχυρή βιβλιοθήκη απλοποιεί τη διαδικασία επεξεργασίας και αποθήκευσης διαφορετικών φύλλων σε ένα υπολογιστικό φύλλο, καθιστώντας τις εργασίες ανάπτυξης πιο διαχειρίσιμες. Είτε έχετε να κάνετε με πολύπλοκο χειρισμό δεδομένων είτε με απλές επεξεργασίες, το GroupDocs.Editor για .NET παρέχει τα εργαλεία που χρειάζεστε για να κάνετε τη δουλειά αποτελεσματικά. -## Συχνές ερωτήσεις -### Τι είναι το GroupDocs.Editor για .NET; -Το GroupDocs.Editor για .NET είναι ένα ισχυρό API επεξεργασίας εγγράφων που επιτρέπει στους προγραμματιστές να φορτώνουν, να επεξεργάζονται και να αποθηκεύουν έγγραφα διαφόρων μορφών σε εφαρμογές .NET. -### Μπορώ να δοκιμάσω το GroupDocs.Editor για .NET πριν το αγοράσω; - Ναι, μπορείτε να χρησιμοποιήσετε ένα[δωρεάν δοκιμή](https://releases.groupdocs.com/) ή ζητήστε α[προσωρινή άδεια](https://purchase.groupdocs.com/temporary-license/) για την αξιολόγηση του προϊόντος. -### Ποιες μορφές αρχείων υποστηρίζονται από το GroupDocs.Editor για .NET; -Το GroupDocs.Editor υποστηρίζει ένα ευρύ φάσμα μορφών, συμπεριλαμβανομένων των DOCX, XLSX, PPTX, PDF και πολλών άλλων. -### Πώς μπορώ να λάβω υποστήριξη για το GroupDocs.Editor για .NET; - Μπορείτε να λάβετε υποστήριξη μεταβαίνοντας στο[φόρουμ υποστήριξης](https://forum.groupdocs.com/c/editor/20). -### Πού μπορώ να αγοράσω μια πλήρη άδεια χρήσης για το GroupDocs.Editor για .NET; - Μπορείτε να αγοράσετε μια πλήρη άδεια χρήσης από το[σελίδα αγοράς](https://purchase.groupdocs.com/buy). \ No newline at end of file +## Συνηθισμένα Προβλήματα και Λύσεις +- **Σφάλματα “File is locked”** – Βεβαιωθείτε ότι καλείτε `Dispose()` σε κάθε `EditableDocument` και στην περίπτωση `Editor`, ή τυλίξτε τα σε δηλώσεις `using`. +- **Απουσία στυλ μετά την εξαγωγή** – Επαληθεύστε ότι αποθηκεύετε σε μορφή που υποστηρίζει στυλ (π.χ., XLSX ή PDF). Το CSV θα χάσει τη μορφοποίηση κατά σχεδίαση. +- **Μεγάλα βιβλία εργασίας προκαλούν αργή απόδοση** – Χρησιμοποιήστε τις επιλογές φόρτωσης με ροή (`LoadOptions.Streaming = true`) για να διατηρήσετε τη χρήση μνήμης χαμηλή. + +## Συχνές Ερωτήσεις + +**Q: Τι γίνεται αν το βιβλίο εργασίας μου περιέχει κρυφά φύλλα;** +A: Τα κρυφά φύλλα αντιμετωπίζονται όπως οποιοδήποτε άλλο φύλλο· μπορείτε να τα προσπελάσετε με δείκτη και να τα αποθηκεύσετε, αλλά ίσως χρειαστεί να ορίσετε `EditableDocument.IsVisible = true` πριν την αποθήκευση αν θέλετε να είναι ορατά στην έξοδο. + +**Q: Μπορώ να μετατρέψω μια καρτέλα Excel απευθείας σε PDF;** +A: Ναι, καθορίστε `SaveFormat.Pdf` όταν καλείτε `Save` στο `EditableDocument`. Η βιβλιοθήκη διατηρεί τη διάταξη, τις εικόνες και τα διαγράμματα κατά τη μετατροπή. + +**Q: Είναι δυνατόν να χωρίσω ένα βιβλίο εργασίας σε αρχεία CSV αντί για XLSX;** +A: Απόλυτα. Χρησιμοποιήστε `SaveFormat.Csv` για κάθε `EditableDocument` ώστε να δημιουργήσετε απλό‑κείμενο CSV αναπαραστάσεις κάθε φύλλου. + +**Q: Υποστηρίζει το GroupDocs.Editor αρχεία Excel με προστασία κωδικού;** +A: Ναι. Παρέχετε τον κωδικό μέσω `LoadOptions.Password` όταν δημιουργείτε την περίπτωση `Editor`. + +**Q: Πού μπορώ να βρω περισσότερα παραδείγματα εργασίας με λογιστικά φύλλα;** +A: Η επίσημη τεκμηρίωση και τα δείγματα έργων στη [download page](https://releases.groupdocs.com/editor/net/) περιέχουν επιπλέον περιπτώσεις χρήσης. + +## Συμπέρασμα +Ακολουθώντας αυτά τα βήματα, μπορείτε να **αποθηκεύσετε κάθε καρτέλα Excel** ως ανεξάρτητο έγγραφο, να μετατρέψετε τις καρτέλες σε PDF ή να χωρίσετε μεγάλα βιβλία εργασίας σε διαχειρίσιμα κομμάτια — όλα με τη αξιόπιστη, υψηλής απόδοσης βιβλιοθήκη GroupDocs.Editor για .NET. Αυτή η δυνατότητα βελτιστοποιεί τις γραμμές αναφοράς, αυτοματοποιεί την εξαγωγή δεδομένων και μειώνει την χειροκίνητη διαχείριση λογιστικών φύλλων. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## Σχετικά Μαθήματα + +- [Αποκτήστε τον έλεγχο εξαγωγής καρτελών λογιστικού φύλλου σε .NET με το GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Προστασία Excel με κωδικό χρησιμοποιώντας το GroupDocs.Editor για .NET | Ασφαλής διαχείριση λογιστικών φύλλων](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Απόκτηση δεξιοτήτων φόρτωσης εγγράφων σε .NET με το GroupDocs.Editor: Ένας ολοκληρωμένος οδηγός](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hindi/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/hindi/net/document-processing/work-multi-tab-spreadsheets/_index.md index f6d2c763..f9e68b6b 100644 --- a/content/hindi/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/hindi/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,208 @@ --- -title: मल्टी-टैब स्प्रेडशीट के साथ कार्य करें -linktitle: मल्टी-टैब स्प्रेडशीट के साथ कार्य करें -second_title: GroupDocs.Editor .NET एपीआई -description: GroupDocs.Editor का उपयोग करके .NET में मल्टी-टैब स्प्रेडशीट के साथ काम करना सीखें। चरण-दर-चरण मार्गदर्शिका, कोड उदाहरण और सर्वोत्तम अभ्यास शामिल हैं। -weight: 17 -url: /hi/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET का उपयोग करके **प्रत्येक Excel टैब को सहेजना** + सीखें – चरण‑दर‑चरण गाइड, कोड स्निपेट्स, और XLSX फ़ाइलों को विभाजित करने के लिए सर्वोत्तम + प्रथाएँ। +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Multi-Tab Spreadsheets के साथ काम करें +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: GroupDocs.Editor .NET के साथ प्रत्येक Excel टैब को कैसे सहेजें type: docs +url: /hi/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# मल्टी-टैब स्प्रेडशीट के साथ कार्य करें + +# बहु‑टैब स्प्रेडशीट्स के साथ काम करें ## परिचय -मल्टी-टैब स्प्रेडशीट को संभालना काफी मुश्किल काम हो सकता है, खासकर तब जब आपको एक ही दस्तावेज़ में अलग-अलग शीट से डेटा को मैनिपुलेट या एक्सट्रेक्ट करना हो। अगर आप .NET के साथ काम कर रहे हैं और एक मज़बूत समाधान की तलाश कर रहे हैं, तो GroupDocs.Editor for .NET एक बेहतरीन विकल्प है। इस ट्यूटोरियल में, हम आपको GroupDocs.Editor for .NET का उपयोग करके मल्टी-टैब स्प्रेडशीट के साथ काम करने की प्रक्रिया से रूबरू कराएँगे। हम आपके परिवेश को सेट करने से लेकर प्रत्येक टैब को एक अलग फ़ाइल के रूप में सहेजने तक सब कुछ कवर करेंगे। -## आवश्यक शर्तें -ट्यूटोरियल में शामिल होने से पहले, सुनिश्चित करें कि आपके पास निम्नलिखित पूर्वापेक्षाएँ मौजूद हैं: -1. विज़ुअल स्टूडियो: सुनिश्चित करें कि आपके मशीन पर विज़ुअल स्टूडियो स्थापित है। -2. .NET फ्रेमवर्क: .NET के लिए GroupDocs.Editor .NET फ्रेमवर्क 4.0 या उच्चतर का समर्थन करता है। -3. .NET के लिए GroupDocs.Editor: .NET लाइब्रेरी के लिए GroupDocs.Editor डाउनलोड और स्थापित करें। आप इसे यहाँ से प्राप्त कर सकते हैं[डाउनलोड पृष्ठ](https://releases.groupdocs.com/editor/net/). -4. लाइसेंस: जबकि आप एक का उपयोग कर सकते हैं[अस्थायी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) लाइब्रेरी को आज़माने के लिए, उत्पादन उपयोग के लिए पूर्ण लाइसेंस खरीदने की अनुशंसा की जाती है। -## नामस्थान आयात करें -कोडिंग शुरू करने से पहले, आपको आवश्यक नेमस्पेस आयात करने की आवश्यकता है। अपनी .cs फ़ाइल के शीर्ष पर निम्नलिखित using निर्देश जोड़ें: +यदि आपको **प्रत्येक Excel टैब** को स्वतंत्र फ़ाइल के रूप में सहेजने की आवश्यकता है, तो GroupDocs.Editor for .NET इसे आसान बनाता है। चाहे आप वित्तीय रिपोर्ट निकाल रहे हों, विभाग‑वार वर्कशीट बना रहे हों, या टैब को PDF में बदल रहे हों, यह ट्यूटोरियल आपको पूरे वर्कफ़्लो के माध्यम से ले जाता है—पर्यावरण सेटअप से लेकर संसाधनों को डिस्पोज़ करने तक—ताकि आप बहु‑शीट हैंडलिंग को आत्मविश्वास के साथ स्वचालित कर सकें। + +## त्वरित उत्तर +- **क्या GroupDocs.Editor एक XLSX को अलग‑अलग फ़ाइलों में विभाजित कर सकता है?** हाँ, आप वर्कबुक को लोड कर सकते हैं और प्रत्येक शीट को अलग‑अलग निर्यात कर सकते हैं। +- **प्रत्येक टैब को किन फ़ॉर्मैट में सहेजा जा सकता है?** XLSX, CSV, PDF, HTML, और अधिक – 30 से अधिक आउटपुट फ़ॉर्मैट समर्थित हैं। +- **क्या इस फीचर के लिए लाइसेंस चाहिए?** परीक्षण के लिए एक अस्थायी लाइसेंस काम करता है; उत्पादन के लिए पूर्ण लाइसेंस आवश्यक है। +- **क्या .NET Core समर्थित है?** बिल्कुल—यह लाइब्रेरी .NET Framework 4.0+ और .NET Core/5/6+ के साथ काम करती है। +- **एक साथ कितने टैब प्रोसेस किए जा सकते हैं?** GroupDocs.Editor 500+ शीट वाले वर्कबुक को पूरी फ़ाइल को मेमोरी में लोड किए बिना संभाल सकता है। + +## “प्रत्येक Excel टैब सहेजें” क्या है? +**“Save each Excel tab”** का अर्थ है एक बहु‑शीट वर्कबुक से प्रत्येक वर्कशीट को निकालना और प्रत्येक को अपनी स्वतंत्र दस्तावेज़ (जैसे, अलग‑अलग XLSX या PDF फ़ाइलें) में लिखना। यह तरीका डाउनस्ट्रीम प्रोसेसिंग, रिपोर्टिंग और वितरण को सरल बनाता है, क्योंकि आपको प्रत्येक शीट के लिए एक फ़ाइल मिलती है, जिसे फिर स्वतंत्र रूप से साझा, संग्रहित या आगे परिवर्तित किया जा सकता है। + +## इस कार्य के लिए GroupDocs.Editor क्यों उपयोग करें? +GroupDocs.Editor **30+ इनपुट और आउटपुट फ़ॉर्मैट** का समर्थन करता है और **1,000 शीट** तक की स्प्रेडशीट्स को प्रोसेस कर सकता है, जबकि पूरे फ़ाइल को लोड करने के बजाय डेटा को स्ट्रीम करके मेमोरी उपयोग कम रखता है। API सेल स्टाइल, फ़ॉर्मूले और एम्बेडेड इमेजेज़ को भी संरक्षित रखती है, जिससे प्रत्येक निर्यातित टैब मूल के समान दिखता है। + +## पूर्वापेक्षाएँ +1. **Visual Studio** – कोई भी नवीनतम संस्करण (Community, Professional, या Enterprise)। +2. **.NET Framework 4.0+** – या .NET Core/5/6 यदि आप क्रॉस‑प्लेटफ़ॉर्म रनटाइम पसंद करते हैं। +3. **GroupDocs.Editor for .NET** – इसे [download page](https://releases.groupdocs.com/editor/net/) से डाउनलोड करें। +4. **License** – परीक्षण के लिए एक [temporary license](https://purchase.groupdocs.com/temporary-license/) पर्याप्त है; उत्पादन उपयोग के लिए पूर्ण लाइसेंस खरीदें। +5. **Free trial** – आप लाइब्रेरी को [free trial](https://releases.groupdocs.com/) पेज के माध्यम से भी आज़मा सकते हैं। +6. **Support** – यदि आपको समस्याएँ आती हैं, तो [support forum](https://forum.groupdocs.com/c/editor/20) पर जाएँ या पूर्ण लाइसेंस के लिए [purchase page](https://purchase.groupdocs.com/buy) देखें। + +## नेमस्पेस आयात करें +कोडिंग शुरू करने से पहले, आपको आवश्यक नेमस्पेस आयात करने होंगे। अपने `.cs` फ़ाइल के शीर्ष पर निम्नलिखित using निर्देश जोड़ें: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. इनपुट फ़ाइल का पथ प्राप्त करें -सबसे पहले, आपको अपनी इनपुट स्प्रेडशीट फ़ाइल का पथ निर्दिष्ट करना होगा। यह फ़ाइल XLSX (OOXML) होनी चाहिए जिसमें कई टैब हों। + +## प्रत्येक Excel टैब को अलग फ़ाइल के रूप में कैसे सहेजें? +वर्कबुक को लोड करें, प्रत्येक शीट के लिए एक `EditableDocument` बनाएं, और इच्छित फ़ॉर्मैट के साथ `Save` कॉल करें। यह प्रक्रिया प्रत्येक टैब को अलग करती है, आपको अलग आउटपुट पाथ चुनने देती है, और संसाधनों को स्वचालित रूप से रिलीज़ करती है। नीचे वह चरण‑दर‑चरण वर्कफ़्लो दिया गया है जिसे आप अनुसरण करेंगे, प्रत्येक API कॉल की व्याख्या और सामान्य समस्याओं से बचने के लिए सर्वोत्तम अभ्यास टिप्स के साथ। + +### चरण 1: इनपुट फ़ाइल का पाथ प्राप्त करें +सबसे पहले, कई टैब वाली स्रोत XLSX फ़ाइल का पूर्ण पाथ निर्दिष्ट करें। + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. स्प्रेडशीट को एडिटर इंस्टेंस में लोड करें - इसके बाद, आप स्प्रेडशीट को एक में लोड करेंगे`Editor` यह फ़ाइल स्ट्रीम का उपयोग करके और स्प्रेडशीट के लिए उपयुक्त लोड विकल्प निर्दिष्ट करके किया जाता है। + +### चरण 2: स्प्रेडशीट को Editor इंस्टेंस में लोड करें +`Editor` क्लास GroupDocs.Editor में सभी दस्तावेज़ ऑपरेशन्स का प्रवेश बिंदु है। यह फ़ाइल स्ट्रीम को पढ़ता है और दस्तावेज़ को संपादन या निष्कर्षण के लिए तैयार करता है। + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // आगे की कार्यवाही यहां होगी + // Further steps will go here } } ``` -## 3. पहले टैब से संपादन योग्य दस्तावेज़ बनाएँ - किसी विशिष्ट टैब को संपादित या उसमें परिवर्तन करने के लिए, आपको एक बनाना होगा`EditableDocument` उस टैब के लिए उदाहरण। टैब को 0-आधारित इंडेक्स का उपयोग करके निर्दिष्ट किया जाता है। + +### चरण 3: पहले टैब से EditableDocument बनाएं +`EditableDocument` वर्कबुक के भीतर एकल, संपादन योग्य शीट को दर्शाता है। कंस्ट्रक्टर `Editor` इंस्टेंस और शून्य‑आधारित शीट इंडेक्स लेता है। + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // पहला टैब +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. दूसरे टैब से संपादन योग्य दस्तावेज़ बनाएँ - इसी तरह, एक बनाएं`EditableDocument` दूसरे टैब के लिए. + +### चरण 4: दूसरे टैब से EditableDocument बनाएं +आप इंडेक्स मान बदलकर किसी भी अतिरिक्त शीट के लिए यही पैटर्न दोहरा सकते हैं। + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // दूसरा टैब +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. पहले टैब को एक अलग दस्तावेज़ में सहेजें -अब, पहले टैब को एक अलग दस्तावेज़ के रूप में सहेजें। सेव फ़ॉर्मेट और आउटपुट पथ निर्दिष्ट करें। + +### चरण 5: पहले टैब को अलग दस्तावेज़ में सहेजें +`Save` संपादित दस्तावेज़ को निर्दिष्ट फ़ॉर्मैट में फ़ाइल में लिखता है। इसे `EditableDocument` इंस्टेंस पर कॉल करें, आउटपुट पाथ और फ़ॉर्मैट प्रदान करते हुए (जैसे, `SaveFormat.Xlsx`)। + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. दूसरे टैब को एक अलग दस्तावेज़ में सहेजें -दूसरे टैब के लिए भी यही प्रक्रिया दोहराएं, लेकिन इस बार इसे अलग प्रारूप में सेव करें। + +### चरण 6: दूसरे टैब को अलग दस्तावेज़ में सहेजें +इसी `Save` कॉल को दूसरे शीट के लिए भी उपयोग किया जा सकता है, और आवश्यकता अनुसार आप PDF जैसे अलग फ़ॉर्मैट चुन सकते हैं। + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. EditableDocument इंस्टैंस का निपटान करें - अंत में, सुनिश्चित करें कि आप इसका उचित तरीके से निपटान करें`EditableDocument` संसाधनों को मुक्त करने के लिए उदाहरण। + +### चरण 7: EditableDocument इंस्टेंस को डिस्पोज़ करें +`Dispose` दस्तावेज़ द्वारा रखे गए अनमैनेज्ड संसाधनों को रिलीज़ करता है, जैसे फ़ाइल हैंडल, जिससे दीर्घकालिक सेवाओं में कोई लीक न हो। + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## निष्कर्ष -इन चरणों का पालन करके, आप GroupDocs.Editor का उपयोग करके .NET में मल्टी-टैब स्प्रेडशीट के साथ आसानी से काम कर सकते हैं। यह शक्तिशाली लाइब्रेरी स्प्रेडशीट के भीतर अलग-अलग शीट को संपादित करने और सहेजने की प्रक्रिया को सरल बनाती है, जिससे आपके विकास कार्य अधिक प्रबंधनीय हो जाते हैं। चाहे आप जटिल डेटा हेरफेर या सरल संपादन से निपट रहे हों, .NET के लिए GroupDocs.Editor आपको काम को कुशलतापूर्वक पूरा करने के लिए आवश्यक उपकरण प्रदान करता है। +## सामान्य समस्याएँ और समाधान +- **“File is locked” त्रुटियाँ** – सुनिश्चित करें कि आप प्रत्येक `EditableDocument` और `Editor` इंस्टेंस पर `Dispose()` कॉल करें, या उन्हें `using` स्टेटमेंट में रैप करें। +- **निर्यात के बाद स्टाइल गायब** – पुष्टि करें कि आप ऐसे फ़ॉर्मैट में सहेज रहे हैं जो स्टाइलिंग का समर्थन करता है (जैसे, XLSX या PDF)। CSV डिजाइन के अनुसार फ़ॉर्मेटिंग खो देगा। +- **बड़ी वर्कबुक्स से प्रदर्शन धीमा** – मेमोरी उपयोग कम रखने के लिए स्ट्रीमिंग लोड विकल्प (`LoadOptions.Streaming = true`) का उपयोग करें। + ## अक्सर पूछे जाने वाले प्रश्न -### .NET के लिए GroupDocs.Editor क्या है? -GroupDocs.Editor for .NET एक शक्तिशाली दस्तावेज़ संपादन API है जो डेवलपर्स को .NET अनुप्रयोगों के भीतर विभिन्न प्रारूपों के दस्तावेज़ों को लोड करने, संपादित करने और सहेजने की अनुमति देता है। -### क्या मैं खरीदने से पहले .NET के लिए GroupDocs.Editor आज़मा सकता हूं? - हां, आप इसका उपयोग कर सकते हैं[मुफ्त परीक्षण](https://releases.groupdocs.com/) या अनुरोध करें[अस्थायी लाइसेंस](https://purchase.groupdocs.com/temporary-license/) उत्पाद का मूल्यांकन करने के लिए. -### .NET के लिए GroupDocs.Editor द्वारा कौन से फ़ाइल स्वरूप समर्थित हैं? -GroupDocs.Editor कई प्रकार के प्रारूपों का समर्थन करता है, जिसमें DOCX, XLSX, PPTX, PDF और कई अन्य शामिल हैं। -### मैं .NET के लिए GroupDocs.Editor का समर्थन कैसे प्राप्त करूं? - आप यहां जाकर सहायता प्राप्त कर सकते हैं[सहयता मंच](https://forum.groupdocs.com/c/editor/20). -### मैं .NET के लिए GroupDocs.Editor का पूर्ण लाइसेंस कहां से खरीद सकता हूं? - आप यहां से पूर्ण लाइसेंस खरीद सकते हैं[खरीद पृष्ठ](https://purchase.groupdocs.com/buy). \ No newline at end of file +**Q: यदि मेरी वर्कबुक में छिपी शीट्स हैं तो?** +A: छिपी शीट्स को अन्य शीट्स की तरह ही माना जाता है; आप उन्हें इंडेक्स द्वारा एक्सेस कर सकते हैं और सहेज सकते हैं, लेकिन यदि आप आउटपुट में उन्हें दिखाना चाहते हैं तो सहेजने से पहले `EditableDocument.IsVisible = true` सेट करना पड़ सकता है। + +**Q: क्या मैं Excel टैब को सीधे PDF में बदल सकता हूँ?** +A: हाँ, `EditableDocument` पर `Save` कॉल करते समय `SaveFormat.Pdf` निर्दिष्ट करें। लाइब्रेरी रूपांतरण के दौरान लेआउट, इमेजेज़ और चार्ट्स को संरक्षित रखती है। + +**Q: क्या वर्कबुक को XLSX के बजाय CSV फ़ाइलों में विभाजित किया जा सकता है?** +A: बिल्कुल। प्रत्येक `EditableDocument` के लिए `SaveFormat.Csv` उपयोग करें ताकि प्रत्येक शीट का साधारण‑टेक्स्ट CSV प्रतिनिधित्व बनाया जा सके। + +**Q: क्या GroupDocs.Editor पासवर्ड‑सुरक्षित Excel फ़ाइलों का समर्थन करता है?** +A: हाँ। `Editor` इंस्टेंस बनाते समय `LoadOptions.Password` के माध्यम से पासवर्ड प्रदान करें। + +**Q: स्प्रेडशीट्स के साथ काम करने के और उदाहरण कहाँ मिल सकते हैं?** +A: आधिकारिक दस्तावेज़ीकरण और [download page](https://releases.groupdocs.com/editor/net/) पर उपलब्ध सैंपल प्रोजेक्ट्स में अतिरिक्त उपयोग‑केस मौजूद हैं। + +## निष्कर्ष +इन चरणों का पालन करके, आप **प्रत्येक Excel टैब** को स्वतंत्र दस्तावेज़ के रूप में सहेज सकते हैं, टैब को PDF में बदल सकते हैं, या बड़ी वर्कबुक्स को प्रबंधनीय हिस्सों में विभाजित कर सकते हैं—सभी विश्वसनीय, उच्च‑प्रदर्शन GroupDocs.Editor for .NET लाइब्रेरी के साथ। यह क्षमता रिपोर्टिंग पाइपलाइन को सरल बनाती है, डेटा निष्कर्षण को स्वचालित करती है, और मैन्युअल स्प्रेडशीट हैंडलिंग को कम करती है। + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +## संबंधित ट्यूटोरियल + +- [GroupDocs.Editor के साथ .NET में स्प्रेडशीट टैब निष्कर्षण में महारत](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [GroupDocs.Editor for .NET का उपयोग करके Excel फ़ाइलों को पासवर्ड‑सुरक्षित बनाना | सुरक्षित स्प्रेडशीट प्रबंधन](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [GroupDocs.Editor के साथ .NET में दस्तावेज़ लोडिंग में महारत: एक व्यापक गाइड](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hongkong/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/hongkong/net/document-processing/work-multi-tab-spreadsheets/_index.md index 60e30040..1c8cf10a 100644 --- a/content/hongkong/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/hongkong/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,212 @@ --- -title: 使用多選項卡電子表格 -linktitle: 使用多選項卡電子表格 +date: 2026-06-06 +description: 了解如何使用 GroupDocs.Editor for .NET **保存每個 Excel 工作表分頁**——一步一步的指南、程式碼範例,以及分割 + XLSX 檔案的最佳實踐。 +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: 處理多分頁試算表 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: 了解如何使用 GroupDocs.Editor 在 .NET 中處理多選項卡電子表格。包含逐步指南、程式碼範例和最佳實務。 -weight: 17 -url: /zh-hant/net/document-processing/work-multi-tab-spreadsheets/ +title: 如何使用 GroupDocs.Editor .NET 保存每個 Excel 工作表分頁 type: docs +url: /zh-hant/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# 使用多選項卡電子表格 -## 介紹 -處理多選項卡電子表格可能是一項艱鉅的任務,尤其是當您需要從同一文件中的不同工作表操作或提取資料時。如果您正在使用 .NET 並尋找強大的解決方案,那麼適用於 .NET 的 GroupDocs.Editor 是一個絕佳的選擇。在本教程中,我們將引導您完成使用 GroupDocs.Editor for .NET 處理多選項卡電子表格的過程。我們將涵蓋從設定環境到將每個選項卡保存為單獨文件的所有內容。 +# 使用多分頁試算表 + +## 簡介 +如果您需要將 **每個 Excel 分頁** 保存為獨立檔案,GroupDocs.Editor for .NET 可讓此過程輕鬆無痛。無論是提取財務報表、產生部門工作表,或將分頁轉換為 PDF,本教學將帶您完整走過工作流程——從環境設定到釋放資源——讓您能自信地自動化多分頁處理。 + +## 快速解答 +- **GroupDocs.Editor 能將 XLSX 拆分為獨立檔案嗎?** 可以,您可以載入活頁簿並將每個工作表分別匯出。 +- **每個分頁可以保存為哪些格式?** 支援 XLSX、CSV、PDF、HTML 等超過 30 種輸出格式。 +- **此功能是否需要授權?** 測試時可使用臨時授權;正式環境需購買完整授權。 +- **支援 .NET Core 嗎?** 當然支援——此函式庫可在 .NET Framework 4.0 以上以及 .NET Core/5/6+ 上運行。 +- **一次可處理多少個分頁?** GroupDocs.Editor 能在不將整個檔案載入記憶體的情況下處理超過 500 張工作表的活頁簿。 + +## 什麼是「保存每個 Excel 分頁」? +**「保存每個 Excel 分頁」** 指的是從多分頁活頁簿中提取每個工作表,並將其寫入各自獨立的文件(例如分別的 XLSX 或 PDF 檔)。此做法可簡化後續的處理、報告與分發,讓您每張工作表都有一個檔案,可獨立分享、歸檔或進一步轉換。 + +## 為什麼要使用 GroupDocs.Editor 完成此任務? +GroupDocs.Editor 支援 **30 多種輸入與輸出格式**,且可處理最多 **1,000 張工作表** 的試算表,透過串流資料而非一次載入整個檔案,保持低記憶體使用量。API 亦會保留儲存格樣式、公式與嵌入圖片,確保每個匯出的分頁與原始檔案外觀完全相同。 + ## 先決條件 -在深入學習本教程之前,請確保您具備以下先決條件: -1. Visual Studio:確保您的電腦上安裝了 Visual Studio。 -2. .NET Framework:.NET 的 GroupDocs.Editor 支援 .NET Framework 4.0 或更高版本。 -3. GroupDocs.Editor for .NET:下載並安裝 GroupDocs.Editor for .NET 程式庫。您可以從[下載頁面](https://releases.groupdocs.com/editor/net/). -4. 許可證:雖然您可以使用[臨時執照](https://purchase.groupdocs.com/temporary-license/)要試用該庫,建議購買用於生產用途的完整許可證。 -## 導入命名空間 -在開始編碼之前,您需要匯入必要的名稱空間。將以下 using 指令加入 .cs 檔案的頂部: +在深入之前,請確認您已具備以下項目: + +1. **Visual Studio** – 任一近期版本(Community、Professional 或 Enterprise)。 +2. **.NET Framework 4.0+** – 或若偏好跨平台執行環境,可使用 .NET Core/5/6。 +3. **GroupDocs.Editor for .NET** – 從[下載頁面](https://releases.groupdocs.com/editor/net/)下載。 +4. **授權** – 測試時使用[臨時授權](https://purchase.groupdocs.com/temporary-license/)即可;正式使用請購買完整授權。 +5. **免費試用** – 您亦可透過[免費試用](https://releases.groupdocs.com/)頁面試用此函式庫。 +6. **支援** – 若遇到問題,請前往[支援論壇](https://forum.groupdocs.com/c/editor/20)或考慮前往[購買頁面](https://purchase.groupdocs.com/buy)取得完整授權。 + +## 匯入命名空間 +在開始編寫程式碼之前,您需要匯入必要的命名空間。請在 `.cs` 檔案的最上方加入以下 using 指令: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. 取得輸入檔的路徑 -首先,您需要指定輸入電子表格檔案的路徑。該檔案應該是具有多個選項卡的 XLSX (OOXML)。 + +## 如何將每個 Excel 分頁保存為獨立檔案? +載入活頁簿,為每個工作表建立 `EditableDocument`,並使用 `Save` 指定欲輸出的格式。此流程會將每個分頁分離,讓您自行選擇輸出路徑,且會自動釋放資源。以下是您將遵循的逐步工作流程,並附上每個 API 呼叫的說明與避免常見問題的最佳實踐提示。 + +### 步驟 1:取得輸入檔案的路徑 +首先,指定包含多個分頁的來源 XLSX 檔案的完整路徑。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. 將電子表格載入到編輯器實例中 -接下來,您將電子表格加載到`Editor`實例。這是使用文件流並為電子表格指定適當的載入選項來完成的。 + +### 步驟 2:將試算表載入 Editor 實例 +`Editor` 類別是 GroupDocs.Editor 所有文件操作的入口。它會讀取檔案串流並將文件準備好供編輯或提取使用。 + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - //進一步的步驟將在此處進行 + // Further steps will go here } } ``` -## 3. 從第一個選項卡建立可編輯文檔 -要編輯或操作特定選項卡,您需要建立一個`EditableDocument`該選項卡的實例。此選項卡是使用基於 0 的索引指定的。 + +### 步驟 3:從第一個分頁建立 EditableDocument +`EditableDocument` 代表活頁簿中單一可編輯的工作表。其建構子接受 `Editor` 實例以及以零為起始的工作表索引。 + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; //第一個選項卡 +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. 從第二個標籤建立可編輯文檔 -同樣,創建一個`EditableDocument`對於第二個選項卡。 + +### 步驟 4:從第二個分頁建立 EditableDocument +您可以透過變更索引值,以相同方式為其他工作表建立 `EditableDocument`。 + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; //第二個選項卡 +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. 將第一個選項卡儲存到單獨的文件中 -現在,將第一個選項卡另存為單獨的文檔。指定儲存格式和輸出路徑。 + +### 步驟 5:將第一個分頁保存為獨立文件 +`Save` 會將編輯後的文件寫入指定格式的檔案。於 `EditableDocument` 實例上呼叫此方法,並提供輸出路徑與格式(例如 `SaveFormat.Xlsx`)。 + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. 將第二個選項卡儲存到單獨的文件中 -對第二個選項卡重複此過程,但這次以不同的格式儲存。 + +### 步驟 6:將第二個分頁保存為獨立文件 +第二個工作表同樣使用 `Save` 呼叫,若需要亦可選擇不同的格式,例如 PDF。 + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. 處理 EditableDocument 實例 -最後,確保您正確處置`EditableDocument`實例以釋放資源。 + +### 步驟 7:釋放 EditableDocument 實例 +`Dispose` 會釋放文件所持有的非受控資源(如檔案句柄),確保在長時間執行的服務中不會發生資源泄漏。 + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## 常見問題與解決方案 +- **「檔案被鎖定」錯誤** – 確保對每個 `EditableDocument` 及 `Editor` 實例呼叫 `Dispose()`,或使用 `using` 陳述式包住它們。 +- **匯出後樣式遺失** – 請確認您保存的格式支援樣式(例如 XLSX 或 PDF),CSV 會依設計失去格式。 +- **大型活頁簿導致效能緩慢** – 使用串流載入選項 (`LoadOptions.Streaming = true`) 以降低記憶體使用量。 + +## 常見問答 + +**Q: 如果我的活頁簿包含隱藏工作表怎麼辦?** +A: 隱藏工作表會被視為一般工作表;您可以透過索引存取並保存它們,但若希望在輸出中可見,可能需要在保存前將 `EditableDocument.IsVisible = true` 設為 true。 + +**Q: 能直接將 Excel 分頁轉換為 PDF 嗎?** +A: 可以,在對 `EditableDocument` 呼叫 `Save` 時指定 `SaveFormat.Pdf`。函式庫會在轉換過程中保留版面配置、圖片與圖表。 + +**Q: 能將活頁簿拆分為 CSV 檔而非 XLSX 嗎?** +A: 完全可以。對每個 `EditableDocument` 使用 `SaveFormat.Csv`,即可產生每張工作表的純文字 CSV 表示。 + +**Q: GroupDocs.Editor 支援受密碼保護的 Excel 檔案嗎?** +A: 支援。建立 `Editor` 實例時,透過 `LoadOptions.Password` 提供密碼即可。 + +**Q: 我可以在哪裡找到更多試算表相關的範例?** +A: 官方文件與 [下載頁面](https://releases.groupdocs.com/editor/net/) 上的示範專案提供更多使用案例。 + ## 結論 -透過執行以下步驟,您可以使用 GroupDocs.Editor 在 .NET 中輕鬆處理多選項卡電子表格。這個功能強大的庫簡化了在電子表格中編輯和保存不同工作表的過程,使您的開發任務更易於管理。無論您要處理複雜的資料操作還是簡單的編輯,GroupDocs.Editor for .NET 都能提供您高效完成工作所需的工具。 -## 常見問題解答 -### 什麼是 .NET 的 GroupDocs.Editor? -GroupDocs.Editor for .NET 是一個功能強大的文件編輯 API,允許開發人員在 .NET 應用程式中載入、編輯和保存各種格式的文件。 -### 我可以在購買之前嘗試適用於 .NET 的 GroupDocs.Editor 嗎? -是的,您可以使用[免費試用](https://releases.groupdocs.com/)或請求[臨時執照](https://purchase.groupdocs.com/temporary-license/)來評估產品。 -### GroupDocs.Editor for .NET 支援哪些檔案格式? -GroupDocs.Editor 支援多種格式,包括 DOCX、XLSX、PPTX、PDF 等。 -### 如何獲得對 GroupDocs.Editor for .NET 的支援? -您可以透過訪問獲得支持[支援論壇](https://forum.groupdocs.com/c/editor/20). -### 哪裡可以購買 GroupDocs.Editor for .NET 的完整授權? -您可以從以下位置購買完整許可證[購買頁面](https://purchase.groupdocs.com/buy). \ No newline at end of file +依照上述步驟,您即可 **將每個 Excel 分頁** 保存為獨立文件、將分頁轉換為 PDF,或將大型活頁簿拆分為可管理的片段——全部使用可靠且高效能的 GroupDocs.Editor for .NET 函式庫。此功能可簡化報告流程、自動化資料抽取,並減少手動處理試算表的工作量。 + +--- + +**最後更新:** 2026-06-06 +**測試環境:** GroupDocs.Editor 23.11 for .NET +**作者:** GroupDocs + +--- + +## 相關教學 + +- [精通 .NET 中的試算表分頁提取(使用 GroupDocs.Editor)](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [使用 GroupDocs.Editor for .NET 為 Excel 檔案設定密碼保護 \| 安全試算表管理](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [精通 .NET 中的文件載入(使用 GroupDocs.Editor):完整指南](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/hungarian/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/hungarian/net/document-processing/work-multi-tab-spreadsheets/_index.md index e79ef42a..a116ff05 100644 --- a/content/hungarian/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/hungarian/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: Dolgozzon többlapos táblázatokkal -linktitle: Dolgozzon többlapos táblázatokkal +date: 2026-06-06 +description: Ismerje meg, hogyan **mentse el az egyes Excel lapokat** a GroupDocs.Editor + for .NET használatával – lépésről‑lépésre útmutató, kódrészletek és legjobb gyakorlatok + az XLSX fájlok felosztásához. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Munkavégzés többlapos táblázatokkal +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Ismerje meg, hogyan dolgozhat többlapos táblázatokkal .NET-ben a GroupDocs.Editor segítségével. Lépésről lépésre útmutató, kódpéldák és bevált gyakorlatok. -weight: 17 -url: /hu/net/document-processing/work-multi-tab-spreadsheets/ +title: Hogyan mentse el az egyes Excel lapokat a GroupDocs.Editor .NET segítségével type: docs +url: /hu/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Dolgozzon többlapos táblázatokkal + +# Többlapos táblázatok kezelése ## Bevezetés -A többlapos táblázatok kezelése meglehetősen nehéz feladat lehet, különösen akkor, ha ugyanazon a dokumentumon belül különböző lapokról kell adatokat kezelni vagy kivonni. Ha .NET-tel dolgozik, és robusztus megoldást keres, a GroupDocs.Editor for .NET kiváló választás. Ebben az oktatóanyagban végigvezetjük a többlapos táblázatok kezelésének folyamatán a GroupDocs.Editor for .NET használatával. A környezet beállításától az egyes lapok külön fájlként történő mentéséig mindenre kiterjedünk. +Ha **minden Excel lapot** önálló fájlként kell menteni, a GroupDocs.Editor for .NET egyszerűvé teszi ezt. Akár pénzügyi jelentéseket von ki, részlegenkénti munkalapokat generál, vagy lapokat PDF‑be konvertál, ez az útmutató végigvezeti a teljes munkafolyamaton – a környezet beállításától az erőforrások felszabadításáig – így magabiztosan automatizálhatja a többlapos kezelést. + +## Gyors válaszok +- **Meg tudja a GroupDocs.Editor szétválasztani az XLSX‑t külön fájlokra?** Igen, betöltheti a munkafüzetet, és minden munkalapot külön exportálhat. +- **Milyen formátumokban menthető egy-egy lap?** XLSX, CSV, PDF, HTML és továbbiak – több mint 30 kimeneti formátum támogatott. +- **Szükségem van licencre ehhez a funkcióhoz?** Egy ideiglenes licenc teszteléshez elegendő; a termeléshez teljes licenc szükséges. +- **Támogatott a .NET Core?** Természetesen – a könyvtár működik .NET Framework 4.0+ és .NET Core/5/6+ verziókkal. +- **Hány lapot lehet egyszerre feldolgozni?** A GroupDocs.Editor képes 500+ munkalappal rendelkező munkafüzetek kezelésére anélkül, hogy a teljes fájlt a memóriába töltené. + +## Mi az a „save each excel tab”? +**„Save each Excel tab”** azt jelenti, hogy egy többlapos munkafüzet minden munkalapját kinyerjük, és mindegyiket egy önálló dokumentumba (például külön XLSX vagy PDF fájlba) írjuk. Ez a megközelítés leegyszerűsíti a további feldolgozást, jelentéskészítést és terjesztést, mivel laponként egy fájlt kap, amely aztán megosztható, archiválható vagy önállóan tovább alakítható. + +## Miért használja a GroupDocs.Editor‑t ehhez a feladathoz? +A GroupDocs.Editor támogat **30+ bemeneti és kimeneti formátumot**, és akár **1 000 munkalappal** rendelkező táblázatokat is képes feldolgozni, miközben alacsony memóriahasználatot biztosít az adatfolyamok (streaming) használatával a teljes fájl betöltése helyett. Az API megőrzi a cellastílusokat, képleteket és beágyazott képeket is, biztosítva, hogy minden exportált lap pontosan úgy nézzen ki, mint az eredeti. + ## Előfeltételek -Mielőtt belevágna az oktatóanyagba, győződjön meg arról, hogy a következő előfeltételeket teljesítette: -1. Visual Studio: Győződjön meg arról, hogy a Visual Studio telepítve van a gépen. -2. .NET-keretrendszer: A GroupDocs.Editor for .NET támogatja a .NET-keretrendszer 4.0-s vagy újabb verzióját. -3. GroupDocs.Editor for .NET: Töltse le és telepítse a GroupDocs.Editor for .NET könyvtárat. Beszerezheti a[letöltési oldal](https://releases.groupdocs.com/editor/net/). -4. Licenc: Amíg használhatja a[ideiglenes engedély](https://purchase.groupdocs.com/temporary-license/) a könyvtár kipróbálásához ajánlatos teljes licencet vásárolni éles használatra. +1. **Visual Studio** – bármelyik legújabb kiadás (Community, Professional vagy Enterprise). +2. **.NET Framework 4.0+** – vagy .NET Core/5/6, ha a keresztplatformos futtatókörnyezetet részesíti előnyben. +3. **GroupDocs.Editor for .NET** – töltse le a [letöltési oldalról](https://releases.groupdocs.com/editor/net/). +4. **License** – egy [ideiglenes licenc](https://purchase.groupdocs.com/temporary-license/) teszteléshez megfelelő; a termeléshez teljes licenc vásárlása szükséges. +5. **Free trial** – a könyvtárat a [ingyenes próba](https://releases.groupdocs.com/) oldalon is kipróbálhatja. +6. **Support** – ha problémába ütközik, látogassa meg a [támogatási fórum](https://forum.groupdocs.com/c/editor/20) oldalt, vagy fontolja meg a [vásárlási oldal](https://purchase.groupdocs.com/buy) oldalt a teljes licenchez. + ## Névterek importálása -Mielőtt elkezdené a kódolást, importálnia kell a szükséges névtereket. Adja hozzá a következőket direktívák segítségével a .cs fájl tetejéhez: +Mielőtt elkezdenénk a kódolást, importálnia kell a szükséges névtereket. Adja hozzá a következő using direktívákat a `.cs` fájl tetejéhez: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Keresse meg a bemeneti fájl elérési útját -Először is meg kell adnia a bemeneti táblázatfájl elérési útját. Ennek a fájlnak XLSX (OOXML) formátumúnak kell lennie, több lappal. + +## Hogyan mentse el minden Excel lapot külön fájlként? +Töltse be a munkafüzetet, hozzon létre egy `EditableDocument`‑ot minden munkalaphoz, és hívja meg a `Save`‑et a kívánt formátummal. Ez a folyamat elkülöníti az egyes lapokat, lehetővé teszi egyedi kimeneti útvonalak kiválasztását, és automatikusan felszabadítja az erőforrásokat. Az alábbiakban lépésről‑lépésre bemutatjuk a munkafolyamatot, magyarázatokkal minden API híváshoz és legjobb gyakorlatokkal a gyakori hibák elkerüléséhez. + +### 1. lépés: Szerezzen be egy útvonalat a bemeneti fájlhoz +Először adja meg a forrás XLSX teljes útvonalát, amely több lapot tartalmaz. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Töltse be a táblázatot a Szerkesztőpéldányba - Ezután töltse be a táblázatot egy`Editor` példa. Ez egy fájlfolyam segítségével történik, és megadja a táblázat megfelelő betöltési beállításait. + +### 2. lépés: Töltse be a táblázatot az Editor példányba +Az `Editor` osztály a belépési pont minden dokumentumművelethez a GroupDocs.Editor‑ben. Beolvassa a fájl adatfolyamát, és előkészíti a dokumentumot a szerkesztéshez vagy kinyeréshez. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // A további lépések itt lesznek + // Further steps will go here } } ``` -## 3. Hozzon létre egy EditableDocument-et az első lapon - Egy adott lap szerkesztéséhez vagy kezeléséhez létre kell hoznia egy`EditableDocument` példa erre a lapra. A lap 0 alapú index segítségével van megadva. + +### 3. lépés: Hozzon létre egy EditableDocument‑ot az első lapból +Az `EditableDocument` egyetlen, szerkeszthető munkalapot képvisel a munkafüzetben. A konstruktor a `Editor` példányt és egy nullától induló lap indexet vár. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Első fül +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Hozzon létre egy EditableDocument-et a második lapon - Hasonló módon hozzon létre egy`EditableDocument` a második fülre. + +### 4. lépés: Hozzon létre egy EditableDocument‑ot a második lapból +Ugyanezt a mintát bármely további lapra megismételheti az index értékének módosításával. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Második fül +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Mentse el az első lapot egy külön dokumentumba -Most mentse az első lapot külön dokumentumként. Adja meg a mentési formátumot és a kimeneti útvonalat. + +### 5. lépés: Mentse el az első lapot egy külön dokumentumba +A `Save` a szerkesztett dokumentumot a megadott formátumban egy fájlba írja. Hívja meg az `EditableDocument` példányon, megadva a kimeneti útvonalat és a formátumot (például `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Mentse el a második lapot egy külön dokumentumba -Ismételje meg a folyamatot a második lapnál, de ezúttal mentse el más formátumban. + +### 6. lépés: Mentse el a második lapot egy külön dokumentumba +Ugyanez a `Save` hívás működik a második lapon is, és szükség esetén választhat más formátumot, például PDF‑et. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Dobja el a szerkeszthető dokumentumpéldányokat - Végül győződjön meg arról, hogy megfelelően dobta ki a`EditableDocument` példányokat az erőforrások felszabadítására. + +### 7. lépés: Az EditableDocument példányok felszabadítása +A `Dispose` felszabadítja a dokumentum által tartott nem kezelt erőforrásokat, például a fájlkezelőket, ezzel biztosítva, hogy hosszú távú szolgáltatásokban ne legyenek szivárgások. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Következtetés -Ha követi ezeket a lépéseket, a GroupDocs.Editor segítségével könnyedén dolgozhat többlapos táblázatokkal a .NET-ben. Ez a nagy teljesítményű könyvtár leegyszerűsíti a különböző lapok táblázaton belüli szerkesztésének és mentésének folyamatát, így a fejlesztési feladatok könnyebben kezelhetők. Akár összetett adatkezelésről, akár egyszerű szerkesztésről van szó, a GroupDocs.Editor for .NET biztosítja a szükséges eszközöket a munka hatékony elvégzéséhez. -## GYIK -### Mi az a GroupDocs.Editor for .NET? -GroupDocs.Editor for .NET egy hatékony dokumentumszerkesztő API, amely lehetővé teszi a fejlesztők számára, hogy különböző formátumú dokumentumokat töltsenek be, szerkesszenek és mentsenek a .NET-alkalmazásokon belül. -### Kipróbálhatom a GroupDocs.Editor for .NET programot vásárlás előtt? - Igen, használhatod a[ingyenes próbaverzió](https://releases.groupdocs.com/) vagy kérjen a[ideiglenes engedély](https://purchase.groupdocs.com/temporary-license/) a termék értékeléséhez. -### Milyen fájlformátumokat támogat a GroupDocs.Editor for .NET? -A GroupDocs.Editor a formátumok széles skáláját támogatja, beleértve a DOCX, XLSX, PPTX, PDF és sok más formátumot. -### Hogyan kaphatok támogatást a GroupDocs.Editor for .NET számára? - Támogatást kaphat, ha ellátogat a[támogatói fórum](https://forum.groupdocs.com/c/editor/20). -### Hol vásárolhatok teljes licencet a GroupDocs.Editor for .NET számára? - Teljes licencet vásárolhat a[vásárlási oldal](https://purchase.groupdocs.com/buy). \ No newline at end of file +## Gyakori problémák és megoldások +- **“File is locked” errors** – Győződjön meg arról, hogy minden `EditableDocument` és az `Editor` példány esetén meghívja a `Dispose()`‑t, vagy `using` blokkokba helyezi őket. +- **Missing styles after export** – Ellenőrizze, hogy olyan formátumba ment, amely támogatja a stílusokat (például XLSX vagy PDF). A CSV a formázást tervezés szerint elveszti. +- **Large workbooks cause slow performance** – Használja a streaming betöltési beállításokat (`LoadOptions.Streaming = true`) a memóriahasználat alacsonyan tartásához. + +## Gyakran feltett kérdések + +**Q: Mi van, ha a munkafüzet rejtett lapokat tartalmaz?** +A: A rejtett lapok úgy kezelődnek, mint a többi lap; index alapján elérheti és mentheti őket, de előfordulhat, hogy a mentés előtt be kell állítania a `EditableDocument.IsVisible = true` értéket, ha a kimenetben láthatóvá szeretné tenni őket. + +**Q: Konvertálhatom közvetlenül egy Excel lapot PDF‑be?** +A: Igen, adja meg a `SaveFormat.Pdf` értéket a `EditableDocument` `Save` hívásakor. A könyvtár a konverzió során megőrzi az elrendezést, a képeket és a diagramokat. + +**Q: Lehetséges a munkafüzetet CSV fájlokra bontani az XLSX helyett?** +A: Természetesen. Használja a `SaveFormat.Csv`‑t minden `EditableDocument` esetén, hogy minden laphoz egyszerű szöveges CSV ábrázolást generáljon. + +**Q: Támogatja a GroupDocs.Editor a jelszóval védett Excel fájlokat?** +A: Igen. A jelszót a `LoadOptions.Password` segítségével adja meg az `Editor` példány létrehozásakor. + +**Q: Hol találok további példákat a táblázatokkal való munkához?** +A: A hivatalos dokumentáció és a mintaprojektek a [letöltési oldalon](https://releases.groupdocs.com/editor/net/) további felhasználási eseteket tartalmaznak. + +## Összegzés +Ezeknek a lépéseknek a követésével **minden Excel lapot** önálló dokumentumként menthet, a lapokat PDF‑be konvertálhatja, vagy nagy munkafüzeteket kezelhető darabokra oszthat – mindezt a megbízható, nagy teljesítményű GroupDocs.Editor for .NET könyvtárral. Ez a lehetőség leegyszerűsíti a jelentéskészítési folyamatokat, automatizálja az adatok kinyerését, és csökkenti a manuális táblázatkezelést. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## Kapcsolódó oktatóanyagok + +- [Többlapos táblázatlap kinyerésének elsajátítása .NET‑ben a GroupDocs.Editor segítségével](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Excel fájlok jelszóval való védelme a GroupDocs.Editor for .NET használatával | Biztonságos táblázatkezelés](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Dokumentumbetöltés elsajátítása .NET‑ben a GroupDocs.Editor‑rel: Átfogó útmutató](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/indonesian/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/indonesian/net/document-processing/work-multi-tab-spreadsheets/_index.md index 7293df25..e229bf2c 100644 --- a/content/indonesian/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/indonesian/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,213 @@ --- -title: Bekerja dengan Spreadsheet Multi-Tab +date: 2026-06-06 +description: Pelajari cara **menyimpan setiap tab Excel** menggunakan GroupDocs.Editor + for .NET – panduan langkah demi langkah, contoh kode, dan praktik terbaik untuk + memisahkan file XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files linktitle: Bekerja dengan Spreadsheet Multi-Tab +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Pelajari cara bekerja dengan spreadsheet multi-tab di .NET menggunakan GroupDocs.Editor. Panduan langkah demi langkah, contoh kode, dan praktik terbaik disertakan. -weight: 17 -url: /id/net/document-processing/work-multi-tab-spreadsheets/ +title: Cara menyimpan setiap tab Excel dengan GroupDocs.Editor .NET type: docs +url: /id/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- + # Bekerja dengan Spreadsheet Multi-Tab -## Perkenalan -Menangani spreadsheet multi-tab bisa menjadi tugas yang cukup sulit, terutama ketika Anda perlu memanipulasi atau mengekstrak data dari lembar berbeda dalam dokumen yang sama. Jika Anda bekerja dengan .NET dan mencari solusi yang kuat, GroupDocs.Editor untuk .NET adalah pilihan yang sangat baik. Dalam tutorial ini, kami akan memandu Anda melalui proses bekerja dengan spreadsheet multi-tab menggunakan GroupDocs.Editor untuk .NET. Kami akan membahas semuanya mulai dari menyiapkan lingkungan Anda hingga menyimpan setiap tab sebagai file terpisah. +## Pendahuluan +Jika Anda perlu **menyimpan setiap tab Excel** sebagai file terpisah, GroupDocs.Editor untuk .NET mempermudahnya. Baik Anda mengekstrak laporan keuangan, menghasilkan lembar kerja per‑departemen, atau mengonversi tab ke PDF, tutorial ini memandu Anda melalui seluruh alur kerja—dari penyiapan lingkungan hingga pembuangan sumber daya—sehingga Anda dapat mengotomatisasi penanganan multi‑sheet dengan percaya diri. + +## Jawaban Cepat +- **Apakah GroupDocs.Editor dapat memisahkan XLSX menjadi file terpisah?** Ya, Anda dapat memuat workbook dan mengekspor setiap lembar secara terpisah. +- **Format apa saja yang dapat disimpan untuk setiap tab?** XLSX, CSV, PDF, HTML, dan lainnya – lebih dari 30 format output didukung. +- **Apakah saya memerlukan lisensi untuk fitur ini?** Lisensi sementara cukup untuk pengujian; lisensi penuh diperlukan untuk produksi. +- **Apakah .NET Core didukung?** Tentu – perpustakaan ini bekerja dengan .NET Framework 4.0+ dan .NET Core/5/6+. +- **Berapa banyak tab yang dapat diproses sekaligus?** GroupDocs.Editor dapat menangani workbook dengan lebih dari 500 lembar tanpa memuat seluruh file ke memori. + +## Apa itu “save each excel tab”? +**“Save each Excel tab”** berarti mengekstrak setiap lembar kerja dari workbook multi‑sheet dan menuliskannya ke dalam dokumen mandiri masing‑masing (misalnya file XLSX atau PDF terpisah). Pendekatan ini menyederhanakan pemrosesan lanjutan, pelaporan, dan distribusi dengan memberikan Anda satu file per lembar, yang kemudian dapat dibagikan, diarsipkan, atau diubah lebih lanjut secara independen. + +## Mengapa menggunakan GroupDocs.Editor untuk tugas ini? +GroupDocs.Editor mendukung **lebih dari 30 format input dan output** dan dapat memproses spreadsheet dengan **hingga 1.000 lembar** sambil menjaga penggunaan memori tetap rendah dengan men‑stream data alih‑alih memuat seluruh file. API juga mempertahankan gaya sel, formula, dan gambar tersemat, memastikan setiap tab yang diekspor terlihat identik dengan aslinya. + ## Prasyarat -Sebelum masuk ke tutorial, pastikan Anda memiliki prasyarat berikut: -1. Visual Studio: Pastikan Anda telah menginstal Visual Studio di mesin Anda. -2. .NET Framework: GroupDocs.Editor untuk .NET mendukung .NET Framework 4.0 atau lebih tinggi. -3. GroupDocs.Editor untuk .NET: Unduh dan instal perpustakaan GroupDocs.Editor untuk .NET. Anda bisa mendapatkannya dari[Unduh Halaman](https://releases.groupdocs.com/editor/net/). -4. Lisensi: Meskipun Anda dapat menggunakan a[izin sementara](https://purchase.groupdocs.com/temporary-license/) untuk mencoba perpustakaan, disarankan untuk membeli lisensi penuh untuk penggunaan produksi. +Sebelum menyelam lebih dalam, pastikan Anda memiliki: + +1. **Visual Studio** – edisi terbaru apa pun (Community, Professional, atau Enterprise). +2. **.NET Framework 4.0+** – atau .NET Core/5/6 jika Anda lebih suka runtime lintas‑platform. +3. **GroupDocs.Editor for .NET** – unduh dari [halaman unduhan](https://releases.groupdocs.com/editor/net/). +4. **Lisensi** – [lisensi sementara](https://purchase.groupdocs.com/temporary-license/) cukup untuk pengujian; beli lisensi penuh untuk penggunaan produksi. +5. **Uji coba gratis** – Anda juga dapat mencoba perpustakaan melalui halaman [free trial](https://releases.groupdocs.com/). +6. **Dukungan** – jika Anda mengalami **masalah**, kunjungi [forum dukungan](https://forum.groupdocs.com/c/editor/20) atau pertimbangkan [halaman pembelian](https://purchase.groupdocs.com/buy) untuk lisensi penuh. + ## Impor Namespace -Sebelum kita mulai membuat kode, Anda perlu mengimpor namespace yang diperlukan. Tambahkan arahan penggunaan berikut ke bagian atas file .cs Anda: +Sebelum kita mulai menulis kode, Anda perlu mengimpor namespace yang diperlukan. Tambahkan direktif `using` berikut ke bagian atas file `.cs` Anda: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Dapatkan Jalur ke File Input -Pertama, Anda perlu menentukan jalur ke file spreadsheet masukan Anda. File ini harus berupa XLSX (OOXML) dengan banyak tab. + +## Cara menyimpan setiap tab Excel sebagai file terpisah? +Muat workbook, buat `EditableDocument` untuk setiap lembar, dan panggil `Save` dengan format yang diinginkan. Proses ini memisahkan setiap tab, memungkinkan Anda memilih jalur output yang berbeda, dan secara otomatis melepaskan sumber daya. Berikut alur kerja langkah demi langkah yang akan Anda ikuti, dengan penjelasan untuk setiap panggilan API dan tips praktik terbaik untuk menghindari jebakan umum. + +### Langkah 1: Dapatkan Jalur ke File Input +Pertama, tentukan jalur lengkap ke file XLSX sumber yang berisi banyak tab. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Muat Spreadsheet ke dalam Mesin Virtual Editor - Selanjutnya, Anda akan memuat spreadsheet ke dalam`Editor` contoh. Hal ini dilakukan dengan menggunakan aliran file dan menentukan opsi pemuatan yang sesuai untuk spreadsheet. + +### Langkah 2: Muat Spreadsheet ke Instance Editor +Kelas `Editor` adalah titik masuk untuk semua operasi dokumen di GroupDocs.Editor. Ia membaca aliran file dan menyiapkan dokumen untuk penyuntingan atau ekstraksi. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Langkah selanjutnya akan dilakukan di sini + // Further steps will go here } } ``` -## 3. Buat Dokumen yang Dapat Diedit dari Tab Pertama - Untuk mengedit atau memanipulasi tab tertentu, Anda perlu membuat`EditableDocument` contoh untuk tab itu. Tab ditentukan menggunakan indeks berbasis 0. + +### Langkah 3: Buat EditableDocument dari Tab Pertama +`EditableDocument` mewakili satu lembar yang dapat diedit dalam workbook. Konstruktor menerima instance `Editor` dan indeks lembar berbasis nol. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Tab pertama +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Buat Dokumen yang Dapat Diedit dari Tab Kedua - Demikian pula, buatlah`EditableDocument` untuk tab kedua. + +### Langkah 4: Buat EditableDocument dari Tab Kedua +Anda dapat mengulangi pola yang sama untuk lembar tambahan apa pun dengan mengubah nilai indeks. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Tab kedua +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Simpan Tab Pertama ke Dokumen Terpisah -Sekarang, simpan tab pertama sebagai dokumen terpisah. Tentukan format penyimpanan dan jalur keluaran. + +### Langkah 5: Simpan Tab Pertama ke Dokumen Terpisah +`Save` menulis dokumen yang telah diedit ke file dalam format yang ditentukan. Panggil pada instance `EditableDocument`, berikan jalur output dan format (misalnya, `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Simpan Tab Kedua ke Dokumen Terpisah -Ulangi proses untuk tab kedua, tapi kali ini simpan dalam format yang berbeda. + +### Langkah 6: Simpan Tab Kedua ke Dokumen Terpisah +Pemanggilan `Save` yang sama berfungsi untuk lembar kedua, dan Anda dapat memilih format berbeda seperti PDF jika diperlukan. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Buang Instans Dokumen yang Dapat Diedit - Terakhir, pastikan Anda membuangnya dengan benar`EditableDocument` contoh untuk membebaskan sumber daya. + +### Langkah 7: Buang Instance EditableDocument +`Dispose` melepaskan sumber daya tak terkelola yang dimiliki dokumen, seperti handle file, memastikan tidak ada kebocoran pada layanan yang berjalan lama. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Masalah Umum dan Solusinya +- **Kesalahan “File terkunci”** – Pastikan Anda memanggil `Dispose()` pada setiap `EditableDocument` dan instance `Editor`, atau bungkus mereka dalam pernyataan `using`. +- **Gaya hilang setelah ekspor** – Pastikan Anda menyimpan ke format yang mendukung gaya (mis., XLSX atau PDF). CSV akan kehilangan format secara sengaja. +- **Workbook besar menyebabkan kinerja lambat** – Gunakan opsi pemuatan streaming (`LoadOptions.Streaming = true`) untuk menjaga penggunaan memori tetap rendah. + +## Pertanyaan yang Sering Diajukan + +**Q: Bagaimana jika workbook saya berisi lembar tersembunyi?** +A: Lembar tersembunyi diperlakukan seperti lembar lain; Anda dapat mengaksesnya dengan indeks dan menyimpannya, tetapi mungkin perlu mengatur `EditableDocument.IsVisible = true` sebelum menyimpan jika Anda ingin mereka terlihat di output. + +**Q: Bisakah saya mengonversi tab Excel langsung ke PDF?** +A: Ya, tentukan `SaveFormat.Pdf` saat memanggil `Save` pada `EditableDocument`. Perpustakaan mempertahankan tata letak, gambar, dan diagram selama konversi. + +**Q: Apakah memungkinkan memisahkan workbook menjadi file CSV alih-alih XLSX?** +A: Tentu saja. Gunakan `SaveFormat.Csv` untuk setiap `EditableDocument` guna menghasilkan representasi CSV teks biasa dari setiap lembar. + +**Q: Apakah GroupDocs.Editor mendukung file Excel yang dilindungi password?** +A: Ya. Berikan password melalui `LoadOptions.Password` saat membuat instance `Editor`. + +**Q: Di mana saya dapat menemukan contoh lebih lanjut tentang bekerja dengan spreadsheet?** +A: Dokumentasi resmi dan proyek contoh pada [halaman unduhan](https://releases.groupdocs.com/editor/net/) berisi contoh penggunaan tambahan. + ## Kesimpulan -Dengan mengikuti langkah-langkah ini, Anda dapat dengan mudah bekerja dengan spreadsheet multi-tab di .NET menggunakan GroupDocs.Editor. Pustaka canggih ini menyederhanakan proses pengeditan dan penyimpanan berbagai lembar dalam spreadsheet, membuat tugas pengembangan Anda lebih mudah dikelola. Baik Anda berurusan dengan manipulasi data yang kompleks atau pengeditan sederhana, GroupDocs.Editor untuk .NET menyediakan alat yang Anda perlukan untuk menyelesaikan pekerjaan secara efisien. -## FAQ -### Apa itu GroupDocs.Editor untuk .NET? -GroupDocs.Editor untuk .NET adalah API pengeditan dokumen canggih yang memungkinkan pengembang memuat, mengedit, dan menyimpan dokumen dalam berbagai format dalam aplikasi .NET. -### Bisakah saya mencoba GroupDocs.Editor untuk .NET sebelum membeli? - Ya, Anda dapat menggunakan a[uji coba gratis](https://releases.groupdocs.com/) atau meminta a[izin sementara](https://purchase.groupdocs.com/temporary-license/) untuk mengevaluasi produk. -### Format file apa yang didukung oleh GroupDocs.Editor untuk .NET? -GroupDocs.Editor mendukung berbagai format, termasuk DOCX, XLSX, PPTX, PDF, dan banyak lagi. -### Bagaimana cara mendapatkan dukungan untuk GroupDocs.Editor untuk .NET? - Anda bisa mendapatkan dukungan dengan mengunjungi[forum dukungan](https://forum.groupdocs.com/c/editor/20). -### Di mana saya dapat membeli lisensi penuh GroupDocs.Editor untuk .NET? - Anda dapat membeli lisensi penuh dari[halaman pembelian](https://purchase.groupdocs.com/buy). \ No newline at end of file +Dengan mengikuti langkah‑langkah ini, Anda dapat **menyimpan setiap tab Excel** sebagai dokumen independen, mengonversi tab ke PDF, atau memisahkan workbook besar menjadi bagian‑bagian yang dapat dikelola—semua dengan perpustakaan GroupDocs.Editor untuk .NET yang andal dan berperforma tinggi. Kemampuan ini menyederhanakan alur kerja pelaporan, mengotomatisasi ekstraksi data, dan mengurangi penanganan spreadsheet manual. + +--- + +**Terakhir Diperbarui:** 2026-06-06 +**Diuji Dengan:** GroupDocs.Editor 23.11 untuk .NET +**Penulis:** GroupDocs + +--- + +## Tutorial Terkait + +- [Menguasai Ekstraksi Tab Spreadsheet di .NET dengan GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Melindungi File Excel dengan Password Menggunakan GroupDocs.Editor untuk .NET | Manajemen Spreadsheet Aman](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Menguasai Pemuatan Dokumen di .NET dengan GroupDocs.Editor: Panduan Komprehensif](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/italian/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/italian/net/document-processing/work-multi-tab-spreadsheets/_index.md index 74ad574b..a9d0b7db 100644 --- a/content/italian/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/italian/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,213 @@ --- -title: Lavora con fogli di calcolo multischeda -linktitle: Lavora con fogli di calcolo multischeda -second_title: API GroupDocs.Editor .NET -description: Scopri come lavorare con fogli di calcolo a più schede in .NET utilizzando GroupDocs.Editor. Guida passo passo, esempi di codice e best practice incluse. -weight: 17 -url: /it/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: Scopri come **salvare ogni scheda Excel** usando GroupDocs.Editor per + .NET – guida passo‑passo, esempi di codice e best practices per suddividere i file + XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Lavorare con fogli di calcolo a più schede +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Come salvare ogni scheda Excel con GroupDocs.Editor .NET type: docs +url: /it/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Lavora con fogli di calcolo multischeda -## introduzione -Gestire fogli di calcolo con più schede può essere un compito piuttosto impegnativo, soprattutto quando è necessario manipolare o estrarre dati da fogli diversi all'interno dello stesso documento. Se lavori con .NET e cerchi una soluzione solida, GroupDocs.Editor per .NET è una scelta eccellente. In questo tutorial ti guideremo attraverso il processo di lavoro con fogli di calcolo multischeda utilizzando GroupDocs.Editor per .NET. Tratteremo tutto, dalla configurazione del tuo ambiente al salvataggio di ciascuna scheda come file separato. +# Lavorare con fogli di calcolo a più schede + +## Introduzione +Se hai bisogno di **salvare ogni scheda Excel** come file indipendente, GroupDocs.Editor per .NET lo rende semplice. Che tu stia estraendo report finanziari, generando fogli di lavoro per dipartimento o convertendo le schede in PDF, questo tutorial ti guida attraverso l'intero flusso di lavoro — dalla configurazione dell'ambiente al rilascio delle risorse — così potrai automatizzare la gestione di più fogli con sicurezza. + +## Risposte rapide +- **GroupDocs.Editor può dividere un XLSX in file separati?** Sì, puoi caricare la cartella di lavoro ed esportare ogni foglio singolarmente. +- **In quali formati può essere salvata ogni scheda?** XLSX, CSV, PDF, HTML e altri – sono supportati oltre 30 formati di output. +- **È necessaria una licenza per questa funzionalità?** Una licenza temporanea è sufficiente per i test; è necessaria una licenza completa per la produzione. +- **.NET Core è supportato?** Assolutamente – la libreria funziona con .NET Framework 4.0+ e .NET Core/5/6+. +- **Quante schede possono essere elaborate contemporaneamente?** GroupDocs.Editor può gestire cartelle di lavoro con più di 500 fogli senza caricare l'intero file in memoria. + +## Cos'è “salvare ogni scheda Excel”? +**“Salvare ogni scheda Excel”** significa estrarre ogni foglio di lavoro da una cartella di lavoro a più fogli e scrivere ciascuno in un documento autonomo (ad esempio file XLSX o PDF separati). Questo approccio semplifica l'elaborazione a valle, la generazione di report e la distribuzione fornendo un file per foglio, che può poi essere condiviso, archiviato o trasformato ulteriormente in modo indipendente. + +## Perché usare GroupDocs.Editor per questo compito? +GroupDocs.Editor supporta **oltre 30 formati di input e output** e può elaborare fogli di calcolo con **fino a 1.000 fogli** mantenendo un basso utilizzo di memoria grazie allo streaming dei dati invece di caricare l'intero file. L'API preserva inoltre gli stili delle celle, le formule e le immagini incorporate, garantendo che ogni scheda esportata abbia lo stesso aspetto dell'originale. + ## Prerequisiti -Prima di immergerti nel tutorial, assicurati di avere i seguenti prerequisiti: -1. Visual Studio: assicurati di avere Visual Studio installato sul tuo computer. -2. .NET Framework: GroupDocs.Editor per .NET supporta .NET Framework 4.0 o versione successiva. -3. GroupDocs.Editor per .NET: scarica e installa la libreria GroupDocs.Editor per .NET. Puoi ottenerlo da[pagina di download](https://releases.groupdocs.com/editor/net/). -4. Licenza: sebbene sia possibile utilizzare a[licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per provare la libreria si consiglia di acquistare una licenza completa per uso produttivo. -## Importa spazi dei nomi -Prima di iniziare a scrivere il codice, devi importare gli spazi dei nomi necessari. Aggiungi le seguenti direttive using nella parte superiore del file .cs: +Prima di immergerti, verifica di avere: + +1. **Visual Studio** – qualsiasi edizione recente (Community, Professional o Enterprise). +2. **.NET Framework 4.0+** – oppure .NET Core/5/6 se preferisci l'ambiente di esecuzione multipiattaforma. +3. **GroupDocs.Editor for .NET** – scaricalo dalla [pagina di download](https://releases.groupdocs.com/editor/net/). +4. **Licenza** – una [licenza temporanea](https://purchase.groupdocs.com/temporary-license/) è sufficiente per i test; acquista una licenza completa per l'uso in produzione. +5. **Prova gratuita** – puoi anche provare la libreria tramite la pagina di [prova gratuita](https://releases.groupdocs.com/) . +6. **Supporto** – se incontri problemi, visita il [forum di supporto](https://forum.groupdocs.com/c/editor/20) o considera la [pagina di acquisto](https://purchase.groupdocs.com/buy) per una licenza completa. + +## Importare i namespace +Prima di iniziare a scrivere codice, devi importare gli spazi dei nomi necessari. Aggiungi le seguenti direttive using all'inizio del tuo file `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Ottieni un percorso per il file di input -Innanzitutto, devi specificare il percorso del file del foglio di calcolo di input. Questo file dovrebbe essere un XLSX (OOXML) con più schede. + +## Come salvare ogni scheda Excel come file separato? +Carica la cartella di lavoro, crea un `EditableDocument` per ogni foglio e chiama `Save` con il formato desiderato. Questo processo isola ogni scheda, ti consente di scegliere un percorso di output distinto e rilascia le risorse automaticamente. Di seguito trovi il flusso di lavoro passo‑passo da seguire, con spiegazioni per ogni chiamata API e consigli di best practice per evitare problemi comuni. + +### Passo 1: Ottenere il percorso del file di input +Innanzitutto, specifica il percorso completo del file XLSX di origine che contiene più schede. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Caricare il foglio di calcolo nell'istanza dell'editor - Successivamente, caricherai il foglio di calcolo in un file`Editor` esempio. Questa operazione viene eseguita utilizzando un flusso di file e specificando le opzioni di caricamento appropriate per un foglio di calcolo. + +### Passo 2: Caricare il foglio di calcolo nell'istanza Editor +La classe `Editor` è il punto di ingresso per tutte le operazioni sui documenti in GroupDocs.Editor. Legge lo stream del file e prepara il documento per la modifica o l'estrazione. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Ulteriori passi andranno qui + // Further steps will go here } } ``` -## 3. Crea un documento modificabile dalla prima scheda - Per modificare o manipolare una scheda specifica, è necessario creare un file`EditableDocument` istanza per quella scheda. La scheda viene specificata utilizzando un indice a base 0. + +### Passo 3: Creare un EditableDocument dalla prima scheda +`EditableDocument` rappresenta un singolo foglio modificabile all'interno della cartella di lavoro. Il costruttore accetta l'istanza `Editor` e un indice di foglio basato su zero. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Prima scheda +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Crea un documento modificabile dalla seconda scheda - Allo stesso modo, crea un file`EditableDocument` per la seconda scheda. + +### Passo 4: Creare un EditableDocument dalla seconda scheda +Puoi ripetere lo stesso schema per qualsiasi foglio aggiuntivo modificando il valore dell'indice. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Seconda scheda +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Salva la prima scheda in un documento separato -Ora salva la prima scheda come documento separato. Specificare il formato di salvataggio e il percorso di output. + +### Passo 5: Salvare la prima scheda in un documento separato +`Save` scrive il documento modificato in un file nel formato specificato. Invocalo sull'istanza `EditableDocument`, fornendo il percorso di output e il formato (ad esempio, `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Salvare la seconda scheda in un documento separato -Ripeti la procedura per la seconda scheda, ma questa volta salvala in un formato diverso. + +### Passo 6: Salvare la seconda scheda in un documento separato +La stessa chiamata `Save` funziona per il secondo foglio, e puoi scegliere un formato diverso come PDF se necessario. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Eliminare le istanze di documenti modificabili - Infine, assicurati di smaltire correttamente il`EditableDocument` istanze per liberare risorse. + +### Passo 7: Rilasciare le istanze di EditableDocument +`Dispose` rilascia le risorse non gestite detenute dal documento, come i handle dei file, garantendo l'assenza di perdite in servizi a lungo termine. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Conclusione -Seguendo questi passaggi, puoi lavorare facilmente con fogli di calcolo multischeda in .NET utilizzando GroupDocs.Editor. Questa potente libreria semplifica il processo di modifica e salvataggio di diversi fogli all'interno di un foglio di calcolo, rendendo le attività di sviluppo più gestibili. Che tu abbia a che fare con una manipolazione complessa di dati o semplici modifiche, GroupDocs.Editor per .NET fornisce gli strumenti necessari per svolgere il lavoro in modo efficiente. +## Problemi comuni e soluzioni +- **Errori “File is locked”** – Assicurati di chiamare `Dispose()` su ogni `EditableDocument` e sull'istanza `Editor`, oppure avvolgili in istruzioni `using`. +- **Stili mancanti dopo l'esportazione** – Verifica di salvare in un formato che supporta lo styling (ad esempio, XLSX o PDF). CSV perderà la formattazione per design. +- **Cartelle di lavoro grandi causano prestazioni lente** – Usa le opzioni di caricamento in streaming (`LoadOptions.Streaming = true`) per mantenere basso l'uso della memoria. + ## Domande frequenti -### Cos'è GroupDocs.Editor per .NET? -GroupDocs.Editor per .NET è una potente API di modifica dei documenti che consente agli sviluppatori di caricare, modificare e salvare documenti di vari formati all'interno delle applicazioni .NET. -### Posso provare GroupDocs.Editor per .NET prima dell'acquisto? - Sì, puoi usare a[prova gratuita](https://releases.groupdocs.com/) oppure richiedi un[licenza temporanea](https://purchase.groupdocs.com/temporary-license/) per valutare il prodotto. -### Quali formati di file sono supportati da GroupDocs.Editor per .NET? -GroupDocs.Editor supporta un'ampia gamma di formati, inclusi DOCX, XLSX, PPTX, PDF e molti altri. -### Come posso ottenere supporto per GroupDocs.Editor per .NET? - Puoi ottenere supporto visitando il[Forum di assistenza](https://forum.groupdocs.com/c/editor/20). -### Dove posso acquistare una licenza completa per GroupDocs.Editor per .NET? - È possibile acquistare una licenza completa da[pagina di acquisto](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**D: Cosa succede se la mia cartella di lavoro contiene fogli nascosti?** +R: I fogli nascosti sono trattati come qualsiasi altro foglio; puoi accedervi per indice e salvarli, ma potresti dover impostare `EditableDocument.IsVisible = true` prima di salvare se desideri che siano visibili nell'output. + +**D: Posso convertire direttamente una scheda Excel in PDF?** +R: Sì, specifica `SaveFormat.Pdf` quando chiami `Save` sul `EditableDocument`. La libreria preserva layout, immagini e grafici durante la conversione. + +**D: È possibile dividere una cartella di lavoro in file CSV invece di XLSX?** +R: Assolutamente. Usa `SaveFormat.Csv` per ogni `EditableDocument` per generare rappresentazioni CSV in testo semplice di ogni foglio. + +**D: GroupDocs.Editor supporta file Excel protetti da password?** +R: Sì. Fornisci la password tramite `LoadOptions.Password` quando crei l'istanza `Editor`. + +**D: Dove posso trovare più esempi di lavoro con i fogli di calcolo?** +R: La documentazione ufficiale e i progetti di esempio sulla [pagina di download](https://releases.groupdocs.com/editor/net/) contengono ulteriori casi d'uso. + +## Conclusione +Seguendo questi passaggi, puoi **salvare ogni scheda Excel** come documento indipendente, convertire le schede in PDF o dividere grandi cartelle di lavoro in parti gestibili — tutto con la affidabile e ad alte prestazioni libreria GroupDocs.Editor per .NET. Questa funzionalità semplifica le pipeline di reporting, automatizza l'estrazione dei dati e riduce la gestione manuale dei fogli di calcolo. + +--- + +**Ultimo aggiornamento:** 2026-06-06 +**Testato con:** GroupDocs.Editor 23.11 per .NET +**Autore:** GroupDocs + +--- + +## Tutorial correlati + +- [Estrazione avanzata delle schede di foglio di calcolo in .NET con GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Proteggi con password i file Excel usando GroupDocs.Editor per .NET \| Gestione sicura dei fogli di calcolo](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Padronanza del caricamento dei documenti in .NET con GroupDocs.Editor: Guida completa](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/japanese/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/japanese/net/document-processing/work-multi-tab-spreadsheets/_index.md index 0abb0385..bfb9bed2 100644 --- a/content/japanese/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/japanese/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,209 @@ --- -title: 複数タブのスプレッドシートを操作する -linktitle: 複数タブのスプレッドシートを操作する +date: 2026-06-06 +description: GroupDocs.Editor for .NET を使用して **各 Excel タブを保存** する方法を学びましょう – ステップバイステップ + ガイド、コードスニペット、XLSX ファイルを分割するベストプラクティスをご紹介します。 +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: マルチタブ スプレッドシートの操作 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: GroupDocs.Editor を使用して .NET でマルチタブ スプレッドシートを操作する方法を学びます。ステップ バイ ステップ ガイド、コード例、ベスト プラクティスが含まれています。 -weight: 17 -url: /ja/net/document-processing/work-multi-tab-spreadsheets/ +title: GroupDocs.Editor .NET を使用して各 Excel タブを保存する方法 type: docs +url: /ja/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# 複数タブのスプレッドシートを操作する -## 導入 -複数タブのスプレッドシートの処理は、特に同じドキュメント内の異なるシートからデータを操作または抽出する必要がある場合、非常に困難な作業になることがあります。.NET を使用していて、堅牢なソリューションを探している場合は、GroupDocs.Editor for .NET が最適です。このチュートリアルでは、GroupDocs.Editor for .NET を使用して複数タブのスプレッドシートを操作する手順を説明します。環境の設定から各タブを個別のファイルとして保存するまで、すべてをカバーします。 +# マルチタブスプレッドシートの操作 + +## はじめに +Excel の各タブを個別のファイルとして **save each Excel tab** する必要がある場合、GroupDocs.Editor for .NET が簡単に実現します。財務レポートの抽出、部門別ワークシートの生成、タブの PDF への変換など、環境設定からリソースの破棄まで、全体のワークフローを段階的に解説するので、マルチシートの処理を自信を持って自動化できます。 + +## クイック回答 +- **GroupDocs.Editor は XLSX を個別のファイルに分割できますか?** はい、ブックをロードして各シートを個別にエクスポートできます。 +- **各タブはどの形式で保存できますか?** XLSX、CSV、PDF、HTML など、30 以上の出力形式がサポートされています。 +- **この機能を使用するのにライセンスは必要ですか?** テストには一時ライセンスで動作しますが、本番環境ではフルライセンスが必要です。 +- **.NET Core はサポートされていますか?** はい、.NET Framework 4.0 以上および .NET Core/5/6+ でも動作します。 +- **一度に処理できるタブの数はどれくらいですか?** GroupDocs.Editor は、ファイル全体をメモリに読み込まずに、500 シート以上のブックを処理できます。 + +## “save each excel tab” とは何ですか? +**“Save each Excel tab”** は、マルチシートブックからすべてのワークシートを抽出し、各シートを個別のスタンドアロン文書(例:別々の XLSX または PDF ファイル)として書き出すことを意味します。この方法により、シートごとにファイルが得られるため、下流の処理、レポート作成、配布が簡素化され、共有、アーカイブ、または独立した変換が可能になります。 + +## このタスクに GroupDocs.Editor を使用する理由 +GroupDocs.Editor は **30 以上の入力および出力形式** をサポートし、**最大 1,000 シート** のスプレッドシートを、ファイル全体をロードせずにデータをストリーミングすることでメモリ使用量を抑えて処理できます。API はセルのスタイル、数式、埋め込み画像も保持し、エクスポートされた各タブが元のシートと同一に見えることを保証します。 + ## 前提条件 -チュートリアルに進む前に、次の前提条件が満たされていることを確認してください。 -1. Visual Studio: マシンに Visual Studio がインストールされていることを確認します。 -2. .NET Framework: GroupDocs.Editor for .NET は、.NET Framework 4.0 以降をサポートしています。 -3. GroupDocs.Editor for .NET: GroupDocs.Editor for .NETライブラリをダウンロードしてインストールします。[ダウンロードページ](https://releases.groupdocs.com/editor/net/). -4. ライセンス:[一時ライセンス](https://purchase.groupdocs.com/temporary-license/)ライブラリを試すには、実稼働環境での使用のためにフルライセンスを購入することをお勧めします。 +1. **Visual Studio** – 任意の最新エディション(Community、Professional、Enterprise)。 +2. **.NET Framework 4.0+** – またはクロスプラットフォームランタイムを希望する場合は .NET Core/5/6。 +3. **GroupDocs.Editor for .NET** – [download page](https://releases.groupdocs.com/editor/net/) からダウンロードしてください。 +4. **License** – テスト用には [temporary license](https://purchase.groupdocs.com/temporary-license/) で問題ありません。本番利用にはフルライセンスを購入してください。 +5. **Free trial** – ライブラリは [free trial](https://releases.groupdocs.com/) ページからも試せます。 +6. **Support** – 問題が発生した場合は [support forum](https://forum.groupdocs.com/c/editor/20) を訪れるか、フルライセンスのために [purchase page](https://purchase.groupdocs.com/buy) を検討してください。 + ## 名前空間のインポート -コーディングを始める前に、必要な名前空間をインポートする必要があります。.cs ファイルの先頭に次の using ディレクティブを追加します。 +コードを書く前に、必要な名前空間をインポートする必要があります。以下の using ディレクティブを `.cs` ファイルの先頭に追加してください。 + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. 入力ファイルへのパスを取得する -まず、入力スプレッドシート ファイルへのパスを指定する必要があります。このファイルは、複数のタブを持つ XLSX (OOXML) である必要があります。 + +## 各 Excel タブを別々のファイルとして保存する方法 +ブックをロードし、各シートごとに `EditableDocument` を作成し、目的の形式で `Save` を呼び出します。このプロセスは各タブを分離し、個別の出力パスを選択でき、リソースを自動的に解放します。以下に、各 API 呼び出しの説明とベストプラクティスのヒントを含む、ステップバイステップのワークフローを示します。 + +### 手順 1: 入力ファイルへのパスを取得 +まず、複数タブを含むソース XLSX のフルパスを指定します。 + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. スプレッドシートをエディターインスタンスに読み込む -次に、スプレッドシートを`Editor`インスタンス。これは、ファイル ストリームを使用し、スプレッドシートに適切な読み込みオプションを指定して実行されます。 + +### 手順 2: スプレッドシートを Editor インスタンスにロード +`Editor` クラスは GroupDocs.Editor のすべてのドキュメント操作のエントリーポイントです。ファイルストリームを読み取り、編集または抽出のためにドキュメントを準備します。 + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - //以降の手順はここを参照してください + // Further steps will go here } } ``` -## 3. 最初のタブから編集可能なドキュメントを作成する -特定のタブを編集または操作するには、`EditableDocument`そのタブのインスタンス。タブは 0 から始まるインデックスを使用して指定されます。 + +### 手順 3: 最初のタブから EditableDocument を作成 +`EditableDocument` はブック内の単一の編集可能なシートを表します。コンストラクタは `Editor` インスタンスと 0 ベースのシートインデックスを受け取ります。 + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; //最初のタブ +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. 2番目のタブから編集可能なドキュメントを作成する -同様に、`EditableDocument` 2番目のタブ。 + +### 手順 4: 2 番目のタブから EditableDocument を作成 +インデックス値を変更することで、追加のシートに対して同じパターンを繰り返すことができます。 + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // 2番目のタブ +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. 最初のタブを別のドキュメントに保存する -ここで、最初のタブを別のドキュメントとして保存します。保存形式と出力パスを指定します。 + +### 手順 5: 最初のタブを別々のドキュメントに保存 +`Save` は編集されたドキュメントを指定された形式のファイルに書き出します。`EditableDocument` インスタンスで呼び出し、出力パスと形式(例: `SaveFormat.Xlsx`)を指定します。 + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. 2番目のタブを別のドキュメントに保存する -番目のタブに対しても同じ手順を繰り返しますが、今回は別の形式で保存します。 + +### 手順 6: 2 番目のタブを別々のドキュメントに保存 +同じ `Save` 呼び出しが 2 番目のシートでも機能し、必要に応じて PDF など別の形式を選択できます。 + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. EditableDocumentインスタンスを破棄する -最後に、適切に処分するようにしてください。`EditableDocument`インスタンスを作成してリソースを解放します。 + +### 手順 7: EditableDocument インスタンスを破棄 +`Dispose` はドキュメントが保持するファイルハンドルなどのアンマネージドリソースを解放し、長時間稼働するサービスでのリークを防止します。 + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## 結論 -これらの手順に従うと、GroupDocs.Editor を使用して .NET でマルチタブ スプレッドシートを簡単に操作できます。この強力なライブラリにより、スプレッドシート内のさまざまなシートを編集および保存するプロセスが簡素化され、開発タスクの管理が容易になります。複雑なデータ操作でも単純な編集でも、GroupDocs.Editor for .NET は、作業を効率的に行うために必要なツールを提供します。 +## よくある問題と解決策 +- **“File is locked” errors** – すべての `EditableDocument` と `Editor` インスタンスで `Dispose()` を呼び出すか、`using` 文でラップしてください。 +- **Missing styles after export** – スタイルをサポートする形式(例: XLSX や PDF)で保存しているか確認してください。CSV は設計上フォーマットが失われます。 +- **Large workbooks cause slow performance** – メモリ使用量を抑えるためにストリーミングロードオプション(`LoadOptions.Streaming = true`)を使用してください。 + ## よくある質問 -### GroupDocs.Editor for .NET とは何ですか? -GroupDocs.Editor for .NET は、開発者が .NET アプリケーション内でさまざまな形式のドキュメントを読み込み、編集、保存できるようにする強力なドキュメント編集 API です。 -### 購入前に GroupDocs.Editor for .NET を試すことはできますか? -はい、[無料トライアル](https://releases.groupdocs.com/)またはリクエスト[一時ライセンス](https://purchase.groupdocs.com/temporary-license/)製品を評価するため。 -### GroupDocs.Editor for .NET ではどのようなファイル形式がサポートされていますか? -GroupDocs.Editor は、DOCX、XLSX、PPTX、PDF など、幅広い形式をサポートしています。 -### GroupDocs.Editor for .NET のサポートを受けるにはどうすればよいですか? -サポートを受けるには、[サポートフォーラム](https://forum.groupdocs.com/c/editor/20). -### GroupDocs.Editor for .NET のフル ライセンスはどこで購入できますか? -フルライセンスは以下から購入できます。[購入ページ](https://purchase.groupdocs.com/buy). \ No newline at end of file +**Q: ワークブックに非表示シートが含まれている場合はどうなりますか?** +A: 非表示シートは他のシートと同様に扱われます。インデックスでアクセスして保存できますが、出力で表示させたい場合は保存前に `EditableDocument.IsVisible = true` を設定する必要があります。 + +**Q: Excel タブを直接 PDF に変換できますか?** +A: はい、`EditableDocument` の `Save` 呼び出し時に `SaveFormat.Pdf` を指定します。ライブラリは変換中にレイアウト、画像、チャートを保持します。 + +**Q: ワークブックを XLSX ではなく CSV ファイルに分割できますか?** +A: もちろんです。各 `EditableDocument` に対して `SaveFormat.Csv` を使用すれば、各シートのプレーンテキスト CSV 表現が生成されます。 + +**Q: GroupDocs.Editor はパスワード保護された Excel ファイルをサポートしていますか?** +A: サポートしています。`Editor` インスタンス作成時に `LoadOptions.Password` でパスワードを指定してください。 + +**Q: スプレッドシートの操作例はどこで見つけられますか?** +A: 公式ドキュメントとサンプルプロジェクトは [download page](https://releases.groupdocs.com/editor/net/) にあり、追加のユースケースが掲載されています。 + +## 結論 +これらの手順に従うことで、**save each Excel tab** を独立したドキュメントとして保存したり、タブを PDF に変換したり、大規模なブックを扱いやすい単位に分割したりできます。すべて信頼性の高い高性能な GroupDocs.Editor for .NET ライブラリで実現します。この機能により、レポートパイプラインが効率化され、データ抽出が自動化され、手作業のスプレッドシート処理が削減されます。 + +--- + +**最終更新日:** 2026-06-06 +**テスト環境:** GroupDocs.Editor 23.11 for .NET +**作者:** GroupDocs + +--- + +## 関連チュートリアル + +- [GroupDocs.Editor を使用した .NET のスプレッドシートタブ抽出のマスター](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [GroupDocs.Editor for .NET を使用した Excel ファイルのパスワード保護 | 安全なスプレッドシート管理](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [GroupDocs.Editor を使用した .NET のドキュメントロードマスター: 包括的ガイド](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/korean/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/korean/net/document-processing/work-multi-tab-spreadsheets/_index.md index aec4feb5..754dfe74 100644 --- a/content/korean/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/korean/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,212 @@ --- -title: 다중 탭 스프레드시트 작업 +date: 2026-06-06 +description: GroupDocs.Editor for .NET를 사용하여 **각 Excel 탭을 저장하는 방법**을 배웁니다 – 단계별 가이드, + 코드 스니펫, 그리고 XLSX 파일 분할을 위한 모범 사례. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files linktitle: 다중 탭 스프레드시트 작업 +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: GroupDocs.Editor를 사용하여 .NET에서 다중 탭 스프레드시트로 작업하는 방법을 알아보세요. 단계별 가이드, 코드 예제, 모범 사례가 포함되어 있습니다. -weight: 17 -url: /ko/net/document-processing/work-multi-tab-spreadsheets/ +title: GroupDocs.Editor .NET를 사용하여 각 Excel 탭 저장하는 방법 type: docs +url: /ko/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- + # 다중 탭 스프레드시트 작업 ## 소개 -다중 탭 스프레드시트를 처리하는 것은 상당히 힘든 작업이 될 수 있습니다. 특히 동일한 문서 내의 여러 시트에서 데이터를 조작하거나 추출해야 하는 경우에는 더욱 그렇습니다. .NET으로 작업하면서 강력한 솔루션을 찾고 있다면 .NET용 GroupDocs.Editor가 탁월한 선택입니다. 이 튜토리얼에서는 .NET용 GroupDocs.Editor를 사용하여 다중 탭 스프레드시트로 작업하는 과정을 안내합니다. 환경 설정부터 각 탭을 별도의 파일로 저장하는 것까지 모든 것을 다룹니다. -## 전제조건 -튜토리얼을 시작하기 전에 다음 전제 조건이 충족되었는지 확인하세요. -1. Visual Studio: 컴퓨터에 Visual Studio가 설치되어 있는지 확인하세요. -2. .NET Framework: .NET용 GroupDocs.Editor는 .NET Framework 4.0 이상을 지원합니다. -3. .NET용 GroupDocs.Editor: .NET용 GroupDocs.Editor 라이브러리를 다운로드하고 설치합니다. 에서 받으실 수 있습니다.[다운로드 페이지](https://releases.groupdocs.com/editor/net/). -4. 라이센스: 당신이 사용할 수 있는 동안[임시면허](https://purchase.groupdocs.com/temporary-license/) 라이브러리를 시험해 보려면 프로덕션용 정식 라이센스를 구입하는 것이 좋습니다. +각 Excel 탭을 독립 파일로 **저장**해야 한다면, .NET용 GroupDocs.Editor가 손쉽게 처리합니다. 재무 보고서를 추출하거나 부서별 워크시트를 생성하거나 탭을 PDF로 변환하는 경우에도, 이 튜토리얼은 환경 설정부터 리소스 해제까지 전체 워크플로우를 단계별로 안내하여 다중 시트 처리를 자신 있게 자동화할 수 있도록 도와줍니다. + +## 빠른 답변 +- **GroupDocs.Editor가 XLSX를 개별 파일로 분할할 수 있나요?** 예, 워크북을 로드하고 각 시트를 개별적으로 내보낼 수 있습니다. +- **각 탭을 어떤 형식으로 저장할 수 있나요?** XLSX, CSV, PDF, HTML 등 – 30개 이상의 출력 형식을 지원합니다. +- **이 기능에 라이선스가 필요합니까?** 테스트용 임시 라이선스로도 동작하지만, 프로덕션에서는 정식 라이선스가 필요합니다. +- **.NET Core를 지원하나요?** 물론입니다 – 라이브러리는 .NET Framework 4.0 이상 및 .NET Core/5/6+와 호환됩니다. +- **한 번에 처리할 수 있는 탭 수는 얼마인가요?** GroupDocs.Editor는 전체 파일을 메모리에 로드하지 않고도 500개 이상의 시트를 가진 워크북을 처리할 수 있습니다. + +## “각 Excel 탭 저장”이란 무엇인가요? +**“Save each Excel tab”**은 다중 시트 워크북에서 모든 워크시트를 추출하여 각각을 독립적인 문서(예: 별도의 XLSX 또는 PDF 파일)로 저장하는 것을 의미합니다. 이 방법은 시트당 하나의 파일을 제공함으로써 후속 처리, 보고 및 배포를 단순화하고, 해당 파일을 개별적으로 공유, 보관 또는 추가 변환할 수 있게 합니다. + +## 이 작업에 GroupDocs.Editor를 사용하는 이유 +GroupDocs.Editor는 **30개 이상의 입력 및 출력 형식**을 지원하며, **최대 1,000개의 시트**가 있는 스프레드시트를 전체 파일을 로드하지 않고 스트리밍 방식으로 데이터를 처리하여 메모리 사용량을 최소화합니다. API는 셀 스타일, 수식 및 삽입된 이미지를 그대로 보존하여 각 내보낸 탭이 원본과 동일하게 보이도록 합니다. + +## 전제 조건 +시작하기 전에 다음이 준비되어 있는지 확인하십시오: + +1. **Visual Studio** – 최신 버전(Community, Professional, Enterprise) 중 하나. +2. **.NET Framework 4.0+** – 또는 크로스 플랫폼 런타임을 선호한다면 .NET Core/5/6. +3. **GroupDocs.Editor for .NET** – [download page](https://releases.groupdocs.com/editor/net/)에서 다운로드하십시오. +4. **License** – 테스트용으로는 [temporary license](https://purchase.groupdocs.com/temporary-license/)가 충분하지만, 프로덕션 사용을 위해서는 정식 라이선스를 구매해야 합니다. +5. **Free trial** – [free trial](https://releases.groupdocs.com/) 페이지를 통해 라이브러리를 체험할 수 있습니다. +6. **Support** – 문제가 발생하면 [support forum](https://forum.groupdocs.com/c/editor/20)을 방문하거나 정식 라이선스를 위한 [purchase page](https://purchase.groupdocs.com/buy)를 참고하십시오. + ## 네임스페이스 가져오기 -코딩을 시작하기 전에 필요한 네임스페이스를 가져와야 합니다. .cs 파일 상단에 다음 using 지시문을 추가합니다. +코딩을 시작하기 전에 필요한 네임스페이스를 가져와야 합니다. 다음 using 지시문을 `.cs` 파일 상단에 추가하십시오: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. 입력 파일의 경로 얻기 -먼저 입력 스프레드시트 파일의 경로를 지정해야 합니다. 이 파일은 여러 탭이 있는 XLSX(OOXML)여야 합니다. + +## 각 Excel 탭을 별도 파일로 저장하는 방법 +워크북을 로드하고 각 시트에 대해 `EditableDocument`를 생성한 뒤 원하는 형식으로 `Save`를 호출합니다. 이 과정은 각 탭을 분리하고, 별도의 출력 경로를 선택하게 하며, 리소스를 자동으로 해제합니다. 아래는 따라야 할 단계별 워크플로우이며, 각 API 호출에 대한 설명과 일반적인 함정을 피하기 위한 모범 사례 팁을 제공합니다. + +### 단계 1: 입력 파일 경로 가져오기 +먼저, 여러 탭이 포함된 원본 XLSX 파일의 전체 경로를 지정합니다. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. 스프레드시트를 에디터 인스턴스에 로드 - 다음으로 스프레드시트를`Editor` 사례. 이는 파일 스트림을 사용하고 스프레드시트에 대한 적절한 로드 옵션을 지정하여 수행됩니다. + +### 단계 2: 스프레드시트를 Editor 인스턴스로 로드하기 +`Editor` 클래스는 GroupDocs.Editor에서 모든 문서 작업의 진입점입니다. 파일 스트림을 읽어 문서를 편집 또는 추출할 준비를 합니다. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // 추가 단계는 여기에서 진행됩니다. + // Further steps will go here } } ``` -## 3. 첫 번째 탭에서 편집 가능한 문서 만들기 - 특정 탭을 편집하거나 조작하려면`EditableDocument` 해당 탭의 인스턴스입니다. 탭은 0 기반 인덱스를 사용하여 지정됩니다. + +### 단계 3: 첫 번째 탭에서 EditableDocument 생성 +`EditableDocument`는 워크북 내 단일 편집 가능한 시트를 나타냅니다. 생성자는 `Editor` 인스턴스와 0부터 시작하는 시트 인덱스를 받습니다. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // 첫 번째 탭 +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. 두 번째 탭에서 편집 가능한 문서 만들기 - 마찬가지로`EditableDocument` 두 번째 탭의 경우 + +### 단계 4: 두 번째 탭에서 EditableDocument 생성 +인덱스 값을 변경하여 추가 시트에 대해 동일한 패턴을 반복할 수 있습니다. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // 두 번째 탭 +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. 첫 번째 탭을 별도의 문서에 저장 -이제 첫 번째 탭을 별도의 문서로 저장하세요. 저장 형식과 출력 경로를 지정합니다. + +### 단계 5: 첫 번째 탭을 별도 문서로 저장 +`Save`는 편집된 문서를 지정된 형식의 파일로 기록합니다. `EditableDocument` 인스턴스에서 호출하고 출력 경로와 형식(예: `SaveFormat.Xlsx`)을 제공하십시오. + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. 두 번째 탭을 별도의 문서에 저장 -두 번째 탭에 대해서도 과정을 반복하되, 이번에는 다른 형식으로 저장하세요. + +### 단계 6: 두 번째 탭을 별도 문서로 저장 +두 번째 시트에도 동일한 `Save` 호출이 작동하며, 필요에 따라 PDF와 같은 다른 형식을 선택할 수 있습니다. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. EditableDocument 인스턴스 폐기 - 마지막으로, 해당 제품을 올바르게 폐기했는지 확인하십시오.`EditableDocument` 인스턴스를 사용하여 리소스를 확보합니다. + +### 단계 7: EditableDocument 인스턴스 해제 +`Dispose`는 파일 핸들 등 문서가 보유한 비관리 리소스를 해제하여 장기 실행 서비스에서 누수가 발생하지 않도록 합니다. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## 일반적인 문제 및 해결책 +- **“File is locked” 오류** – 모든 `EditableDocument`와 `Editor` 인스턴스에 대해 `Dispose()`를 호출하거나 `using` 문으로 감싸십시오. +- **내보낸 후 스타일 누락** – 스타일을 지원하는 형식(e.g., XLSX 또는 PDF)으로 저장했는지 확인하십시오. CSV는 설계상 서식이 손실됩니다. +- **대용량 워크북으로 성능 저하** – 메모리 사용량을 낮추기 위해 스트리밍 로드 옵션(`LoadOptions.Streaming = true`)을 사용하십시오. + +## 자주 묻는 질문 + +**Q: 워크북에 숨겨진 시트가 포함되어 있으면 어떻게 되나요?** +A: 숨겨진 시트도 다른 시트와 동일하게 취급됩니다; 인덱스로 접근하여 저장할 수 있지만, 출력에서 보이게 하려면 저장 전에 `EditableDocument.IsVisible = true`로 설정해야 할 수 있습니다. + +**Q: Excel 탭을 직접 PDF로 변환할 수 있나요?** +A: 예, `EditableDocument`에서 `Save`를 호출할 때 `SaveFormat.Pdf`를 지정하면 됩니다. 라이브러리는 변환 과정에서 레이아웃, 이미지 및 차트를 보존합니다. + +**Q: 워크북을 XLSX 대신 CSV 파일로 분할할 수 있나요?** +A: 물론입니다. 각 `EditableDocument`에 대해 `SaveFormat.Csv`를 사용하면 각 시트의 텍스트 기반 CSV 표현을 생성할 수 있습니다. + +**Q: GroupDocs.Editor가 암호로 보호된 Excel 파일을 지원하나요?** +A: 지원합니다. `Editor` 인스턴스를 생성할 때 `LoadOptions.Password`에 비밀번호를 제공하면 됩니다. + +**Q: 스프레드시트 작업에 대한 추가 예제를 어디서 찾을 수 있나요?** +A: 공식 문서와 샘플 프로젝트는 [download page](https://releases.groupdocs.com/editor/net/)에 있으며, 추가 사용 사례를 포함하고 있습니다. + ## 결론 -다음 단계를 따르면 GroupDocs.Editor를 사용하여 .NET에서 다중 탭 스프레드시트로 쉽게 작업할 수 있습니다. 이 강력한 라이브러리는 스프레드시트 내의 다양한 시트를 편집하고 저장하는 과정을 단순화하여 개발 작업을 보다 쉽게 관리할 수 있도록 해줍니다. 복잡한 데이터 조작을 처리하든 간단한 편집을 처리하든 .NET용 GroupDocs.Editor는 작업을 효율적으로 완료하는 데 필요한 도구를 제공합니다. -## FAQ -### .NET용 GroupDocs.Editor란 무엇입니까? -.NET용 GroupDocs.Editor는 개발자가 .NET 응용 프로그램 내에서 다양한 형식의 문서를 로드, 편집 및 저장할 수 있는 강력한 문서 편집 API입니다. -### 구매하기 전에 .NET용 GroupDocs.Editor를 사용해 볼 수 있나요? - 예, 다음을 사용할 수 있습니다.[무료 시험판](https://releases.groupdocs.com/) 또는 요청[임시면허](https://purchase.groupdocs.com/temporary-license/) 제품을 평가합니다. -### .NET용 GroupDocs.Editor는 어떤 파일 형식을 지원합니까? -GroupDocs.Editor는 DOCX, XLSX, PPTX, PDF 등을 포함한 광범위한 형식을 지원합니다. -### .NET용 GroupDocs.Editor에 대한 지원을 받으려면 어떻게 해야 합니까? - 방문하시면 지원을 받으실 수 있습니다.[지원 포럼](https://forum.groupdocs.com/c/editor/20). -### .NET용 GroupDocs.Editor의 정식 라이센스는 어디서 구입할 수 있나요? - 다음에서 정식 라이센스를 구입할 수 있습니다.[구매 페이지](https://purchase.groupdocs.com/buy). \ No newline at end of file +이 단계들을 따르면 **각 Excel 탭**을 독립 문서로 저장하고, 탭을 PDF로 변환하거나 대용량 워크북을 관리하기 쉬운 조각으로 분할할 수 있습니다—모두 신뢰할 수 있는 고성능 .NET용 GroupDocs.Editor 라이브러리를 사용합니다. 이 기능은 보고 파이프라인을 간소화하고, 데이터 추출을 자동화하며, 수동 스프레드시트 처리를 감소시킵니다. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## 관련 튜토리얼 + +- [GroupDocs.Editor를 사용한 .NET 스프레드시트 탭 추출 마스터](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [GroupDocs.Editor for .NET을 사용한 Excel 파일 암호 보호 | 안전한 스프레드시트 관리](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [GroupDocs.Editor와 함께 .NET에서 문서 로딩 마스터하기: 종합 가이드](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/polish/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/polish/net/document-processing/work-multi-tab-spreadsheets/_index.md index 50df375f..ca410da1 100644 --- a/content/polish/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/polish/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,209 @@ --- -title: Pracuj z arkuszami kalkulacyjnymi z wieloma zakładkami -linktitle: Pracuj z arkuszami kalkulacyjnymi z wieloma zakładkami -second_title: Edytor GroupDocs.NET API -description: Dowiedz się, jak pracować z arkuszami kalkulacyjnymi z wieloma zakładkami w platformie .NET przy użyciu programu GroupDocs.Editor. Zawiera przewodnik krok po kroku, przykłady kodu i najlepsze praktyki. -weight: 17 -url: /pl/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: Dowiedz się, jak **zapisać każdą kartę Excela** przy użyciu GroupDocs.Editor + dla .NET – przewodnik krok po kroku, fragmenty kodu i najlepsze praktyki dotyczące + dzielenia plików XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Praca z arkuszami wielokartkowymi +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Jak zapisać każdą kartę Excela przy użyciu GroupDocs.Editor .NET type: docs +url: /pl/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Pracuj z arkuszami kalkulacyjnymi z wieloma zakładkami - -## Wstęp -Obsługa arkuszy kalkulacyjnych z wieloma zakładkami może być nie lada zadaniem, zwłaszcza gdy trzeba manipulować danymi lub wyodrębniać je z różnych arkuszy w tym samym dokumencie. Jeśli pracujesz z .NET i szukasz solidnego rozwiązania, GroupDocs.Editor dla .NET będzie doskonałym wyborem. W tym samouczku przeprowadzimy Cię przez proces pracy z arkuszami kalkulacyjnymi z wieloma zakładkami przy użyciu programu GroupDocs.Editor dla platformy .NET. Omówimy wszystko, od skonfigurowania środowiska po zapisanie każdej karty jako osobnego pliku. -## Warunki wstępne -Zanim przejdziesz do samouczka, upewnij się, że spełniasz następujące wymagania wstępne: -1. Visual Studio: Upewnij się, że na komputerze jest zainstalowany program Visual Studio. -2. .NET Framework: GroupDocs.Editor dla .NET obsługuje .NET Framework 4.0 lub nowszy. -3. GroupDocs.Editor dla .NET: Pobierz i zainstaluj bibliotekę GroupDocs.Editor dla .NET. Można go zdobyć z[strona pobierania](https://releases.groupdocs.com/editor/net/). -4. Licencja: Chociaż możesz używać pliku[licencja tymczasowa](https://purchase.groupdocs.com/temporary-license/) aby wypróbować bibliotekę, zaleca się zakup pełnej licencji do użytku produkcyjnego. -## Importuj przestrzenie nazw -Zanim zaczniemy kodować, musisz zaimportować niezbędne przestrzenie nazw. Dodaj następujące dyrektywy using na górze pliku .cs: + +# Praca z arkuszami wielostronicowymi + +## Wprowadzenie +Jeśli potrzebujesz **save each Excel tab** jako niezależny plik, GroupDocs.Editor for .NET ułatwia to zadanie. Niezależnie od tego, czy wyodrębniasz raporty finansowe, generujesz arkusze per‑dział lub konwertujesz zakładki na PDF, ten samouczek przeprowadzi Cię przez cały proces — od konfiguracji środowiska po zwalnianie zasobów — abyś mógł automatyzować obsługę wielu arkuszy z pewnością. + +## Szybkie odpowiedzi +- **Czy GroupDocs.Editor może podzielić plik XLSX na osobne pliki?** Tak, możesz załadować skoroszyt i wyeksportować każdy arkusz osobno. +- **W jakich formatach można zapisać każdą zakładkę?** XLSX, CSV, PDF, HTML i inne — obsługiwanych jest ponad 30 formatów wyjściowych. +- **Czy potrzebna jest licencja do tej funkcji?** Licencja tymczasowa wystarczy do testów; pełna licencja jest wymagana w środowisku produkcyjnym. +- **Czy .NET Core jest obsługiwany?** Zdecydowanie — biblioteka działa z .NET Framework 4.0+ oraz .NET Core/5/6+. +- **Ile zakładek można przetworzyć jednocześnie?** GroupDocs.Editor może obsłużyć skoroszyty z ponad 500 arkuszami bez ładowania całego pliku do pamięci. + +## Co oznacza „save each excel tab”? +**“Save each Excel tab”** oznacza wyodrębnienie każdego arkusza z wielostronicowego skoroszytu i zapisanie go jako osobny dokument (np. oddzielne pliki XLSX lub PDF). Takie podejście upraszcza dalsze przetwarzanie, raportowanie i dystrybucję, dając plik na każdy arkusz, który można następnie udostępniać, archiwizować lub dalej przetwarzać niezależnie. + +## Dlaczego warto używać GroupDocs.Editor do tego zadania? +GroupDocs.Editor obsługuje **30+ formatów wejściowych i wyjściowych** i może przetwarzać arkusze kalkulacyjne z **do 1 000 arkuszami**, jednocześnie utrzymując niskie zużycie pamięci dzięki strumieniowaniu danych zamiast ładowania całego pliku. API zachowuje także style komórek, formuły i osadzone obrazy, zapewniając, że każdy wyeksportowany arkusz wygląda identycznie jak oryginał. + +## Wymagania wstępne +1. **Visual Studio** — dowolna aktualna edycja (Community, Professional lub Enterprise). +2. **.NET Framework 4.0+** — lub .NET Core/5/6, jeśli wolisz środowisko wieloplatformowe. +3. **GroupDocs.Editor for .NET** — pobierz go ze [strony pobierania](https://releases.groupdocs.com/editor/net/). +4. **Licencja** — [licencja tymczasowa](https://purchase.groupdocs.com/temporary-license/) wystarczy do testów; zakup pełną licencję do użytku produkcyjnego. +5. **Bezpłatna wersja próbna** — możesz także wypróbować bibliotekę na stronie [bezpłatnej wersji próbnej](https://releases.groupdocs.com/). +6. **Wsparcie** — jeśli napotkasz problemy, odwiedź [forum wsparcia](https://forum.groupdocs.com/c/editor/20) lub rozważ [stronę zakupu](https://purchase.groupdocs.com/buy) w celu uzyskania pełnej licencji. + +## Importowanie przestrzeni nazw +Zanim zaczniemy kodować, musisz zaimportować niezbędne przestrzenie nazw. Dodaj następujące dyrektywy using na początku swojego pliku `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Uzyskaj ścieżkę do pliku wejściowego -Najpierw musisz określić ścieżkę do wejściowego pliku arkusza kalkulacyjnego. Ten plik powinien mieć format XLSX (OOXML) z wieloma zakładkami. + +## Jak zapisać każdą zakładkę Excela jako osobny plik? +Załaduj skoroszyt, utwórz `EditableDocument` dla każdego arkusza i wywołaj `Save` z żądanym formatem. Ten proces izoluje każdą zakładkę, pozwala wybrać odrębny ścieżkę wyjściową i automatycznie zwalnia zasoby. Poniżej znajduje się krok po kroku przepływ pracy, wraz z wyjaśnieniami każdego wywołania API oraz wskazówkami najlepszych praktyk, aby uniknąć typowych problemów. + +### Krok 1: Uzyskaj ścieżkę do pliku wejściowego +Najpierw podaj pełną ścieżkę do źródłowego pliku XLSX, który zawiera wiele zakładek. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Załaduj arkusz kalkulacyjny do instancji edytora - Następnie załadujesz arkusz kalkulacyjny do pliku`Editor` instancja. Odbywa się to za pomocą strumienia plików i określenia odpowiednich opcji ładowania arkusza kalkulacyjnego. + +### Krok 2: Załaduj arkusz kalkulacyjny do instancji Editor +Klasa `Editor` jest punktem wejścia dla wszystkich operacji na dokumentach w GroupDocs.Editor. Odczytuje strumień pliku i przygotowuje dokument do edycji lub wyodrębniania. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Dalsze kroki zostaną przeprowadzone tutaj + // Further steps will go here } } ``` -## 3. Utwórz dokument edytowalny na pierwszej karcie - Aby edytować lub manipulować określoną zakładką, musisz utworzyć plik`EditableDocument` instancja dla tej karty. Karta jest określana przy użyciu indeksu opartego na 0. + +### Krok 3: Utwórz EditableDocument z pierwszej zakładki +`EditableDocument` reprezentuje pojedynczy, edytowalny arkusz w skoroszycie. Konstruktor przyjmuje instancję `Editor` oraz indeks arkusza zaczynający się od zera. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Pierwsza zakładka +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Utwórz dokument edytowalny na drugiej karcie - Podobnie utwórz plik`EditableDocument` dla drugiej zakładki. + +### Krok 4: Utwórz EditableDocument z drugiej zakładki +Możesz powtórzyć ten sam schemat dla dowolnego dodatkowego arkusza, zmieniając wartość indeksu. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Druga zakładka +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Zapisz pierwszą kartę w osobnym dokumencie -Teraz zapisz pierwszą kartę jako osobny dokument. Określ format zapisu i ścieżkę wyjściową. + +### Krok 5: Zapisz pierwszą zakładkę jako osobny dokument +`Save` zapisuje edytowany dokument do pliku w określonym formacie. Wywołaj go na instancji `EditableDocument`, podając ścieżkę wyjściową i format (np. `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Zapisz drugą kartę w osobnym dokumencie -Powtórz proces dla drugiej karty, ale tym razem zapisz ją w innym formacie. + +### Krok 6: Zapisz drugą zakładkę jako osobny dokument +To samo wywołanie `Save` działa dla drugiego arkusza, a w razie potrzeby możesz wybrać inny format, np. PDF. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Pozbądź się instancji EditableDocument - Na koniec upewnij się, że prawidłowo zutylizujesz`EditableDocument` instancje, aby zwolnić zasoby. + +### Krok 7: Zniszcz (Dispose) instancje EditableDocument +`Dispose` zwalnia niezarządzane zasoby trzymane przez dokument, takie jak uchwyty plików, zapewniając brak wycieków w długotrwałych usługach. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Wniosek -Wykonując poniższe kroki, możesz z łatwością pracować z arkuszami kalkulacyjnymi z wieloma zakładkami w platformie .NET przy użyciu narzędzia GroupDocs.Editor. Ta potężna biblioteka upraszcza proces edytowania i zapisywania różnych arkuszy w arkuszu kalkulacyjnym, ułatwiając zarządzanie zadaniami programistycznymi. Niezależnie od tego, czy masz do czynienia ze złożoną manipulacją danymi, czy z prostą edycją, GroupDocs.Editor dla .NET zapewnia narzędzia potrzebne do wydajnej pracy. -## Często zadawane pytania -### Co to jest GroupDocs.Editor dla .NET? -GroupDocs.Editor dla .NET to potężny interfejs API do edycji dokumentów, który umożliwia programistom ładowanie, edytowanie i zapisywanie dokumentów w różnych formatach w aplikacjach .NET. -### Czy przed zakupem mogę wypróbować GroupDocs.Editor dla .NET? - Tak, możesz użyć tzw[bezpłatna wersja próbna](https://releases.groupdocs.com/) lub poproś o[licencja tymczasowa](https://purchase.groupdocs.com/temporary-license/) aby ocenić produkt. -### Jakie formaty plików są obsługiwane przez GroupDocs.Editor dla .NET? -GroupDocs.Editor obsługuje szeroką gamę formatów, w tym DOCX, XLSX, PPTX, PDF i wiele innych. -### Jak uzyskać pomoc dotyczącą programu GroupDocs.Editor dla platformy .NET? - Możesz uzyskać wsparcie, odwiedzając stronę[forum wsparcia](https://forum.groupdocs.com/c/editor/20). -### Gdzie mogę kupić pełną licencję na GroupDocs.Editor dla .NET? - Pełną licencję można kupić w witrynie[strona zakupu](https://purchase.groupdocs.com/buy). \ No newline at end of file +## Typowe problemy i rozwiązania +- **“File is locked” errors** – Upewnij się, że wywołujesz `Dispose()` na każdym `EditableDocument` i na instancji `Editor`, lub otocz je instrukcjami `using`. +- **Missing styles after export** – Sprawdź, czy zapisujesz do formatu obsługującego style (np. XLSX lub PDF). CSV z definicji traci formatowanie. +- **Large workbooks cause slow performance** – Użyj opcji ładowania strumieniowego (`LoadOptions.Streaming = true`), aby utrzymać niskie zużycie pamięci. + +## Najczęściej zadawane pytania + +**Q: Co jeśli mój skoroszyt zawiera ukryte arkusze?** +A: Ukryte arkusze są traktowane jak każdy inny arkusz; możesz uzyskać do nich dostęp przez indeks i zapisać je, ale przed zapisem może być konieczne ustawienie `EditableDocument.IsVisible = true`, jeśli chcesz, aby były widoczne w wyniku. + +**Q: Czy mogę bezpośrednio przekonwertować zakładkę Excela na PDF?** +A: Tak, określ `SaveFormat.Pdf` przy wywoływaniu `Save` na `EditableDocument`. Biblioteka zachowuje układ, obrazy i wykresy podczas konwersji. + +**Q: Czy można podzielić skoroszyt na pliki CSV zamiast XLSX?** +A: Oczywiście. Użyj `SaveFormat.Csv` dla każdego `EditableDocument`, aby wygenerować tekstowe reprezentacje CSV każdego arkusza. + +**Q: Czy GroupDocs.Editor obsługuje pliki Excel chronione hasłem?** +A: Tak. Podaj hasło za pomocą `LoadOptions.Password` przy tworzeniu instancji `Editor`. + +**Q: Gdzie mogę znaleźć więcej przykładów pracy z arkuszami kalkulacyjnymi?** +A: Oficjalna dokumentacja i przykładowe projekty na [stronie pobierania](https://releases.groupdocs.com/editor/net/) zawierają dodatkowe przypadki użycia. + +## Podsumowanie +Postępując zgodnie z tymi krokami, możesz **save each Excel tab** jako niezależny dokument, konwertować zakładki na PDF lub podzielić duże skoroszyty na łatwe do zarządzania części — wszystko przy użyciu niezawodnej, wysokowydajnej biblioteki GroupDocs.Editor for .NET. Ta funkcjonalność usprawnia przepływy raportowania, automatyzuje ekstrakcję danych i redukuje ręczną obsługę arkuszy kalkulacyjnych. + +--- + +**Ostatnia aktualizacja:** 2026-06-06 +**Testowano z:** GroupDocs.Editor 23.11 for .NET +**Autor:** GroupDocs + +## Powiązane samouczki + +- [Mistrzowskie wyodrębnianie zakładek arkusza w .NET z GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Zabezpiecz hasłem pliki Excel przy użyciu GroupDocs.Editor for .NET \| Bezpieczne zarządzanie arkuszami](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Mistrzostwo ładowania dokumentów w .NET z GroupDocs.Editor: Kompletny przewodnik](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/portuguese/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/portuguese/net/document-processing/work-multi-tab-spreadsheets/_index.md index a624c23d..1bff0125 100644 --- a/content/portuguese/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/portuguese/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,212 @@ --- -title: Trabalhe com planilhas com várias guias -linktitle: Trabalhe com planilhas com várias guias -second_title: API GroupDocs.Editor .NET -description: Aprenda como trabalhar com planilhas com várias guias no .NET usando GroupDocs.Editor. Guia passo a passo, exemplos de código e práticas recomendadas incluídas. -weight: 17 -url: /pt/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: Aprenda a **salvar cada aba do Excel** usando GroupDocs.Editor para .NET + – guia passo a passo, trechos de código e boas práticas para dividir arquivos XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Trabalhar com Planilhas de Múltiplas Abas +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Como salvar cada aba do Excel com GroupDocs.Editor .NET type: docs +url: /pt/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Trabalhe com planilhas com várias guias + +# Trabalhar com Planilhas de Múltiplas Guias ## Introdução -Lidar com planilhas com várias guias pode ser uma tarefa e tanto, especialmente quando você precisa manipular ou extrair dados de planilhas diferentes no mesmo documento. Se você trabalha com .NET e procura uma solução robusta, GroupDocs.Editor for .NET é uma excelente escolha. Neste tutorial, orientaremos você no processo de trabalho com planilhas com várias guias usando GroupDocs.Editor for .NET. Abordaremos tudo, desde a configuração do seu ambiente até salvar cada guia como um arquivo separado. +Se você precisa **salvar cada guia do Excel** como um arquivo independente, o GroupDocs.Editor para .NET torna isso simples. Seja extraindo relatórios financeiros, gerando planilhas por departamento ou convertendo guias para PDF, este tutorial orienta você por todo o fluxo de trabalho — desde a configuração do ambiente até a liberação de recursos — para que possa automatizar o manuseio de múltiplas planilhas com confiança. + +## Respostas Rápidas +- **O GroupDocs.Editor pode dividir um XLSX em arquivos separados?** Sim, você pode carregar a pasta de trabalho e exportar cada planilha individualmente. +- **Em quais formatos cada guia pode ser salva?** XLSX, CSV, PDF, HTML e mais – mais de 30 formatos de saída são suportados. +- **Preciso de uma licença para este recurso?** Uma licença temporária funciona para testes; uma licença completa é necessária para produção. +- **O .NET Core é suportado?** Absolutamente – a biblioteca funciona com .NET Framework 4.0+ e .NET Core/5/6+. +- **Quantas guias podem ser processadas de uma vez?** O GroupDocs.Editor pode lidar com pastas de trabalho com mais de 500 planilhas sem carregar o arquivo inteiro na memória. + +## O que é “salvar cada guia do Excel”? +**“Salvar cada guia do Excel”** significa extrair cada planilha de uma pasta de trabalho com múltiplas guias e gravar cada uma em seu próprio documento independente (por exemplo, arquivos XLSX ou PDF separados). Essa abordagem simplifica o processamento posterior, a geração de relatórios e a distribuição ao fornecer um arquivo por planilha, que pode então ser compartilhado, arquivado ou transformado independentemente. + +## Por que usar o GroupDocs.Editor para esta tarefa? +O GroupDocs.Editor suporta **mais de 30 formatos de entrada e saída** e pode processar planilhas com **até 1.000 guias** mantendo o uso de memória baixo ao transmitir os dados em vez de carregar o arquivo inteiro. A API também preserva estilos de célula, fórmulas e imagens incorporadas, garantindo que cada guia exportada tenha a mesma aparência do original. + ## Pré-requisitos -Antes de mergulhar no tutorial, certifique-se de ter os seguintes pré-requisitos em vigor: -1. Visual Studio: certifique-se de ter o Visual Studio instalado em sua máquina. -2. .NET Framework: GroupDocs.Editor for .NET oferece suporte a .NET Framework 4.0 ou superior. -3. GroupDocs.Editor for .NET: Baixe e instale a biblioteca GroupDocs.Editor for .NET. Você pode obtê-lo no[página de download](https://releases.groupdocs.com/editor/net/). -4. Licença: Embora você possa usar um[licença temporária](https://purchase.groupdocs.com/temporary-license/) para experimentar a biblioteca, é recomendável adquirir uma licença completa para uso em produção. -## Importar namespaces -Antes de começarmos a codificar, você precisa importar os namespaces necessários. Adicione as seguintes diretivas using ao topo do seu arquivo .cs: +Antes de mergulhar, verifique se você tem: + +1. **Visual Studio** – qualquer edição recente (Community, Professional ou Enterprise). +2. **.NET Framework 4.0+** – ou .NET Core/5/6 se você preferir o runtime multiplataforma. +3. **GroupDocs.Editor for .NET** – faça o download na [página de download](https://releases.groupdocs.com/editor/net/). +4. **Licença** – uma [licença temporária](https://purchase.groupdocs.com/temporary-license/) serve para testes; adquira uma licença completa para uso em produção. +5. **Teste gratuito** – você também pode experimentar a biblioteca através da página de [teste gratuito](https://releases.groupdocs.com/). +6. **Suporte** – se encontrar problemas, visite o [fórum de suporte](https://forum.groupdocs.com/c/editor/20) ou considere a [página de compra](https://purchase.groupdocs.com/buy) para obter uma licença completa. + +## Importar Namespaces +Antes de começarmos a programar, você precisa importar os namespaces necessários. Adicione as seguintes diretivas using ao início do seu arquivo `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Obtenha um caminho para o arquivo de entrada -Primeiro, você precisa especificar o caminho para o arquivo da planilha de entrada. Este arquivo deve ser um XLSX (OOXML) com múltiplas abas. + +## Como salvar cada guia do Excel como um arquivo separado? +Carregue a pasta de trabalho, crie um `EditableDocument` para cada planilha e chame `Save` com o formato desejado. Esse processo isola cada guia, permite que você escolha um caminho de saída distinto e libera recursos automaticamente. Abaixo está o fluxo de trabalho passo a passo que você seguirá, com explicações para cada chamada de API e dicas de boas práticas para evitar armadilhas comuns. + +### Etapa 1: Obter um caminho para o arquivo de entrada +Primeiro, especifique o caminho completo para o XLSX de origem que contém várias guias. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Carregue a planilha na instância do editor - A seguir, você carregará a planilha em um`Editor` instância. Isso é feito usando um fluxo de arquivos e especificando as opções de carregamento apropriadas para uma planilha. + +### Etapa 2: Carregar a planilha na instância do Editor +A classe `Editor` é o ponto de entrada para todas as operações de documento no GroupDocs.Editor. Ela lê o fluxo de arquivo e prepara o documento para edição ou extração. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Outras etapas irão aqui + // Further steps will go here } } ``` -## 3. Crie um EditableDocument na primeira guia - Para editar ou manipular uma aba específica, você precisa criar um`EditableDocument` instância para essa guia. A guia é especificada usando um índice baseado em 0. + +### Etapa 3: Criar um EditableDocument a partir da primeira guia +`EditableDocument` representa uma única planilha editável dentro da pasta de trabalho. O construtor recebe a instância `Editor` e um índice de planilha baseado em zero. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Primeira guia +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Crie um EditableDocument na segunda guia - Da mesma forma, crie um`EditableDocument` para a segunda guia. + +### Etapa 4: Criar um EditableDocument a partir da segunda guia +Você pode repetir o mesmo padrão para qualquer planilha adicional alterando o valor do índice. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Segunda guia +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Salve a primeira guia em um documento separado -Agora salve a primeira guia como um documento separado. Especifique o formato de salvamento e o caminho de saída. + +### Etapa 5: Salvar a primeira guia em um documento separado +`Save` grava o documento editado em um arquivo no formato especificado. Chame‑o na instância `EditableDocument`, fornecendo o caminho de saída e o formato (por exemplo, `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Salve a segunda guia em um documento separado -Repita o processo para a segunda aba, mas desta vez salve-a em um formato diferente. + +### Etapa 6: Salvar a segunda guia em um documento separado +A mesma chamada `Save` funciona para a segunda planilha, e você pode escolher um formato diferente, como PDF, se necessário. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Descarte instâncias de EditableDocument - Por fim, certifique-se de descartar adequadamente o`EditableDocument` instâncias para liberar recursos. + +### Etapa 7: Dispor das instâncias de EditableDocument +`Dispose` libera recursos não gerenciados mantidos pelo documento, como manipuladores de arquivos, garantindo que não haja vazamentos em serviços de longa duração. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Problemas Comuns e Soluções +- **Erros “File is locked”** – Certifique‑se de chamar `Dispose()` em cada `EditableDocument` e na instância `Editor`, ou envolva‑os em declarações `using`. +- **Estilos ausentes após a exportação** – Verifique se está salvando em um formato que suporte estilos (por exemplo, XLSX ou PDF). CSV perderá a formatação por design. +- **Pastas de trabalho grandes causam desempenho lento** – Use as opções de carregamento em streaming (`LoadOptions.Streaming = true`) para manter o uso de memória baixo. + +## Perguntas Frequentes + +**Q: E se minha pasta de trabalho contiver planilhas ocultas?** +A: Planilhas ocultas são tratadas como qualquer outra planilha; você pode acessá‑las por índice e salvá‑las, mas pode ser necessário definir `EditableDocument.IsVisible = true` antes de salvar se quiser que elas fiquem visíveis na saída. + +**Q: Posso converter uma guia do Excel diretamente para PDF?** +A: Sim, especifique `SaveFormat.Pdf` ao chamar `Save` no `EditableDocument`. A biblioteca preserva o layout, imagens e gráficos durante a conversão. + +**Q: É possível dividir uma pasta de trabalho em arquivos CSV em vez de XLSX?** +A: Absolutamente. Use `SaveFormat.Csv` para cada `EditableDocument` gerar representações CSV em texto simples de cada planilha. + +**Q: O GroupDocs.Editor suporta arquivos Excel protegidos por senha?** +A: Sim. Forneça a senha via `LoadOptions.Password` ao criar a instância `Editor`. + +**Q: Onde posso encontrar mais exemplos de trabalho com planilhas?** +A: A documentação oficial e os projetos de exemplo na [página de download](https://releases.groupdocs.com/editor/net/) contêm casos de uso adicionais. + ## Conclusão -Seguindo essas etapas, você pode trabalhar facilmente com planilhas com várias guias no .NET usando GroupDocs.Editor. Esta poderosa biblioteca simplifica o processo de edição e salvamento de diferentes planilhas em uma planilha, tornando suas tarefas de desenvolvimento mais gerenciáveis. Esteja você lidando com manipulação complexa de dados ou edições simples, o GroupDocs.Editor for .NET fornece as ferramentas necessárias para realizar o trabalho com eficiência. -## Perguntas frequentes -### O que é GroupDocs.Editor para .NET? -GroupDocs.Editor for .NET é uma poderosa API de edição de documentos que permite aos desenvolvedores carregar, editar e salvar documentos de vários formatos em aplicativos .NET. -### Posso experimentar o GroupDocs.Editor for .NET antes de comprar? - Sim, você pode usar um[teste grátis](https://releases.groupdocs.com/) ou solicite um[licença temporária](https://purchase.groupdocs.com/temporary-license/) para avaliar o produto. -### Quais formatos de arquivo são suportados pelo GroupDocs.Editor for .NET? -GroupDocs.Editor oferece suporte a uma ampla variedade de formatos, incluindo DOCX, XLSX, PPTX, PDF e muitos mais. -### Como obtenho suporte para GroupDocs.Editor for .NET? - Você pode obter suporte visitando o[Fórum de suporte](https://forum.groupdocs.com/c/editor/20). -### Onde posso comprar uma licença completa do GroupDocs.Editor for .NET? - Você pode adquirir uma licença completa no site[página de compra](https://purchase.groupdocs.com/buy). \ No newline at end of file +Seguindo estas etapas, você pode **salvar cada guia do Excel** como um documento independente, converter guias para PDF ou dividir grandes pastas de trabalho em partes manejáveis — tudo com a confiável e de alto desempenho biblioteca GroupDocs.Editor para .NET. Essa capacidade simplifica pipelines de relatórios, automatiza a extração de dados e reduz o manuseio manual de planilhas. + +--- + +**Última atualização:** 2026-06-06 +**Testado com:** GroupDocs.Editor 23.11 for .NET +**Autor:** GroupDocs + +--- + +## Tutoriais Relacionados + +- [Dominar a Extração de Guias de Planilha em .NET com GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Proteger Arquivos Excel com Senha Usando GroupDocs.Editor para .NET | Gerenciamento Seguro de Planilhas](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Dominar o Carregamento de Documentos em .NET com GroupDocs.Editor: Um Guia Abrangente](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/russian/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/russian/net/document-processing/work-multi-tab-spreadsheets/_index.md index 8620fd8d..96906ea5 100644 --- a/content/russian/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/russian/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,213 @@ --- -title: Работа с таблицами с несколькими вкладками -linktitle: Работа с таблицами с несколькими вкладками +date: 2026-06-06 +description: Узнайте, как **сохранить каждый лист Excel** с помощью GroupDocs.Editor + для .NET — пошаговое руководство, примеры кода и лучшие практики по разбиению файлов + XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Работа с таблицами с несколькими листами +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Узнайте, как работать с электронными таблицами с несколькими вкладками в .NET с помощью GroupDocs.Editor. Включены пошаговое руководство, примеры кода и рекомендации. -weight: 17 -url: /ru/net/document-processing/work-multi-tab-spreadsheets/ +title: Как сохранить каждый лист Excel с помощью GroupDocs.Editor .NET type: docs +url: /ru/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Работа с таблицами с несколькими вкладками + +# Работа с многостраничными электронными таблицами ## Введение -Работа с электронными таблицами с несколькими вкладками может оказаться непростой задачей, особенно если вам необходимо манипулировать или извлекать данные из разных листов в одном документе. Если вы работаете с .NET и ищете надежное решение, GroupDocs.Editor для .NET — отличный выбор. В этом руководстве мы познакомим вас с процессом работы с электронными таблицами с несколькими вкладками с помощью GroupDocs.Editor для .NET. Мы рассмотрим все: от настройки среды до сохранения каждой вкладки в отдельный файл. -## Предварительные условия -Прежде чем приступить к изучению руководства, убедитесь, что у вас есть следующие предварительные условия: -1. Visual Studio: убедитесь, что на вашем компьютере установлена Visual Studio. -2. .NET Framework: GroupDocs.Editor для .NET поддерживает .NET Framework 4.0 или выше. -3. GroupDocs.Editor для .NET: Загрузите и установите библиотеку GroupDocs.Editor для .NET. Вы можете получить его из[страница загрузки](https://releases.groupdocs.com/editor/net/). -4. Лицензия: Хотя вы можете использовать[временная лицензия](https://purchase.groupdocs.com/temporary-license/) Чтобы опробовать библиотеку, рекомендуется приобрести полную лицензию для промышленного использования. -## Импортировать пространства имен -Прежде чем мы начнем кодировать, вам необходимо импортировать необходимые пространства имен. Добавьте следующие директивы using в начало файла .cs: +Если вам нужно **сохранить каждую вкладку Excel** как отдельный файл, GroupDocs.Editor для .NET делает это без усилий. Независимо от того, извлекаете ли вы финансовые отчёты, создаёте листы для отдельных отделов или конвертируете вкладки в PDF, этот учебник проведёт вас через весь процесс — от настройки окружения до освобождения ресурсов — чтобы вы могли автоматизировать работу с несколькими листами с уверенностью. + +## Быстрые ответы +- **Может ли GroupDocs.Editor разделить XLSX на отдельные файлы?** Да, вы можете загрузить книгу и экспортировать каждый лист отдельно. +- **В каких форматах можно сохранять каждую вкладку?** XLSX, CSV, PDF, HTML и другие — поддерживается более 30 форматов вывода. +- **Нужна ли лицензия для этой функции?** Временная лицензия подходит для тестирования; для продакшн‑использования требуется полная лицензия. +- **Поддерживается ли .NET Core?** Абсолютно — библиотека работает с .NET Framework 4.0+ и .NET Core/5/6+. +- **Сколько вкладок можно обрабатывать одновременно?** GroupDocs.Editor может работать с книгами, содержащими более 500 листов, без загрузки всего файла в память. + +## Что означает «сохранить каждую вкладку Excel»? +**«Сохранить каждую вкладку Excel»** означает извлечение каждого листа из многостраничной книги и запись каждого в отдельный автономный документ (например, отдельные файлы XLSX или PDF). Такой подход упрощает последующую обработку, отчётность и распространение, предоставляя вам файл для каждого листа, который затем можно делиться, архивировать или дальше преобразовывать независимо. + +## Почему стоит использовать GroupDocs.Editor для этой задачи? +GroupDocs.Editor поддерживает **более 30 форматов ввода и вывода** и может обрабатывать электронные таблицы с **до 1 000 листов**, при этом экономя память за счёт потоковой передачи данных вместо загрузки всего файла. API также сохраняет стили ячеек, формулы и встроенные изображения, гарантируя, что каждая экспортированная вкладка выглядит точно так же, как оригинал. + +## Предварительные требования +Прежде чем приступать, убедитесь, что у вас есть: + +1. **Visual Studio** — любой современный выпуск (Community, Professional или Enterprise). +2. **.NET Framework 4.0+** — или .NET Core/5/6, если вы предпочитаете кроссплатформенный рантайм. +3. **GroupDocs.Editor for .NET** — скачайте его со [страницы загрузки](https://releases.groupdocs.com/editor/net/). +4. **Лицензия** — [временная лицензия](https://purchase.groupdocs.com/temporary-license/) подходит для тестирования; для продакшн‑использования приобретите полную лицензию. +5. **Бесплатный пробный период** — вы также можете попробовать библиотеку через страницу [бесплатного пробного периода](https://releases.groupdocs.com/). +6. **Поддержка** — если возникнут проблемы, посетите [форум поддержки](https://forum.groupdocs.com/c/editor/20) или рассмотрите [страницу покупки](https://purchase.groupdocs.com/buy) для полной лицензии. + +## Импорт пространств имён +Перед тем как начать писать код, необходимо импортировать нужные пространства имён. Добавьте следующие директивы using в начало вашего файла `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Получите путь к входному файлу -Сначала вам нужно указать путь к входному файлу электронной таблицы. Этот файл должен быть в формате XLSX (OOXML) с несколькими вкладками. + +## Как сохранить каждую вкладку Excel в отдельный файл? +Загрузите книгу, создайте `EditableDocument` для каждого листа и вызовите `Save` с нужным форматом. Этот процесс изолирует каждую вкладку, позволяет выбрать отдельный путь вывода и автоматически освобождает ресурсы. Ниже представлен пошаговый рабочий процесс с объяснениями каждого вызова API и рекомендациями по лучшим практикам, чтобы избежать распространённых проблем. + +### Шаг 1: Получить путь к входному файлу +Сначала укажите полный путь к исходному файлу XLSX, содержащему несколько вкладок. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Загрузите электронную таблицу в экземпляр редактора. - Далее вы загрузите таблицу в`Editor` пример. Это делается с помощью файлового потока и указания соответствующих параметров загрузки электронной таблицы. + +### Шаг 2: Загрузить электронную таблицу в экземпляр Editor +Класс `Editor` является точкой входа для всех операций с документами в GroupDocs.Editor. Он читает поток файла и подготавливает документ для редактирования или извлечения. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Дальнейшие действия будут здесь + // Further steps will go here } } ``` -## 3. Создайте редактируемый документ на первой вкладке. - Чтобы редактировать или манипулировать определенной вкладкой, вам необходимо создать`EditableDocument` экземпляр для этой вкладки. Вкладка указывается с использованием индекса, начинающегося с 0. + +### Шаг 3: Создать EditableDocument из первой вкладки +`EditableDocument` представляет один редактируемый лист в книге. Конструктор принимает экземпляр `Editor` и индекс листа, начинающийся с нуля. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Первая вкладка +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Создайте редактируемый документ на второй вкладке. - Аналогичным образом создайте`EditableDocument` для второй вкладки. + +### Шаг 4: Создать EditableDocument из второй вкладки +Вы можете повторить тот же шаблон для любого другого листа, изменив значение индекса. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Вторая вкладка +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Сохраните первую вкладку в отдельный документ. -Теперь сохраните первую вкладку как отдельный документ. Укажите формат сохранения и путь вывода. + +### Шаг 5: Сохранить первую вкладку в отдельный документ +`Save` записывает отредактированный документ в файл в указанном формате. Вызовите его у экземпляра `EditableDocument`, указав путь вывода и формат (например, `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Сохраните вторую вкладку в отдельный документ. -Повторите процесс для второй вкладки, но на этот раз сохраните ее в другом формате. + +### Шаг 6: Сохранить вторую вкладку в отдельный документ +Тот же вызов `Save` работает для второго листа, и при необходимости вы можете выбрать другой формат, например PDF. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Удалите экземпляры EditableDocument - Наконец, убедитесь, что вы правильно утилизируете`EditableDocument` экземпляры для освобождения ресурсов. + +### Шаг 7: Освободить экземпляры EditableDocument +`Dispose` освобождает неуправляемые ресурсы, связанные с документом, такие как файловые дескрипторы, гарантируя отсутствие утечек в длительно работающих сервисах. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Заключение -Выполнив эти шаги, вы сможете легко работать с электронными таблицами с несколькими вкладками в .NET с помощью GroupDocs.Editor. Эта мощная библиотека упрощает процесс редактирования и сохранения различных листов в электронной таблице, делая ваши задачи разработки более управляемыми. Независимо от того, имеете ли вы дело со сложными манипуляциями с данными или с простым редактированием, GroupDocs.Editor для .NET предоставляет инструменты, необходимые для эффективного выполнения работы. +## Распространённые проблемы и решения +- **Ошибка «Файл заблокирован»** — Убедитесь, что вызываете `Dispose()` у каждого `EditableDocument` и у экземпляра `Editor`, либо оберните их в конструкции `using`. +- **Отсутствие стилей после экспорта** — Убедитесь, что сохраняете в формат, поддерживающий стили (например, XLSX или PDF). CSV по‑умолчанию теряет форматирование. +- **Большие книги вызывают медленную работу** — Используйте опцию потоковой загрузки (`LoadOptions.Streaming = true`), чтобы снизить потребление памяти. + ## Часто задаваемые вопросы -### Что такое GroupDocs.Editor для .NET? -GroupDocs.Editor для .NET — это мощный API для редактирования документов, который позволяет разработчикам загружать, редактировать и сохранять документы различных форматов в приложениях .NET. -### Могу ли я попробовать GroupDocs.Editor для .NET перед покупкой? - Да, вы можете использовать[бесплатная пробная версия](https://releases.groupdocs.com/) или запросите[временная лицензия](https://purchase.groupdocs.com/temporary-license/) оценить товар. -### Какие форматы файлов поддерживаются GroupDocs.Editor для .NET? -GroupDocs.Editor поддерживает широкий спектр форматов, включая DOCX, XLSX, PPTX, PDF и многие другие. -### Как получить поддержку GroupDocs.Editor для .NET? - Вы можете получить поддержку, посетив[форум поддержки](https://forum.groupdocs.com/c/editor/20). -### Где я могу купить полную лицензию на GroupDocs.Editor для .NET? - Вы можете приобрести полную лицензию на сайте[страница покупки](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**Q: Что если моя книга содержит скрытые листы?** +A: Скрытые листы обрабатываются как любые другие; вы можете получить к ним доступ по индексу и сохранить, но возможно понадобится установить `EditableDocument.IsVisible = true` перед сохранением, если хотите, чтобы они были видимыми в результате. + +**Q: Можно ли напрямую конвертировать вкладку Excel в PDF?** +A: Да, укажите `SaveFormat.Pdf` при вызове `Save` у `EditableDocument`. Библиотека сохраняет макет, изображения и диаграммы при конвертации. + +**Q: Возможно ли разделить книгу на CSV‑файлы вместо XLSX?** +A: Абсолютно. Используйте `SaveFormat.Csv` для каждого `EditableDocument`, чтобы получить текстовые CSV‑представления каждого листа. + +**Q: Поддерживает ли GroupDocs.Editor Excel‑файлы, защищённые паролем?** +A: Да. Укажите пароль через `LoadOptions.Password` при создании экземпляра `Editor`. + +**Q: Где я могу найти больше примеров работы с электронными таблицами?** +A: Официальная документация и примеры проектов на [странице загрузки](https://releases.groupdocs.com/editor/net/) содержат дополнительные сценарии использования. + +## Заключение +Следуя этим шагам, вы сможете **сохранить каждую вкладку Excel** как отдельный документ, конвертировать вкладки в PDF или разбить большие книги на управляемые части — всё это с надёжной, высокопроизводительной библиотекой GroupDocs.Editor для .NET. Эта возможность упрощает конвейеры отчётности, автоматизирует извлечение данных и уменьшает ручную работу с электронными таблицами. + +--- + +**Последнее обновление:** 2026-06-06 +**Тестировано с:** GroupDocs.Editor 23.11 for .NET +**Автор:** GroupDocs + +--- + +## Связанные руководства + +- [Мастерство извлечения вкладок электронных таблиц в .NET с GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Защита паролем файлов Excel с помощью GroupDocs.Editor для .NET | Управление безопасностью электронных таблиц](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Мастерство загрузки документов в .NET с GroupDocs.Editor: Полное руководство](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/spanish/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/spanish/net/document-processing/work-multi-tab-spreadsheets/_index.md index b49572b4..50ee4715 100644 --- a/content/spanish/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/spanish/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,209 @@ --- -title: Trabajar con hojas de cálculo de varias pestañas +date: 2026-06-06 +description: Aprende a **guardar cada pestaña de Excel** usando GroupDocs.Editor para + .NET – guía paso a paso, fragmentos de código y buenas prácticas para dividir archivos + XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files linktitle: Trabajar con hojas de cálculo de varias pestañas -second_title: API GroupDocs.Editor .NET -description: Aprenda a trabajar con hojas de cálculo de varias pestañas en .NET usando GroupDocs.Editor. Se incluyen guía paso a paso, ejemplos de código y mejores prácticas. -weight: 17 -url: /es/net/document-processing/work-multi-tab-spreadsheets/ +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Cómo guardar cada pestaña de Excel con GroupDocs.Editor .NET type: docs +url: /es/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Trabajar con hojas de cálculo de varias pestañas + +# Trabajar con Hojas de Cálculo de Múltiples Pestañas ## Introducción -Manejar hojas de cálculo con varias pestañas puede ser toda una tarea, especialmente cuando necesitas manipular o extraer datos de diferentes hojas dentro del mismo documento. Si trabaja con .NET y busca una solución sólida, GroupDocs.Editor para .NET es una excelente opción. En este tutorial, lo guiaremos a través del proceso de trabajar con hojas de cálculo de múltiples pestañas usando GroupDocs.Editor para .NET. Cubriremos todo, desde configurar su entorno hasta guardar cada pestaña como un archivo separado. +Si necesita **guardar cada pestaña de Excel** como un archivo independiente, GroupDocs.Editor para .NET lo hace sin complicaciones. Ya sea que esté extrayendo informes financieros, generando hojas de trabajo por departamento, o convirtiendo pestañas a PDF, este tutorial lo guía a través de todo el flujo de trabajo—desde la configuración del entorno hasta la liberación de recursos—para que pueda automatizar el manejo de libros de varias hojas con confianza. + +## Respuestas rápidas +- **¿Puede GroupDocs.Editor dividir un XLSX en archivos separados?** Sí, puede cargar el libro y exportar cada hoja individualmente. +- **¿En qué formatos se puede guardar cada pestaña?** XLSX, CSV, PDF, HTML y más — se admiten más de 30 formatos de salida. +- **¿Necesito una licencia para esta función?** Una licencia temporal funciona para pruebas; se requiere una licencia completa para producción. +- **¿Se admite .NET Core?** Absolutamente — la biblioteca funciona con .NET Framework 4.0+ y .NET Core/5/6+. +- **¿Cuántas pestañas se pueden procesar a la vez?** GroupDocs.Editor puede manejar libros con más de 500 hojas sin cargar todo el archivo en memoria. + +## ¿Qué es “guardar cada pestaña de Excel”? +**“Guardar cada pestaña de Excel”** significa extraer cada hoja de cálculo de un libro de varias hojas y escribir cada una en su propio documento independiente (p. ej., archivos XLSX o PDF separados). Este enfoque simplifica el procesamiento posterior, la generación de informes y la distribución al proporcionarle un archivo por hoja, que luego puede compartir, archivar o transformar de forma independiente. + +## ¿Por qué usar GroupDocs.Editor para esta tarea? +GroupDocs.Editor admite **más de 30 formatos de entrada y salida** y puede procesar hojas de cálculo con **hasta 1.000 hojas** manteniendo bajo el uso de memoria mediante la transmisión de datos en lugar de cargar todo el archivo. La API también conserva los estilos de celda, fórmulas e imágenes incrustadas, garantizando que cada pestaña exportada se vea idéntica al original. + ## Requisitos previos -Antes de sumergirse en el tutorial, asegúrese de cumplir con los siguientes requisitos previos: -1. Visual Studio: asegúrese de tener Visual Studio instalado en su máquina. -2. .NET Framework: GroupDocs.Editor para .NET admite .NET Framework 4.0 o superior. -3. GroupDocs.Editor para .NET: descargue e instale la biblioteca GroupDocs.Editor para .NET. Puedes conseguirlo desde el[pagina de descarga](https://releases.groupdocs.com/editor/net/). -4. Licencia: Si bien puedes usar una[licencia temporal](https://purchase.groupdocs.com/temporary-license/) Para probar la biblioteca, se recomienda comprar una licencia completa para uso en producción. +Antes de comenzar, verifique que tenga: + +1. **Visual Studio** – cualquier edición reciente (Community, Professional o Enterprise). +2. **.NET Framework 4.0+** – o .NET Core/5/6 si prefiere el tiempo de ejecución multiplataforma. +3. **GroupDocs.Editor para .NET** – descárguelo desde la [página de descarga](https://releases.groupdocs.com/editor/net/). +4. **Licencia** – una [licencia temporal](https://purchase.groupdocs.com/temporary-license/) es suficiente para pruebas; adquiera una licencia completa para uso en producción. +5. **Prueba gratuita** – también puede probar la biblioteca a través de la página de [prueba gratuita](https://releases.groupdocs.com/). +6. **Soporte** – si encuentra problemas, visite el [foro de soporte](https://forum.groupdocs.com/c/editor/20) o considere la [página de compra](https://purchase.groupdocs.com/buy) para una licencia completa. + ## Importar espacios de nombres -Antes de comenzar a codificar, debe importar los espacios de nombres necesarios. Agregue las siguientes directivas de uso en la parte superior de su archivo .cs: +Antes de comenzar a programar, necesita importar los espacios de nombres necesarios. Agregue las siguientes directivas using al inicio de su archivo `.cs`: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Obtenga una ruta al archivo de entrada -Primero, debe especificar la ruta a su archivo de hoja de cálculo de entrada. Este archivo debe ser un XLSX (OOXML) con varias pestañas. + +## ¿Cómo guardar cada pestaña de Excel como un archivo separado? +Cargue el libro, cree un `EditableDocument` para cada hoja y llame a `Save` con el formato deseado. Este proceso aísla cada pestaña, le permite elegir una ruta de salida distinta y libera los recursos automáticamente. A continuación se muestra el flujo de trabajo paso a paso que seguirá, con explicaciones de cada llamada a la API y consejos de buenas prácticas para evitar errores comunes. + +### Paso 1: Obtener la ruta al archivo de entrada +Primero, indique la ruta completa al archivo XLSX de origen que contiene varias pestañas. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Cargue la hoja de cálculo en la instancia del editor. - A continuación, cargará la hoja de cálculo en un`Editor` instancia. Esto se hace utilizando una secuencia de archivos y especificando las opciones de carga apropiadas para una hoja de cálculo. + +### Paso 2: Cargar la hoja de cálculo en la instancia de Editor +La clase `Editor` es el punto de entrada para todas las operaciones de documentos en GroupDocs.Editor. Lee el flujo del archivo y prepara el documento para edición o extracción. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Más pasos irán aquí + // Further steps will go here } } ``` -## 3. Cree un documento editable desde la primera pestaña - Para editar o manipular una pestaña específica, necesita crear una`EditableDocument` instancia para esa pestaña. La pestaña se especifica utilizando un índice basado en 0. + +### Paso 3: Crear un EditableDocument a partir de la primera pestaña +`EditableDocument` representa una hoja única y editable dentro del libro. El constructor recibe la instancia `Editor` y un índice de hoja basado en cero. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Primera pestaña +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Cree un documento editable desde la segunda pestaña - Del mismo modo, cree una`EditableDocument` para la segunda pestaña. + +### Paso 4: Crear un EditableDocument a partir de la segunda pestaña +Puede repetir el mismo patrón para cualquier hoja adicional cambiando el valor del índice. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Segunda pestaña +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Guarde la primera pestaña en un documento separado -Ahora, guarde la primera pestaña como un documento separado. Especifique el formato de guardado y la ruta de salida. + +### Paso 5: Guardar la primera pestaña en un documento separado +`Save` escribe el documento editado en un archivo con el formato especificado. Llámelo sobre la instancia `EditableDocument`, proporcionando la ruta de salida y el formato (p. ej., `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Guarde la segunda pestaña en un documento separado -Repite el proceso para la segunda pestaña, pero esta vez guárdala en un formato diferente. + +### Paso 6: Guardar la segunda pestaña en un documento separado +La misma llamada `Save` funciona para la segunda hoja, y puede elegir un formato diferente como PDF si lo necesita. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Deseche las instancias de EditableDocument - Por último, asegúrese de desechar correctamente el`EditableDocument` instancias para liberar recursos. + +### Paso 7: Liberar las instancias de EditableDocument +`Dispose` libera los recursos no administrados que posee el documento, como manejadores de archivos, garantizando que no haya fugas en servicios de larga duración. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Conclusión -Si sigue estos pasos, podrá trabajar fácilmente con hojas de cálculo de varias pestañas en .NET utilizando GroupDocs.Editor. Esta poderosa biblioteca simplifica el proceso de editar y guardar diferentes hojas dentro de una hoja de cálculo, lo que hace que sus tareas de desarrollo sean más manejables. Ya sea que esté lidiando con una manipulación de datos compleja o con ediciones simples, GroupDocs.Editor para .NET proporciona las herramientas que necesita para realizar el trabajo de manera eficiente. +## Problemas comunes y soluciones +- **Errores “Archivo bloqueado”** – Asegúrese de llamar a `Dispose()` en cada `EditableDocument` y en la instancia `Editor`, o envuélvalos en sentencias `using`. +- **Estilos faltantes después de la exportación** – Verifique que está guardando en un formato que admite estilos (p. ej., XLSX o PDF). CSV perderá el formato por diseño. +- **Los libros grandes provocan bajo rendimiento** – Use las opciones de carga en streaming (`LoadOptions.Streaming = true`) para mantener bajo el uso de memoria. + ## Preguntas frecuentes -### ¿Qué es GroupDocs.Editor para .NET? -GroupDocs.Editor para .NET es una potente API de edición de documentos que permite a los desarrolladores cargar, editar y guardar documentos de varios formatos dentro de aplicaciones .NET. -### ¿Puedo probar GroupDocs.Editor para .NET antes de comprarlo? - Sí, puedes usar un[prueba gratis](https://releases.groupdocs.com/) o solicitar un[licencia temporal](https://purchase.groupdocs.com/temporary-license/) para evaluar el producto. -### ¿Qué formatos de archivo son compatibles con GroupDocs.Editor para .NET? -GroupDocs.Editor admite una amplia gama de formatos, incluidos DOCX, XLSX, PPTX, PDF y muchos más. -### ¿Cómo obtengo soporte para GroupDocs.Editor para .NET? - Puede obtener soporte visitando el[Foro de soporte](https://forum.groupdocs.com/c/editor/20). -### ¿Dónde puedo comprar una licencia completa de GroupDocs.Editor para .NET? - Puede adquirir una licencia completa en[pagina de compra](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**P: ¿Qué pasa si mi libro contiene hojas ocultas?** +R: Las hojas ocultas se tratan como cualquier otra hoja; puede acceder a ellas por índice y guardarlas, pero es posible que deba establecer `EditableDocument.IsVisible = true` antes de guardar si desea que sean visibles en la salida. + +**P: ¿Puedo convertir una pestaña de Excel directamente a PDF?** +R: Sí, especifique `SaveFormat.Pdf` al llamar a `Save` en el `EditableDocument`. La biblioteca conserva el diseño, imágenes y gráficos durante la conversión. + +**P: ¿Es posible dividir un libro en archivos CSV en lugar de XLSX?** +R: Absolutamente. Use `SaveFormat.Csv` para cada `EditableDocument` y genere representaciones CSV de texto plano de cada hoja. + +**P: ¿GroupDocs.Editor admite archivos de Excel protegidos con contraseña?** +R: Sí. Proporcione la contraseña mediante `LoadOptions.Password` al crear la instancia `Editor`. + +**P: ¿Dónde puedo encontrar más ejemplos de trabajo con hojas de cálculo?** +R: La documentación oficial y los proyectos de muestra en la [página de descarga](https://releases.groupdocs.com/editor/net/) contienen casos de uso adicionales. + +## Conclusión +Siguiendo estos pasos, puede **guardar cada pestaña de Excel** como un documento independiente, convertir pestañas a PDF o dividir libros grandes en piezas manejables, todo con la confiable y de alto rendimiento biblioteca GroupDocs.Editor para .NET. Esta capacidad simplifica los flujos de informes, automatiza la extracción de datos y reduce el manejo manual de hojas de cálculo. + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +## Tutoriales relacionados + +- [Dominar la extracción de pestañas de hojas de cálculo en .NET con GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Proteger con contraseña archivos Excel usando GroupDocs.Editor para .NET | Gestión segura de hojas de cálculo](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Dominar la carga de documentos en .NET con GroupDocs.Editor: Guía completa](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/swedish/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/swedish/net/document-processing/work-multi-tab-spreadsheets/_index.md index c37587cf..6a7a7be7 100644 --- a/content/swedish/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/swedish/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,208 @@ --- -title: Arbeta med kalkylblad med flera flikar +date: 2026-06-06 +description: Lär dig hur du **sparar varje Excel-flik** med GroupDocs.Editor för .NET + – steg‑för‑steg guide, kodexempel och bästa praxis för att dela upp XLSX-filer. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files linktitle: Arbeta med kalkylblad med flera flikar +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: Lär dig hur du arbetar med kalkylblad med flera flikar i .NET med GroupDocs.Editor. Steg-för-steg-guide, kodexempel och bästa praxis ingår. -weight: 17 -url: /sv/net/document-processing/work-multi-tab-spreadsheets/ +title: Hur man sparar varje Excel-flik med GroupDocs.Editor .NET type: docs +url: /sv/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- + # Arbeta med kalkylblad med flera flikar ## Introduktion -Att hantera kalkylblad med flera flikar kan vara en ganska stor uppgift, särskilt när du behöver manipulera eller extrahera data från olika ark i samma dokument. Om du arbetar med .NET och letar efter en robust lösning är GroupDocs.Editor för .NET ett utmärkt val. I den här självstudien går vi igenom processen att arbeta med kalkylblad med flera flikar med hjälp av GroupDocs.Editor för .NET. Vi kommer att täcka allt från att ställa in din miljö till att spara varje flik som en separat fil. +Om du behöver **save each Excel tab** som en självständig fil, gör GroupDocs.Editor för .NET det enkelt. Oavsett om du extraherar finansiella rapporter, genererar kalkylblad per avdelning, eller konverterar flikar till PDF, guidar den här handledningen dig genom hela arbetsflödet — från miljöinställning till frigöring av resurser — så att du kan automatisera hantering av flera blad med förtroende. + +## Snabba svar +- **Kan GroupDocs.Editor dela upp en XLSX i separata filer?** Ja, du kan läsa in arbetsboken och exportera varje blad individuellt. +- **Vilka format kan varje flik sparas som?** XLSX, CSV, PDF, HTML och mer – över 30 utdataformat stöds. +- **Behöver jag en licens för den här funktionen?** En tillfällig licens fungerar för testning; en fullständig licens krävs för produktion. +- **Stöds .NET Core?** Absolut – biblioteket fungerar med .NET Framework 4.0+ och .NET Core/5/6+. +- **Hur många flikar kan bearbetas samtidigt?** GroupDocs.Editor kan hantera arbetsböcker med över 500 blad utan att läsa in hela filen i minnet. + +## Vad betyder “save each excel tab”? +**“Save each Excel tab”** betyder att extrahera varje kalkylblad från en arbetsbok med flera blad och skriva varje blad till ett eget fristående dokument (t.ex. separata XLSX- eller PDF-filer). Detta tillvägagångssätt förenklar efterföljande bearbetning, rapportering och distribution genom att ge dig en fil per blad, som sedan kan delas, arkiveras eller vidare omvandlas oberoende. + +## Varför använda GroupDocs.Editor för denna uppgift? +GroupDocs.Editor stöder **30+ in- och utdataformat** och kan bearbeta kalkylblad med **upp till 1 000 blad** samtidigt som minnesanvändningen hålls låg genom att strömma data istället för att läsa in hela filen. API:et bevarar också cellstilar, formler och inbäddade bilder, vilket säkerställer att varje exporterat blad ser identiskt ut som originalet. + ## Förutsättningar -Innan du dyker in i handledningen, se till att du har följande förutsättningar på plats: -1. Visual Studio: Se till att du har Visual Studio installerat på din dator. -2. .NET Framework: GroupDocs.Editor för .NET stöder .NET Framework 4.0 eller högre. -3. GroupDocs.Editor för .NET: Ladda ner och installera GroupDocs.Editor för .NET-biblioteket. Du kan få det från[nedladdningssida](https://releases.groupdocs.com/editor/net/). -4. Licens: Medan du kan använda en[tillfällig licens](https://purchase.groupdocs.com/temporary-license/) för att prova biblioteket rekommenderas det att köpa en fullständig licens för produktionsanvändning. -## Importera namnområden -Innan vi börjar koda måste du importera de nödvändiga namnrymden. Lägg till följande med hjälp av direktiv överst i din .cs-fil: +1. **Visual Studio** – någon nyare utgåva (Community, Professional eller Enterprise). +2. **.NET Framework 4.0+** – eller .NET Core/5/6 om du föredrar den plattformsoberoende runtime. +3. **GroupDocs.Editor for .NET** – ladda ner det från [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – en [temporary license](https://purchase.groupdocs.com/temporary-license/) är okej för testning; köp en full licens för produktionsbruk. +5. **Free trial** – du kan också prova biblioteket via [free trial](https://releases.groupdocs.com/) sidan. +6. **Support** – om du stöter på problem, besök [support forum](https://forum.groupdocs.com/c/editor/20) eller överväg [purchase page](https://purchase.groupdocs.com/buy) för en full licens. + +## Importera namnrymder +Innan vi börjar koda måste du importera de nödvändiga namnrymderna. Lägg till följande using‑direktiv högst upp i din `.cs`‑fil: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Hämta en sökväg till indatafilen -Först måste du ange sökvägen till din inmatade kalkylarksfil. Den här filen bör vara en XLSX (OOXML) med flera flikar. + +## Hur sparar du varje Excel-flik som en separat fil? +Läs in arbetsboken, skapa ett `EditableDocument` för varje blad och anropa `Save` med önskat format. Denna process isolerar varje flik, låter dig välja en separat utskrivningssökväg och frigör resurser automatiskt. Nedan följer steg‑för‑steg‑arbetsflödet du ska följa, med förklaringar för varje API‑anrop och bästa praxis‑tips för att undvika vanliga fallgropar. + +### Steg 1: Hämta en sökväg till indatafilen +Först, ange den fullständiga sökvägen till käll‑XLSX‑filen som innehåller flera flikar. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Ladda kalkylarket i Editor-instansen - Därefter ska du ladda kalkylarket i en`Editor` exempel. Detta görs med hjälp av en filström och ange lämpliga laddningsalternativ för ett kalkylblad. + +### Steg 2: Läs in kalkylbladet i Editor‑instansen +`Editor`‑klassen är ingångspunkten för alla dokumentoperationer i GroupDocs.Editor. Den läser filströmmen och förbereder dokumentet för redigering eller extraktion. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Ytterligare steg kommer att gå här + // Further steps will go here } } ``` -## 3. Skapa ett redigerbart dokument från den första fliken - För att redigera eller manipulera en specifik flik måste du skapa en`EditableDocument` instans för den fliken. Fliken anges med ett 0-baserat index. + +### Steg 3: Skapa ett EditableDocument från den första fliken +`EditableDocument` representerar ett enskilt, redigerbart blad i arbetsboken. Konstruktorn tar `Editor`‑instansen och ett noll‑baserat bladindex. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Första fliken +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Skapa ett redigerbart dokument från den andra fliken - Skapa på samma sätt en`EditableDocument` för den andra fliken. + +### Steg 4: Skapa ett EditableDocument från den andra fliken +Du kan upprepa samma mönster för vilket ytterligare blad som helst genom att ändra indexvärdet. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Andra fliken +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Spara den första fliken i ett separat dokument -Spara nu den första fliken som ett separat dokument. Ange sparformat och utdatasökväg. + +### Steg 5: Spara den första fliken till ett separat dokument +`Save` skriver det redigerade dokumentet till en fil i det angivna formatet. Anropa den på `EditableDocument`‑instansen och ange utskrivningssökväg och format (t.ex. `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Spara den andra fliken i ett separat dokument -Upprepa processen för den andra fliken, men denna gång spara den i ett annat format. + +### Steg 6: Spara den andra fliken till ett separat dokument +Samma `Save`‑anrop fungerar för det andra bladet, och du kan välja ett annat format som PDF om så behövs. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Kassera EditableDocument Instances - Slutligen, se till att du kasserar den på rätt sätt`EditableDocument` instanser för att frigöra resurser. + +### Steg 7: Frigör EditableDocument‑instanser +`Dispose` frigör ohanterade resurser som hålls av dokumentet, såsom filhandtag, vilket säkerställer att inga läckor uppstår i långvariga tjänster. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` +## Vanliga problem och lösningar +- **“File is locked” errors** – Se till att du anropar `Dispose()` på varje `EditableDocument` och `Editor`‑instans, eller omsluter dem i `using`‑satser. +- **Missing styles after export** – Verifiera att du sparar till ett format som stöder styling (t.ex. XLSX eller PDF). CSV förlorar formatering avsiktligt. +- **Large workbooks cause slow performance** – Använd streaming‑laddningsalternativen (`LoadOptions.Streaming = true`) för att hålla minnesanvändningen låg. + +## Vanliga frågor + +**Q: Vad händer om min arbetsbok innehåller dolda blad?** +A: Dolda blad behandlas som alla andra blad; du kan komma åt dem via index och spara dem, men du kan behöva sätta `EditableDocument.IsVisible = true` innan du sparar om du vill att de ska vara synliga i utskriften. + +**Q: Kan jag konvertera en Excel-flik direkt till PDF?** +A: Ja, ange `SaveFormat.Pdf` när du anropar `Save` på `EditableDocument`. Biblioteket bevarar layout, bilder och diagram under konverteringen. + +**Q: Är det möjligt att dela upp en arbetsbok i CSV‑filer istället för XLSX?** +A: Absolut. Använd `SaveFormat.Csv` för varje `EditableDocument` för att generera ren‑text CSV‑representationer av varje blad. + +**Q: Stöder GroupDocs.Editor lösenordsskyddade Excel‑filer?** +A: Ja. Ange lösenordet via `LoadOptions.Password` när du skapar `Editor`‑instansen. + +**Q: Var kan jag hitta fler exempel på arbete med kalkylblad?** +A: Den officiella dokumentationen och exempelprojekten på [download page](https://releases.groupdocs.com/editor/net/) innehåller ytterligare användningsfall. + ## Slutsats -Genom att följa dessa steg kan du enkelt arbeta med kalkylblad med flera flikar i .NET med GroupDocs.Editor. Detta kraftfulla bibliotek förenklar processen att redigera och spara olika ark i ett kalkylblad, vilket gör dina utvecklingsuppgifter mer hanterbara. Oavsett om du har att göra med komplex datamanipulation eller enkla redigeringar, tillhandahåller GroupDocs.Editor för .NET de verktyg du behöver för att få jobbet gjort effektivt. -## FAQ's -### Vad är GroupDocs.Editor för .NET? -GroupDocs.Editor för .NET är ett kraftfullt dokumentredigerings-API som tillåter utvecklare att ladda, redigera och spara dokument i olika format inom .NET-applikationer. -### Kan jag prova GroupDocs.Editor för .NET innan jag köper? - Ja, du kan använda en[gratis provperiod](https://releases.groupdocs.com/) eller begära en[tillfällig licens](https://purchase.groupdocs.com/temporary-license/) att utvärdera produkten. -### Vilka filformat stöds av GroupDocs.Editor för .NET? -GroupDocs.Editor stöder ett brett utbud av format, inklusive DOCX, XLSX, PPTX, PDF och många fler. -### Hur får jag support för GroupDocs.Editor för .NET? - Du kan få stöd genom att besöka[supportforum](https://forum.groupdocs.com/c/editor/20). -### Var kan jag köpa en fullständig licens för GroupDocs.Editor för .NET? - Du kan köpa en fullständig licens från[köpsidan](https://purchase.groupdocs.com/buy). \ No newline at end of file +Genom att följa dessa steg kan du **save each Excel tab** som ett självständigt dokument, konvertera flikar till PDF eller dela upp stora arbetsböcker i hanterbara delar — allt med det pålitliga, högpresterande GroupDocs.Editor för .NET‑biblioteket. Denna funktion förenklar rapporteringsflöden, automatiserar dataextraktion och minskar manuell hantering av kalkylblad. + +--- + +**Senast uppdaterad:** 2026-06-06 +**Testat med:** GroupDocs.Editor 23.11 for .NET +**Författare:** GroupDocs + +## Relaterade handledningar + +- [Mästra extrahering av kalkylbladsflikar i .NET med GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Lösenordsskydda Excel‑filer med GroupDocs.Editor för .NET | Säker kalkylblads‑hantering](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Mästra dokumentladdning i .NET med GroupDocs.Editor: En omfattande guide](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/thai/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/thai/net/document-processing/work-multi-tab-spreadsheets/_index.md index b37924f0..53a34cdb 100644 --- a/content/thai/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/thai/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,211 @@ --- -title: ทำงานกับสเปรดชีตแบบหลายแท็บ -linktitle: ทำงานกับสเปรดชีตแบบหลายแท็บ +date: 2026-06-06 +description: เรียนรู้วิธี **บันทึกแต่ละแท็บของ Excel** ด้วย GroupDocs.Editor for .NET + – คู่มือขั้นตอน‑ต่อ​ขั้นตอน, ตัวอย่างโค้ด, และแนวทางปฏิบัติที่ดีที่สุดสำหรับการแยกไฟล์ + XLSX +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: ทำงานกับสเปรดชีตหลายแท็บ +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage second_title: GroupDocs.Editor .NET API -description: เรียนรู้วิธีทำงานกับสเปรดชีตแบบหลายแท็บใน .NET โดยใช้ GroupDocs.Editor รวมคำแนะนำทีละขั้นตอน ตัวอย่างโค้ด และแนวทางปฏิบัติที่ดีที่สุด -weight: 17 -url: /th/net/document-processing/work-multi-tab-spreadsheets/ +title: วิธีบันทึกแต่ละแท็บของ Excel ด้วย GroupDocs.Editor .NET type: docs +url: /th/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# ทำงานกับสเปรดชีตแบบหลายแท็บ -## การแนะนำ -การจัดการสเปรดชีตแบบหลายแท็บอาจเป็นงานที่ค่อนข้างยาก โดยเฉพาะอย่างยิ่งเมื่อคุณต้องการจัดการหรือแยกข้อมูลจากชีตต่างๆ ภายในเอกสารเดียวกัน หากคุณกำลังทำงานกับ .NET และกำลังมองหาโซลูชันที่มีประสิทธิภาพ GroupDocs.Editor สำหรับ .NET เป็นตัวเลือกที่ยอดเยี่ยม ในบทช่วยสอนนี้ เราจะแนะนำคุณตลอดกระบวนการทำงานกับสเปรดชีตแบบหลายแท็บโดยใช้ GroupDocs.Editor สำหรับ .NET เราจะครอบคลุมทุกอย่างตั้งแต่การตั้งค่าสภาพแวดล้อมของคุณไปจนถึงการบันทึกแต่ละแท็บเป็นไฟล์แยกต่างหาก +# ทำงานกับสเปรดชีตหลายแท็บ + +## บทนำ +หากคุณต้องการ **บันทึกแต่ละแท็บ Excel** เป็นไฟล์อิสระ, GroupDocs.Editor สำหรับ .NET ทำให้เป็นเรื่องง่าย ไม่ว่าคุณจะกำลังดึงรายงานการเงิน, สร้างแผ่นงานตามแผนก, หรือแปลงแท็บเป็น PDF, บทเรียนนี้จะพาคุณผ่านกระบวนการทั้งหมด—ตั้งแต่การตั้งค่าสภาพแวดล้อมจนถึงการปล่อยทรัพยากร—เพื่อให้คุณสามารถทำงานอัตโนมัติกับสเปรดชีตหลายแท็บได้อย่างมั่นใจ. + +## คำตอบอย่างรวดเร็ว +- **GroupDocs.Editor สามารถแยกไฟล์ XLSX เป็นไฟล์แยกได้หรือไม่?** ใช่, คุณสามารถโหลดเวิร์กบุ๊กและส่งออกแต่ละชีตแยกกันได้. +- **รูปแบบใดบ้างที่แต่ละแท็บสามารถบันทึกได้?** XLSX, CSV, PDF, HTML, และอื่น ๆ – รองรับรูปแบบผลลัพธ์กว่า 30 รูปแบบ. +- **ฉันต้องมีลิขสิทธิ์สำหรับฟีเจอร์นี้หรือไม่?** ใบอนุญาตชั่วคราวใช้ได้สำหรับการทดสอบ; จำเป็นต้องมีใบอนุญาตเต็มสำหรับการใช้งานจริง. +- **.NET Core รองรับหรือไม่?** แน่นอน – ไลบรารีทำงานกับ .NET Framework 4.0+ และ .NET Core/5/6+. +- **สามารถประมวลผลแท็บได้กี่แท็บพร้อมกัน?** GroupDocs.Editor สามารถจัดการเวิร์กบุ๊กที่มี 500+ ชีตได้โดยไม่ต้องโหลดไฟล์ทั้งหมดเข้าสู่หน่วยความจำ. + +## “บันทึกแต่ละแท็บ Excel” คืออะไร? +**“Save each Excel tab”** หมายถึงการดึงทุกแผ่นงานจากเวิร์กบุ๊กหลายชีตและเขียนแต่ละชีตเป็นเอกสารแยกของตนเอง (เช่นไฟล์ XLSX หรือ PDF แยกกัน) วิธีนี้ทำให้การประมวลผลต่อเนื่อง, รายงาน, และการแจกจ่ายง่ายขึ้นโดยให้คุณมีไฟล์ต่อหนึ่งชีต ซึ่งสามารถแชร์, เก็บถาวร, หรือแปลงต่อได้อย่างอิสระ. + +## ทำไมต้องใช้ GroupDocs.Editor สำหรับงานนี้? +GroupDocs.Editor รองรับ **รูปแบบอินพุตและเอาต์พุตกว่า 30** และสามารถประมวลผลสเปรดชีตที่มี **สูงสุด 1,000 ชีต** โดยรักษาการใช้หน่วยความจำให้น้อยด้วยการสตรีมข้อมูลแทนการโหลดไฟล์ทั้งหมด API ยังรักษารูปแบบเซลล์, สูตร, และรูปภาพที่ฝังอยู่, ทำให้แต่ละแท็บที่ส่งออกดูเหมือนต้นฉบับอย่างสมบูรณ์. + ## ข้อกำหนดเบื้องต้น -ก่อนที่จะเข้าสู่บทช่วยสอน ตรวจสอบให้แน่ใจว่าคุณมีข้อกำหนดเบื้องต้นต่อไปนี้: -1. Visual Studio: ตรวจสอบให้แน่ใจว่าคุณได้ติดตั้ง Visual Studio บนเครื่องของคุณ -2. .NET Framework: GroupDocs.Editor สำหรับ .NET รองรับ .NET Framework 4.0 หรือสูงกว่า -3. GroupDocs.Editor สำหรับ .NET: ดาวน์โหลดและติดตั้งไลบรารี GroupDocs.Editor สำหรับ .NET คุณสามารถรับได้จาก[หน้าดาวน์โหลด](https://releases.groupdocs.com/editor/net/). -4. ใบอนุญาต: ในขณะที่คุณสามารถใช้ไฟล์[ใบอนุญาตชั่วคราว](https://purchase.groupdocs.com/temporary-license/) หากต้องการลองใช้ห้องสมุด ขอแนะนำให้ซื้อใบอนุญาตฉบับสมบูรณ์สำหรับการใช้งานจริง -## นำเข้าเนมสเปซ -ก่อนที่เราจะเริ่มเขียนโค้ด คุณต้องนำเข้าเนมสเปซที่จำเป็นก่อน เพิ่มคำสั่งต่อไปนี้ที่ด้านบนของไฟล์ .cs ของคุณ: +1. **Visual Studio** – รุ่นล่าสุดใดก็ได้ (Community, Professional หรือ Enterprise). +2. **.NET Framework 4.0+** – หรือ .NET Core/5/6 หากคุณต้องการรันไทม์ข้ามแพลตฟอร์ม. +3. **GroupDocs.Editor for .NET** – ดาวน์โหลดจาก [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – [temporary license](https://purchase.groupdocs.com/temporary-license/) ใช้ได้สำหรับการทดสอบ; ซื้อใบอนุญาตเต็มสำหรับการใช้งานจริง. +5. **Free trial** – คุณสามารถลองใช้ไลบรารีได้ผ่านหน้า [free trial](https://releases.groupdocs.com/) . +6. **Support** – หากพบปัญหา, เยี่ยมชม [support forum](https://forum.groupdocs.com/c/editor/20) หรือพิจารณา [purchase page](https://purchase.groupdocs.com/buy) เพื่อซื้อใบอนุญาตเต็ม. + +## นำเข้า Namespaces +ก่อนที่เราจะเริ่มเขียนโค้ด, คุณต้องนำเข้า namespaces ที่จำเป็น เพิ่มคำสั่ง using ด้านล่างนี้ไปที่ส่วนหัวของไฟล์ `.cs` ของคุณ: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. รับเส้นทางไปยังไฟล์อินพุต -ขั้นแรก คุณต้องระบุเส้นทางไปยังไฟล์สเปรดชีตอินพุตของคุณ ไฟล์นี้ควรเป็น XLSX (OOXML) ที่มีหลายแท็บ + +## วิธีบันทึกแต่ละแท็บ Excel เป็นไฟล์แยก +โหลดเวิร์กบุ๊ก, สร้าง `EditableDocument` สำหรับแต่ละชีต, และเรียก `Save` ด้วยรูปแบบที่ต้องการ กระบวนการนี้จะแยกแต่ละแท็บ, ให้คุณเลือกเส้นทางเอาต์พุตที่แตกต่างกัน, และปล่อยทรัพยากรโดยอัตโนมัติ ด้านล่างเป็นขั้นตอนการทำงานแบบทีละขั้นตอนพร้อมคำอธิบายการเรียก API แต่ละรายการและเคล็ดลับการปฏิบัติที่ดีที่สุดเพื่อหลีกเลี่ยงข้อผิดพลาดทั่วไป. + +### ขั้นตอนที่ 1: รับเส้นทางไปยังไฟล์อินพุต +แรก, ระบุเส้นทางเต็มไปยังไฟล์ XLSX ต้นทางที่มีหลายแท็บ. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. โหลดสเปรดชีตลงในอินสแตนซ์ของตัวแก้ไข - ต่อไป คุณจะโหลดสเปรดชีตลงใน`Editor` ตัวอย่าง. ซึ่งทำได้โดยใช้สตรีมไฟล์และระบุตัวเลือกการโหลดที่เหมาะสมสำหรับสเปรดชีต + +### ขั้นตอนที่ 2: โหลดสเปรดชีตเข้าสู่อินสแตนซ์ Editor +คลาส `Editor` เป็นจุดเริ่มต้นสำหรับการดำเนินการเอกสารทั้งหมดใน GroupDocs.Editor มันอ่านสตรีมไฟล์และเตรียมเอกสารสำหรับการแก้ไขหรือการดึงข้อมูล. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // ขั้นตอนต่อไปจะไปที่นี่ + // Further steps will go here } } ``` -## 3. สร้างเอกสารที่แก้ไขได้จากแท็บแรก - หากต้องการแก้ไขหรือจัดการแท็บใดแท็บหนึ่ง คุณจะต้องสร้าง`EditableDocument` อินสแตนซ์สำหรับแท็บนั้น แท็บถูกระบุโดยใช้ดัชนีแบบ 0 + +### ขั้นตอนที่ 3: สร้าง EditableDocument จากแท็บแรก +`EditableDocument` แทนชีตเดียวที่สามารถแก้ไขได้ภายในเวิร์กบุ๊ก ตัวสร้างรับอินสแตนซ์ `Editor` และดัชนีชีตที่เริ่มจากศูนย์. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // แท็บแรก +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. สร้างเอกสารที่แก้ไขได้จากแท็บที่สอง - ในทำนองเดียวกัน ให้สร้างไฟล์`EditableDocument` สำหรับแท็บที่สอง + +### ขั้นตอนที่ 4: สร้าง EditableDocument จากแท็บที่สอง +คุณสามารถทำซ้ำรูปแบบเดียวกันสำหรับชีตเพิ่มเติมโดยเปลี่ยนค่าดัชนี. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // แท็บที่สอง +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. บันทึกแท็บแรกลงในเอกสารแยกต่างหาก -ตอนนี้ ให้บันทึกแท็บแรกเป็นเอกสารแยกต่างหาก ระบุรูปแบบการบันทึกและเส้นทางเอาต์พุต + +### ขั้นตอนที่ 5: บันทึกแท็บแรกเป็นเอกสารแยก +`Save` เขียนเอกสารที่แก้ไขแล้วลงไฟล์ในรูปแบบที่ระบุ เรียกใช้บนอินสแตนซ์ `EditableDocument` โดยระบุเส้นทางเอาต์พุตและรูปแบบ (เช่น `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. บันทึกแท็บที่สองลงในเอกสารแยกต่างหาก -ทำซ้ำขั้นตอนสำหรับแท็บที่สอง แต่คราวนี้ให้บันทึกในรูปแบบอื่น + +### ขั้นตอนที่ 6: บันทึกแท็บที่สองเป็นเอกสารแยก +การเรียก `Save` เดียวกันทำงานกับชีตที่สอง, และคุณสามารถเลือกรูปแบบอื่นเช่น PDF หากต้องการ. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. กำจัดอินสแตนซ์เอกสารที่แก้ไขได้ - สุดท้ายนี้ ตรวจสอบให้แน่ใจว่าคุณกำจัดทิ้งอย่างถูกต้อง`EditableDocument` อินสแตนซ์เพื่อเพิ่มทรัพยากร + +### ขั้นตอนที่ 7: ปล่อย (Dispose) อินสแตนซ์ EditableDocument +`Dispose` ปล่อยทรัพยากรที่ไม่ได้จัดการซึ่งเอกสารถือครอง เช่น ตัวจัดการไฟล์, เพื่อให้แน่ใจว่าไม่มีการรั่วไหลในบริการที่ทำงานเป็นเวลานาน. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## บทสรุป -เมื่อทำตามขั้นตอนเหล่านี้ คุณจะทำงานกับสเปรดชีตแบบหลายแท็บใน .NET โดยใช้ GroupDocs.Editor ได้อย่างง่ายดาย ไลบรารีอันทรงพลังนี้ทำให้กระบวนการแก้ไขและบันทึกชีตต่างๆ ภายในสเปรดชีตง่ายขึ้น ทำให้งานการพัฒนาของคุณสามารถจัดการได้ง่ายขึ้น ไม่ว่าคุณจะจัดการกับการจัดการข้อมูลที่ซับซ้อนหรือการแก้ไขแบบง่ายๆ GroupDocs.Editor สำหรับ .NET ก็มีเครื่องมือที่คุณต้องการเพื่อให้งานสำเร็จลุล่วงได้อย่างมีประสิทธิภาพ +## ปัญหาทั่วไปและวิธีแก้ +- **ข้อผิดพลาด “File is locked”** – ตรวจสอบให้แน่ใจว่าคุณเรียก `Dispose()` บนทุก `EditableDocument` และอินสแตนซ์ `Editor`, หรือห่อหุ้มด้วยคำสั่ง `using`. +- **สไตล์หายหลังการส่งออก** – ตรวจสอบว่าคุณกำลังบันทึกเป็นรูปแบบที่รองรับการจัดรูปแบบ (เช่น XLSX หรือ PDF). CSV จะสูญเสียการจัดรูปแบบตามการออกแบบ. +- **เวิร์กบุ๊กขนาดใหญ่ทำให้ประสิทธิภาพช้า** – ใช้ตัวเลือกการโหลดแบบสตรีม (`LoadOptions.Streaming = true`) เพื่อรักษาการใช้หน่วยความจำให้ต่ำ. + ## คำถามที่พบบ่อย -### GroupDocs.Editor สำหรับ .NET คืออะไร -GroupDocs.Editor สำหรับ .NET เป็น API การแก้ไขเอกสารที่มีประสิทธิภาพซึ่งช่วยให้นักพัฒนาโหลด แก้ไข และบันทึกเอกสารในรูปแบบต่างๆ ภายในแอปพลิเคชัน .NET -### ฉันสามารถลองใช้ GroupDocs.Editor สำหรับ .NET ก่อนซื้อได้หรือไม่ - ใช่ คุณสามารถใช้[ทดลองฟรี](https://releases.groupdocs.com/) หรือขอ[ใบอนุญาตชั่วคราว](https://purchase.groupdocs.com/temporary-license/) เพื่อประเมินผลิตภัณฑ์ -### GroupDocs.Editor สำหรับ .NET รองรับไฟล์รูปแบบใดบ้าง -GroupDocs.Editor รองรับรูปแบบที่หลากหลาย รวมถึง DOCX, XLSX, PPTX, PDF และอื่นๆ อีกมากมาย -### ฉันจะรับการสนับสนุนสำหรับ GroupDocs.Editor สำหรับ .NET ได้อย่างไร - คุณสามารถรับการสนับสนุนได้โดยไปที่[ฟอรั่มการสนับสนุน](https://forum.groupdocs.com/c/editor/20). -### ฉันจะซื้อใบอนุญาตฉบับเต็มสำหรับ GroupDocs.Editor สำหรับ .NET ได้ที่ไหน - คุณสามารถซื้อใบอนุญาตฉบับสมบูรณ์ได้จาก[หน้าซื้อ](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**Q: ถ้าเวิร์กบุ๊กของฉันมีชีตที่ซ่อนอยู่จะทำอย่างไร?** +A: ชีตที่ซ่อนจะถูกจัดการเช่นเดียวกับชีตอื่น; คุณสามารถเข้าถึงโดยดัชนีและบันทึกได้, แต่คุณอาจต้องตั้งค่า `EditableDocument.IsVisible = true` ก่อนบันทึกหากต้องการให้แสดงในผลลัพธ์. + +**Q: ฉันสามารถแปลงแท็บ Excel เป็น PDF โดยตรงได้หรือไม่?** +A: ได้, ระบุ `SaveFormat.Pdf` เมื่อเรียก `Save` บน `EditableDocument`. ไลบรารีจะรักษาเลย์เอาต์, รูปภาพ, และแผนภูมิระหว่างการแปลง. + +**Q: สามารถแยกเวิร์กบุ๊กเป็นไฟล์ CSV แทน XLSX ได้หรือไม่?** +A: แน่นอน. ใช้ `SaveFormat.Csv` สำหรับแต่ละ `EditableDocument` เพื่อสร้างไฟล์ CSV แบบข้อความธรรมดาของแต่ละชีต. + +**Q: GroupDocs.Editor รองรับไฟล์ Excel ที่มีการป้องกันด้วยรหัสผ่านหรือไม่?** +A: รองรับ. ให้รหัสผ่านผ่าน `LoadOptions.Password` เมื่อสร้างอินสแตนซ์ `Editor`. + +**Q: ฉันจะหา ตัวอย่างเพิ่มเติมของการทำงานกับสเปรดชีตได้จากที่ไหน?** +A: เอกสารอย่างเป็นทางการและโครงการตัวอย่างบน [download page](https://releases.groupdocs.com/editor/net/) มีกรณีการใช้งานเพิ่มเติม. + +## สรุป +โดยทำตามขั้นตอนเหล่านี้, คุณสามารถ **บันทึกแต่ละแท็บ Excel** เป็นเอกสารอิสระ, แปลงแท็บเป็น PDF, หรือแยกเวิร์กบุ๊กขนาดใหญ่เป็นส่วนที่จัดการได้ง่าย—ทั้งหมดนี้ด้วยไลบรารี GroupDocs.Editor สำหรับ .NET ที่เชื่อถือได้และมีประสิทธิภาพสูง ความสามารถนี้ทำให้กระบวนการรายงานเป็นอัตโนมัติ, ลดการจัดการสเปรดชีตด้วยมือ, และเพิ่มประสิทธิภาพการสกัดข้อมูล. + +--- + +**Last Updated:** 2026-06-06 +**Tested With:** GroupDocs.Editor 23.11 for .NET +**Author:** GroupDocs + +--- + +## บทเรียนที่เกี่ยวข้อง + +- [ทำความเข้าใจการสกัดแท็บสเปรดชีตใน .NET ด้วย GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [ป้องกันไฟล์ Excel ด้วยรหัสผ่านโดยใช้ GroupDocs.Editor สำหรับ .NET | การจัดการสเปรดชีตอย่างปลอดภัย](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [เชี่ยวชาญการโหลดเอกสารใน .NET ด้วย GroupDocs.Editor: คู่มือฉบับสมบูรณ์](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/turkish/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/turkish/net/document-processing/work-multi-tab-spreadsheets/_index.md index 70f3842c..0603ac67 100644 --- a/content/turkish/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/turkish/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,213 @@ --- -title: Çok Sekmeli Elektronik Tablolarla Çalışma -linktitle: Çok Sekmeli Elektronik Tablolarla Çalışma -second_title: GroupDocs.Editor .NET API'si -description: GroupDocs.Editor'ı kullanarak .NET'te çok sekmeli elektronik tablolarla nasıl çalışılacağını öğrenin. Adım adım kılavuz, kod örnekleri ve en iyi uygulamalar dahildir. -weight: 17 -url: /tr/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: GroupDocs.Editor for .NET kullanarak **her Excel sekmesini kaydetmeyi** + öğrenin – adım adım kılavuz, kod parçacıkları ve XLSX dosyalarını bölme konusunda + en iyi uygulamalar. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Çoklu Sekmeli E-tablolarla Çalışma +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: GroupDocs.Editor .NET ile her Excel sekmesini kaydetme type: docs +url: /tr/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Çok Sekmeli Elektronik Tablolarla Çalışma - -## giriiş -Çok sekmeli elektronik tabloları yönetmek, özellikle aynı belge içindeki farklı sayfalardaki verileri değiştirmeniz veya çıkarmanız gerektiğinde oldukça zor bir iş olabilir. .NET ile çalışıyorsanız ve sağlam bir çözüm arıyorsanız, GroupDocs.Editor for .NET mükemmel bir seçimdir. Bu öğreticide, GroupDocs.Editor for .NET'i kullanarak çok sekmeli elektronik tablolarla çalışma sürecinde size yol göstereceğiz. Ortamınızı ayarlamaktan her sekmeyi ayrı bir dosya olarak kaydetmeye kadar her şeyi ele alacağız. -## Önkoşullar -Eğiticiye dalmadan önce aşağıdaki önkoşulların yerine getirildiğinden emin olun: -1. Visual Studio: Makinenizde Visual Studio'nun kurulu olduğundan emin olun. -2. .NET Framework: .NET için GroupDocs.Editor, .NET Framework 4.0 veya üstünü destekler. -3. GroupDocs.Editor for .NET: GroupDocs.Editor for .NET kitaplığını indirip yükleyin. Şu adresten alabilirsiniz:[indirme sayfası](https://releases.groupdocs.com/editor/net/). -4. Lisans: Bir lisansı kullanabilirsiniz.[geçici lisans](https://purchase.groupdocs.com/temporary-license/) Kitaplığı denemek için üretimde kullanıma yönelik tam lisans satın almanız önerilir. -## Ad Alanlarını İçe Aktar -Kodlamaya başlamadan önce gerekli ad alanlarını içe aktarmanız gerekir. Aşağıdaki kullanma yönergelerini .cs dosyanızın en üstüne ekleyin: + +# Çoklu Sekmeli E-Tablolarla Çalışma + +## Giriş +Eğer **her bir Excel sekmesini kaydet**meniz gerekiyorsa, GroupDocs.Editor for .NET bu süreci zahmetsiz hâle getirir. Finansal raporları çıkartıyor, departmana göre çalışma sayfaları oluşturuyor veya sekmeleri PDF'ye dönüştürüyor olsanız da, bu öğretici sizi ortam kurulumundan kaynakların serbest bırakılmasına kadar tüm iş akışı boyunca yönlendirir—böylece çoklu sayfa işlemlerini güvenle otomatikleştirebilirsiniz. + +## Hızlı Yanıtlar +- **GroupDocs.Editor bir XLSX'i ayrı dosyalara bölebilir mi?** Evet, çalışma kitabını yükleyebilir ve her sayfayı ayrı ayrı dışa aktarabilirsiniz. +- **Her sekme hangi formatlarda kaydedilebilir?** XLSX, CSV, PDF, HTML ve daha fazlası – 30'dan fazla çıktı formatı desteklenir. +- **Bu özellik için lisansa ihtiyacım var mı?** Test için geçici bir lisans yeterlidir; üretim için tam lisans gereklidir. +- **.NET Core destekleniyor mu?** Kesinlikle – kütüphane .NET Framework 4.0+ ve .NET Core/5/6+ ile çalışır. +- **Bir kerede kaç sekme işlenebilir?** GroupDocs.Editor, tüm dosyayı belleğe yüklemeden 500'den fazla sayfaya sahip çalışma kitaplarını işleyebilir. + +## “Her bir Excel sekmesini kaydet” nedir? +**“Her bir Excel sekmesini kaydet”**, çok sayfalı bir çalışma kitabındaki her çalışma sayfasını çıkartıp her birini kendi bağımsız belgesine (ör. ayrı XLSX veya PDF dosyaları) yazmak anlamına gelir. Bu yaklaşım, her sayfa için bir dosya sağlayarak sonraki işlem, raporlama ve dağıtımı basitleştirir; böylece dosyalar paylaşılabilir, arşivlenebilir veya bağımsız olarak daha da dönüştürülebilir. + +## Bu görev için neden GroupDocs.Editor kullanılmalı? +GroupDocs.Editor **30'dan fazla giriş ve çıkış formatını** destekler ve **1.000'e kadar sayfa** içeren elektronik tabloları, tüm dosyayı belleğe yüklemek yerine verileri akış olarak işleyerek düşük bellek kullanımıyla işleyebilir. API ayrıca hücre stillerini, formülleri ve gömülü resimleri korur, böylece dışa aktarılan her sekme orijinaliyle aynı görünür. + +## Ön Koşullar +Başlamadan önce, aşağıdakilere sahip olduğunuzu doğrulayın: + +1. **Visual Studio** – herhangi bir yeni sürüm (Community, Professional veya Enterprise). +2. **.NET Framework 4.0+** – ya da çapraz platform çalışma zamanı tercih ediyorsanız .NET Core/5/6. +3. **GroupDocs.Editor for .NET** – bunu [download page](https://releases.groupdocs.com/editor/net/) adresinden indirin. +4. **License** – test için bir [temporary license](https://purchase.groupdocs.com/temporary-license/) yeterlidir; üretim kullanımı için tam lisans satın alın. +5. **Free trial** – kütüphaneyi ayrıca [free trial](https://releases.groupdocs.com/) sayfasından deneyebilirsiniz. +6. **Support** – **issues** karşılaşırsanız, [support forum](https://forum.groupdocs.com/c/editor/20) adresini ziyaret edin veya **full license** için [purchase page](https://purchase.groupdocs.com/buy) sayfasını değerlendirin. + +## Ad Alanlarını İçe Aktarma +Kodlamaya başlamadan önce gerekli ad alanlarını içe aktarmanız gerekir. `.cs` dosyanızın en üstüne aşağıdaki using yönergelerini ekleyin: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Giriş Dosyasının Yolunu Alın -Öncelikle giriş e-tablosu dosyanızın yolunu belirtmeniz gerekir. Bu dosya birden fazla sekmeli bir XLSX (OOXML) olmalıdır. + +## Her bir Excel sekmesini ayrı bir dosya olarak nasıl kaydedersiniz? +Çalışma kitabını yükleyin, her sayfa için bir `EditableDocument` oluşturun ve istediğiniz formatla `Save` metodunu çağırın. Bu süreç her sekmeyi izole eder, farklı bir çıktı yolu seçmenizi sağlar ve kaynakları otomatik olarak serbest bırakır. Aşağıda, her API çağrısının açıklamaları ve yaygın hatalardan kaçınmak için en iyi uygulama ipuçlarıyla birlikte adım adım izleyeceğiniz iş akışı yer almaktadır. + +### Adım 1: Giriş Dosyasının Yolunu Alın +İlk olarak, birden fazla sekme içeren kaynak XLSX dosyasının tam yolunu belirtin. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Elektronik Tabloyu Düzenleyici Örneğine Yükleyin - Daha sonra e-tabloyu bir`Editor` misal. Bu, bir dosya akışı kullanılarak ve bir elektronik tablo için uygun yükleme seçeneklerinin belirtilmesiyle yapılır. + +### Adım 2: Elektronik Tabloyu Editor Örneğine Yükleyin +`Editor` sınıfı, GroupDocs.Editor'deki tüm belge işlemlerinin giriş noktasıdır. Dosya akışını okur ve belgeyi düzenleme ya da çıkarma için hazırlar. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Daha ileri adımlar buraya gelecek + // Further steps will go here } } ``` -## 3. İlk Sekmeden Düzenlenebilir Bir Belge Oluşturun - Belirli bir sekmeyi düzenlemek veya değiştirmek için bir`EditableDocument` bu sekme için örnek. Sekme, 0 tabanlı bir dizin kullanılarak belirtilir. + +### Adım 3: İlk Sekmeden EditableDocument Oluşturun +`EditableDocument`, çalışma kitabındaki tek bir düzenlenebilir sayfayı temsil eder. Yapıcı, `Editor` örneğini ve sıfır‑tabanlı bir sayfa indeksini alır. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // İlk sekme +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. İkinci Sekmeden Düzenlenebilir Bir Belge Oluşturun - Benzer şekilde, bir`EditableDocument` ikinci sekme için. + +### Adım 4: İkinci Sekmeden EditableDocument Oluşturun +İndeks değerini değiştirerek ek sayfalar için aynı deseni tekrarlayabilirsiniz. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // İkinci sekme +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. İlk Sekmeyi Ayrı Bir Belgeye Kaydedin -Şimdi ilk sekmeyi ayrı bir belge olarak kaydedin. Kaydetme biçimini ve çıktı yolunu belirtin. + +### Adım 5: İlk Sekmeyi Ayrı Bir Belgeye Kaydedin +`Save`, düzenlenmiş belgeyi belirtilen formatta bir dosyaya yazar. `EditableDocument` örneği üzerinde çağırın ve çıktı yolunu ve formatını (ör. `SaveFormat.Xlsx`) belirtin. + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. İkinci Sekmeyi Ayrı Bir Belgeye Kaydedin -İkinci sekme için işlemi tekrarlayın ancak bu sefer farklı bir formatta kaydedin. + +### Adım 6: İkinci Sekmeyi Ayrı Bir Belgeye Kaydedin +Aynı `Save` çağrısı ikinci sayfa için de çalışır ve gerekirse PDF gibi farklı bir format seçebilirsiniz. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. EditableDocument Örneklerini İmha Edin - Son olarak, cihazı uygun şekilde imha ettiğinizden emin olun.`EditableDocument` Kaynakları boşaltmak için örnekler. + +### Adım 7: EditableDocument Örneklerini Serbest Bırakın +`Dispose`, belge tarafından tutulan yönetilmeyen kaynakları (ör. dosya tutamaçları) serbest bırakır ve uzun süre çalışan hizmetlerde sızıntı olmadığından emin olur. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Çözüm -Bu adımları izleyerek GroupDocs.Editor'ı kullanarak .NET'teki çok sekmeli elektronik tablolarla kolayca çalışabilirsiniz. Bu güçlü kitaplık, bir elektronik tablodaki farklı sayfaları düzenleme ve kaydetme sürecini basitleştirerek geliştirme görevlerinizi daha yönetilebilir hale getirir. İster karmaşık veri işlemeyle ister basit düzenlemelerle uğraşıyor olun, GroupDocs.Editor for .NET, işi verimli bir şekilde halletmeniz için ihtiyaç duyduğunuz araçları sağlar. -## SSS'ler -### .NET için GroupDocs.Editor nedir? -GroupDocs.Editor for .NET, geliştiricilerin .NET uygulamaları içindeki çeşitli formatlardaki belgeleri yüklemesine, düzenlemesine ve kaydetmesine olanak tanıyan güçlü bir belge düzenleme API'sidir. -### Satın almadan önce GroupDocs.Editor for .NET'i deneyebilir miyim? - Evet, kullanabilirsiniz[ücretsiz deneme](https://releases.groupdocs.com/) veya bir istekte bulunun[geçici lisans](https://purchase.groupdocs.com/temporary-license/) Ürünü değerlendirmek için. -### GroupDocs.Editor for .NET hangi dosya formatlarını destekliyor? -GroupDocs.Editor, DOCX, XLSX, PPTX, PDF ve çok daha fazlasını içeren çok çeşitli formatları destekler. -### .NET için GroupDocs.Editor desteğini nasıl alabilirim? - adresini ziyaret ederek destek alabilirsiniz.[destek Forumu](https://forum.groupdocs.com/c/editor/20). -### GroupDocs.Editor for .NET'in tam lisansını nereden satın alabilirim? - Tam lisansı şuradan satın alabilirsiniz:[satın alma sayfası](https://purchase.groupdocs.com/buy). \ No newline at end of file +## Yaygın Sorunlar ve Çözümler +- **“File is locked” hataları** – Her `EditableDocument` ve `Editor` örneği üzerinde `Dispose()` çağrısı yaptığınızdan emin olun veya `using` ifadeleriyle sarın. +- **Dışa aktarma sonrası eksik stiller** – Stil desteği sunan bir formata (ör. XLSX veya PDF) kaydettiğinizi doğrulayın. CSV tasarım gereği biçimlendirmeyi kaybeder. +- **Büyük çalışma kitapları yavaş performansa neden olur** – Bellek kullanımını düşük tutmak için akış yükleme seçeneklerini (`LoadOptions.Streaming = true`) kullanın. + +## Sık Sorulan Sorular + +**S: Çalışma kitabım gizli sayfalar içeriyorsa ne olur?** +C: Gizli sayfalar diğer sayfalar gibi ele alınır; indeksle erişebilir ve kaydedebilirsiniz, ancak çıktıda görünür olmalarını istiyorsanız kaydetmeden önce `EditableDocument.IsVisible = true` ayarlamanız gerekebilir. + +**S: Bir Excel sekmesini doğrudan PDF'ye dönüştürebilir miyim?** +C: Evet, `EditableDocument` üzerinde `Save` çağrısı yaparken `SaveFormat.Pdf` belirtebilirsiniz. Kütüphane dönüşüm sırasında düzeni, resimleri ve grafikleri korur. + +**S: Bir çalışma kitabını XLSX yerine CSV dosyalarına bölmek mümkün mü?** +C: Kesinlikle. Her `EditableDocument` için `SaveFormat.Csv` kullanarak her sayfanın düz metin CSV temsillerini oluşturabilirsiniz. + +**S: GroupDocs.Editor şifre korumalı Excel dosyalarını destekliyor mu?** +C: Evet. `Editor` örneğini oluştururken şifreyi `LoadOptions.Password` aracılığıyla sağlayın. + +**S: Elektronik tablolarla çalışmaya dair daha fazla örnek nerede bulunabilir?** +C: Resmi dokümantasyon ve örnek projeler [download page](https://releases.groupdocs.com/editor/net/) adresinde ek kullanım senaryoları içerir. + +## Sonuç +Bu adımları izleyerek **her bir Excel sekmesini** bağımsız bir belge olarak kaydedebilir, sekmeleri PDF'ye dönüştürebilir veya büyük çalışma kitaplarını yönetilebilir parçalara bölebilirsiniz—hepsi güvenilir ve yüksek performanslı GroupDocs.Editor for .NET kütüphanesi ile. Bu yetenek raporlama süreçlerini basitleştirir, veri çıkarımını otomatikleştirir ve manuel elektronik tablo işlemlerini azaltır. + +--- + +**Son Güncelleme:** 2026-06-06 +**Test Edilen Versiyon:** GroupDocs.Editor 23.11 for .NET +**Yazar:** GroupDocs + +--- + +## İlgili Öğreticiler + +- [GroupDocs.Editor ile .NET'te Elektronik Tablo Sekmesi Çıkarma Uzmanı](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [GroupDocs.Editor for .NET ile Excel Dosyalarını Şifreleme | Güvenli Elektronik Tablo Yönetimi](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [GroupDocs.Editor ile .NET'te Belge Yüklemeyi Ustalıkla Öğrenme: Kapsamlı Rehber](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file diff --git a/content/vietnamese/net/document-processing/work-multi-tab-spreadsheets/_index.md b/content/vietnamese/net/document-processing/work-multi-tab-spreadsheets/_index.md index 44b5cb6f..c8f959d3 100644 --- a/content/vietnamese/net/document-processing/work-multi-tab-spreadsheets/_index.md +++ b/content/vietnamese/net/document-processing/work-multi-tab-spreadsheets/_index.md @@ -1,92 +1,208 @@ --- -title: Làm việc với Bảng tính nhiều tab -linktitle: Làm việc với Bảng tính nhiều tab -second_title: API GroupDocs.Editor .NET -description: Tìm hiểu cách làm việc với bảng tính nhiều tab trong .NET bằng GroupDocs.Editor. Bao gồm hướng dẫn từng bước, ví dụ về mã và các phương pháp hay nhất. -weight: 17 -url: /vi/net/document-processing/work-multi-tab-spreadsheets/ +date: 2026-06-06 +description: Tìm hiểu cách **lưu mỗi tab Excel** bằng GroupDocs.Editor cho .NET – + hướng dẫn từng bước, đoạn mã mẫu và các thực tiễn tốt nhất để tách các tệp XLSX. +keywords: +- save each excel tab +- read multiple sheets +- convert excel tab pdf +- split xlsx files +linktitle: Làm việc với bảng tính đa tab +schemas: +- author: GroupDocs + dateModified: '2026-06-06' + description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + headline: How to save each Excel tab with GroupDocs.Editor .NET + type: TechArticle +- description: Learn how to **save each Excel tab** using GroupDocs.Editor for .NET + – step‑by‑step guide, code snippets, and best practices for splitting XLSX files. + name: How to save each Excel tab with GroupDocs.Editor .NET + steps: + - name: Get a Path to the Input File + text: First, specify the full path to the source XLSX that contains multiple tabs. + - name: Load the Spreadsheet into the Editor Instance + text: The `Editor` class is the entry point for all document operations in GroupDocs.Editor. + It reads the file stream and prepares the document for editing or extraction. + - name: Create an EditableDocument from the First Tab + text: '`EditableDocument` represents a single, editable sheet within the workbook. + The constructor takes the `Editor` instance and a zero‑based sheet index.' + - name: Create an EditableDocument from the Second Tab + text: You can repeat the same pattern for any additional sheet by changing the + index value. + - name: Save the First Tab to a Separate Document + text: '`Save` writes the edited document to a file in the specified format. Call + it on the `EditableDocument` instance, providing the output path and format + (e.g., `SaveFormat.Xlsx`).' + - name: Save the Second Tab to a Separate Document + text: The same `Save` call works for the second sheet, and you can choose a different + format such as PDF if needed. + - name: Dispose of EditableDocument Instances + text: '`Dispose` releases unmanaged resources held by the document, such as file + handles, ensuring no leaks in long‑running services.' + type: HowTo +- questions: + - answer: Hidden sheets are treated like any other sheet; you can access them by + index and save them, but you may need to set `EditableDocument.IsVisible = true` + before saving if you want them visible in the output. + question: What if my workbook contains hidden sheets? + - answer: Yes, specify `SaveFormat.Pdf` when calling `Save` on the `EditableDocument`. + The library preserves layout, images, and charts during conversion. + question: Can I convert an Excel tab directly to PDF? + - answer: Absolutely. Use `SaveFormat.Csv` for each `EditableDocument` to generate + plain‑text CSV representations of each sheet. + question: Is it possible to split a workbook into CSV files instead of XLSX? + - answer: It does. Provide the password via `LoadOptions.Password` when creating + the `Editor` instance. + question: Does GroupDocs.Editor support password‑protected Excel files? + - answer: The official documentation and sample projects on the [download page](https://releases.groupdocs.com/editor/net/) + contain additional use‑cases. + question: Where can I find more examples of working with spreadsheets? + type: FAQPage +second_title: GroupDocs.Editor .NET API +title: Cách lưu mỗi tab Excel bằng GroupDocs.Editor .NET type: docs +url: /vi/net/document-processing/work-multi-tab-spreadsheets/ +weight: 17 --- -# Làm việc với Bảng tính nhiều tab + +# Làm việc với Bảng tính Đa Tab ## Giới thiệu -Xử lý bảng tính nhiều tab có thể là một công việc khá khó khăn, đặc biệt khi bạn cần thao tác hoặc trích xuất dữ liệu từ các trang tính khác nhau trong cùng một tài liệu. Nếu bạn đang làm việc với .NET và đang tìm kiếm một giải pháp mạnh mẽ thì GroupDocs.Editor dành cho .NET là một lựa chọn tuyệt vời. Trong hướng dẫn này, chúng tôi sẽ hướng dẫn bạn quy trình làm việc với bảng tính nhiều tab bằng GroupDocs.Editor cho .NET. Chúng tôi sẽ đề cập đến mọi thứ từ việc thiết lập môi trường của bạn đến lưu từng tab dưới dạng một tệp riêng biệt. -## Điều kiện tiên quyết -Trước khi đi sâu vào hướng dẫn, hãy đảm bảo bạn có sẵn các điều kiện tiên quyết sau: -1. Visual Studio: Đảm bảo bạn đã cài đặt Visual Studio trên máy của mình. -2. .NET Framework: GroupDocs.Editor cho .NET hỗ trợ .NET Framework 4.0 trở lên. -3. GroupDocs.Editor cho .NET: Tải xuống và cài đặt thư viện GroupDocs.Editor cho .NET. Bạn có thể lấy nó từ[trang tải xuống](https://releases.groupdocs.com/editor/net/). -4. Giấy phép: Mặc dù bạn có thể sử dụng[giấy phép tạm thời](https://purchase.groupdocs.com/temporary-license/) để dùng thử thư viện, bạn nên mua giấy phép đầy đủ để sử dụng sản xuất. +Nếu bạn cần **lưu mỗi tab Excel** dưới dạng một tệp độc lập, GroupDocs.Editor for .NET giúp việc này trở nên dễ dàng. Dù bạn đang trích xuất báo cáo tài chính, tạo các worksheet theo phòng ban, hay chuyển đổi các tab sang PDF, hướng dẫn này sẽ dẫn bạn qua toàn bộ quy trình — từ cài đặt môi trường đến giải phóng tài nguyên — để bạn có thể tự động xử lý đa sheet một cách tự tin. + +## Câu trả lời nhanh +- **GroupDocs.Editor có thể tách một tệp XLSX thành các tệp riêng biệt không?** Có, bạn có thể tải workbook và xuất mỗi sheet riêng lẻ. +- **Các định dạng nào mà mỗi tab có thể được lưu?** XLSX, CSV, PDF, HTML và hơn nữa – hơn 30 định dạng đầu ra được hỗ trợ. +- **Tôi có cần giấy phép cho tính năng này không?** Giấy phép tạm thời hoạt động cho việc thử nghiệm; giấy phép đầy đủ là bắt buộc cho môi trường sản xuất. +- **.NET Core có được hỗ trợ không?** Chắc chắn – thư viện hoạt động với .NET Framework 4.0+ và .NET Core/5/6+. +- **Có bao nhiêu tab có thể được xử lý cùng một lúc?** GroupDocs.Editor có thể xử lý workbook với hơn 500 sheet mà không cần tải toàn bộ tệp vào bộ nhớ. + +## “Lưu mỗi tab Excel” là gì? +**“Save each Excel tab”** có nghĩa là trích xuất mỗi worksheet từ một workbook đa sheet và ghi mỗi sheet vào một tài liệu độc lập riêng (ví dụ: các tệp XLSX hoặc PDF riêng biệt). Cách tiếp cận này đơn giản hoá việc xử lý, báo cáo và phân phối downstream bằng cách cung cấp cho bạn một tệp cho mỗi sheet, sau đó có thể được chia sẻ, lưu trữ hoặc chuyển đổi thêm một cách độc lập. + +## Tại sao nên sử dụng GroupDocs.Editor cho nhiệm vụ này? +GroupDocs.Editor hỗ trợ **hơn 30 định dạng đầu vào và đầu ra** và có thể xử lý bảng tính với **tối đa 1.000 sheet** trong khi giữ mức sử dụng bộ nhớ thấp bằng cách stream dữ liệu thay vì tải toàn bộ tệp. API cũng bảo tồn các kiểu ô, công thức và hình ảnh nhúng, đảm bảo mỗi tab được xuất ra trông giống hệt bản gốc. + +## Yêu cầu trước +1. **Visual Studio** – bất kỳ phiên bản gần đây nào (Community, Professional, hoặc Enterprise). +2. **.NET Framework 4.0+** – hoặc .NET Core/5/6 nếu bạn ưu tiên runtime đa nền tảng. +3. **GroupDocs.Editor for .NET** – tải xuống từ [download page](https://releases.groupdocs.com/editor/net/). +4. **License** – một [temporary license](https://purchase.groupdocs.com/temporary-license/) là đủ cho việc thử nghiệm; mua giấy phép đầy đủ cho môi trường sản xuất. +5. **Free trial** – bạn cũng có thể thử thư viện qua trang [free trial](https://releases.groupdocs.com/). +6. **Support** – nếu bạn gặp vấn đề, truy cập [support forum](https://forum.groupdocs.com/c/editor/20) hoặc xem xét [purchase page](https://purchase.groupdocs.com/buy) để mua giấy phép đầy đủ. + ## Nhập không gian tên -Trước khi bắt đầu viết mã, bạn cần nhập các không gian tên cần thiết. Thêm các lệnh sử dụng sau vào đầu tệp .cs của bạn: +Trước khi bắt đầu viết mã, bạn cần nhập các không gian tên cần thiết. Thêm các chỉ thị using sau vào đầu file `.cs` của bạn: + ```csharp using System.IO; using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; ``` -## 1. Nhận đường dẫn đến tệp đầu vào -Trước tiên, bạn cần chỉ định đường dẫn đến tệp bảng tính đầu vào của mình. Tệp này phải là XLSX (OOXML) có nhiều tab. + +## Cách lưu mỗi tab Excel thành một tệp riêng biệt? +Tải workbook, tạo một `EditableDocument` cho mỗi sheet, và gọi `Save` với định dạng mong muốn. Quá trình này tách riêng mỗi tab, cho phép bạn chọn đường dẫn đầu ra riêng biệt, và tự động giải phóng tài nguyên. Dưới đây là quy trình từng bước bạn sẽ thực hiện, kèm giải thích cho mỗi lời gọi API và các mẹo thực hành tốt để tránh những lỗi thường gặp. + +### Bước 1: Lấy Đường dẫn tới Tệp Đầu vào +Đầu tiên, chỉ định đường dẫn đầy đủ tới tệp XLSX nguồn chứa nhiều tab. + ```csharp string inputFilePath = "Your Sample Document"; ``` -## 2. Tải Bảng tính vào Phiên bản Trình soạn thảo - Tiếp theo, bạn sẽ tải bảng tính vào một`Editor` ví dụ. Việc này được thực hiện bằng cách sử dụng luồng tệp và chỉ định các tùy chọn tải thích hợp cho bảng tính. + +### Bước 2: Tải Bảng tính vào Instance Editor +Lớp `Editor` là điểm vào cho tất cả các thao tác tài liệu trong GroupDocs.Editor. Nó đọc luồng tệp và chuẩn bị tài liệu để chỉnh sửa hoặc trích xuất. + ```csharp using (FileStream inputStream = File.OpenRead(inputFilePath)) { using (Editor editor = new Editor(delegate { return inputStream; }, delegate { return new SpreadsheetLoadOptions(); })) { - // Các bước tiếp theo sẽ diễn ra ở đây + // Further steps will go here } } ``` -## 3. Tạo Tài liệu có thể chỉnh sửa từ Tab đầu tiên - Để chỉnh sửa hoặc thao tác trên một tab cụ thể, bạn cần tạo một`EditableDocument` ví dụ cho tab đó. Tab được chỉ định bằng chỉ mục dựa trên 0. + +### Bước 3: Tạo EditableDocument từ Tab Đầu tiên +`EditableDocument` đại diện cho một sheet duy nhất, có thể chỉnh sửa trong workbook. Hàm khởi tạo nhận instance `Editor` và chỉ số sheet bắt đầu từ 0. + ```csharp SpreadsheetEditOptions editOptions1 = new SpreadsheetEditOptions(); -editOptions1.WorksheetIndex = 0; // Tab đầu tiên +editOptions1.WorksheetIndex = 0; // First tab EditableDocument firstTabBeforeEdit = editor.Edit(editOptions1); ``` -## 4. Tạo Tài liệu có thể chỉnh sửa từ Tab thứ hai - Tương tự, tạo một`EditableDocument` cho tab thứ hai. + +### Bước 4: Tạo EditableDocument từ Tab Thứ hai +Bạn có thể lặp lại cùng mẫu cho bất kỳ sheet bổ sung nào bằng cách thay đổi giá trị chỉ số. + ```csharp SpreadsheetEditOptions editOptions2 = new SpreadsheetEditOptions(); -editOptions2.WorksheetIndex = 1; // Tab thứ hai +editOptions2.WorksheetIndex = 1; // Second tab EditableDocument secondTabBeforeEdit = editor.Edit(editOptions2); ``` -## 5. Lưu tab đầu tiên vào một tài liệu riêng -Bây giờ, hãy lưu tab đầu tiên dưới dạng một tài liệu riêng biệt. Chỉ định định dạng lưu và đường dẫn đầu ra. + +### Bước 5: Lưu Tab Đầu tiên thành Tài liệu Riêng biệt +`Save` ghi tài liệu đã chỉnh sửa vào tệp với định dạng được chỉ định. Gọi nó trên instance `EditableDocument`, cung cấp đường dẫn đầu ra và định dạng (ví dụ: `SaveFormat.Xlsx`). + ```csharp SpreadsheetSaveOptions saveOptions1 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsm); string outputFilename1 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab1.xlsm"; string outputPath1 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename1); editor.Save(firstTabBeforeEdit, outputPath1, saveOptions1); ``` -## 6. Lưu tab thứ hai vào một tài liệu riêng -Lặp lại quy trình cho tab thứ hai, nhưng lần này hãy lưu nó ở định dạng khác. + +### Bước 6: Lưu Tab Thứ hai thành Tài liệu Riêng biệt +Lệnh `Save` tương tự hoạt động cho sheet thứ hai, và bạn có thể chọn định dạng khác như PDF nếu cần. + ```csharp SpreadsheetSaveOptions saveOptions2 = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsb); string outputFilename2 = Path.GetFileNameWithoutExtension(inputFilePath) + "_tab2.xlsb"; string outputPath2 = Path.Combine(Constants.GetOutputDirectoryPath(inputFilePath), outputFilename2); editor.Save(secondTabBeforeEdit, outputPath2, saveOptions2); ``` -## 7. Vứt bỏ các phiên bản Tài liệu có thể chỉnh sửa - Cuối cùng, hãy đảm bảo rằng bạn vứt bỏ đúng cách`EditableDocument` trường hợp để giải phóng tài nguyên. + +### Bước 7: Giải phóng các Instance EditableDocument +`Dispose` giải phóng các tài nguyên không quản lý do tài liệu giữ, như các handle tệp, đảm bảo không có rò rỉ trong các dịch vụ chạy lâu. + ```csharp firstTabBeforeEdit.Dispose(); secondTabBeforeEdit.Dispose(); ``` -## Phần kết luận -Bằng cách làm theo các bước này, bạn có thể dễ dàng làm việc với bảng tính nhiều tab trong .NET bằng GroupDocs.Editor. Thư viện mạnh mẽ này đơn giản hóa quá trình chỉnh sửa và lưu các trang tính khác nhau trong bảng tính, giúp các tác vụ phát triển của bạn dễ quản lý hơn. Cho dù bạn đang xử lý các thao tác dữ liệu phức tạp hay các chỉnh sửa đơn giản, GroupDocs.Editor dành cho .NET đều cung cấp các công cụ bạn cần để hoàn thành công việc một cách hiệu quả. +## Các vấn đề thường gặp và giải pháp +- **“File is locked” errors** – Đảm bảo bạn gọi `Dispose()` trên mọi `EditableDocument` và instance `Editor`, hoặc bọc chúng trong câu lệnh `using`. +- **Missing styles after export** – Kiểm tra rằng bạn đang lưu sang định dạng hỗ trợ kiểu dáng (ví dụ: XLSX hoặc PDF). CSV sẽ mất định dạng theo thiết kế. +- **Large workbooks cause slow performance** – Sử dụng tùy chọn tải streaming (`LoadOptions.Streaming = true`) để giữ mức sử dụng bộ nhớ thấp. + ## Câu hỏi thường gặp -### GroupDocs.Editor dành cho .NET là gì? -GroupDocs.Editor cho .NET là API chỉnh sửa tài liệu mạnh mẽ cho phép các nhà phát triển tải, chỉnh sửa và lưu tài liệu ở nhiều định dạng khác nhau trong các ứng dụng .NET. -### Tôi có thể dùng thử GroupDocs.Editor cho .NET trước khi mua không? - Có, bạn có thể sử dụng một[dùng thử miễn phí](https://releases.groupdocs.com/) hoặc yêu cầu một[giấy phép tạm thời](https://purchase.groupdocs.com/temporary-license/) để đánh giá sản phẩm. -### Những định dạng tệp nào được GroupDocs.Editor hỗ trợ cho .NET? -GroupDocs.Editor hỗ trợ nhiều định dạng, bao gồm DOCX, XLSX, PPTX, PDF, v.v. -### Làm cách nào để nhận được hỗ trợ cho GroupDocs.Editor cho .NET? - Bạn có thể nhận được hỗ trợ bằng cách truy cập[diễn đàn hỗ trợ](https://forum.groupdocs.com/c/editor/20). -### Tôi có thể mua giấy phép đầy đủ cho GroupDocs.Editor cho .NET ở đâu? - Bạn có thể mua giấy phép đầy đủ từ[trang mua hàng](https://purchase.groupdocs.com/buy). \ No newline at end of file + +**Q: Nếu workbook của tôi chứa các sheet ẩn thì sao?** +A: Các sheet ẩn được xử lý giống như bất kỳ sheet nào khác; bạn có thể truy cập chúng bằng chỉ số và lưu, nhưng có thể cần đặt `EditableDocument.IsVisible = true` trước khi lưu nếu muốn chúng hiển thị trong đầu ra. + +**Q: Tôi có thể chuyển đổi một tab Excel trực tiếp sang PDF không?** +A: Có, chỉ định `SaveFormat.Pdf` khi gọi `Save` trên `EditableDocument`. Thư viện bảo tồn bố cục, hình ảnh và biểu đồ trong quá trình chuyển đổi. + +**Q: Có thể tách một workbook thành các tệp CSV thay vì XLSX không?** +A: Chắc chắn. Sử dụng `SaveFormat.Csv` cho mỗi `EditableDocument` để tạo ra các biểu diễn CSV dạng văn bản thuần cho mỗi sheet. + +**Q: GroupDocs.Editor có hỗ trợ các tệp Excel được bảo vệ bằng mật khẩu không?** +A: Có. Cung cấp mật khẩu qua `LoadOptions.Password` khi tạo instance `Editor`. + +**Q: Tôi có thể tìm thêm ví dụ về làm việc với bảng tính ở đâu?** +A: Tài liệu chính thức và các dự án mẫu trên [download page](https://releases.groupdocs.com/editor/net/) chứa các trường hợp sử dụng bổ sung. + +## Kết luận +Bằng cách thực hiện các bước này, bạn có thể **lưu mỗi tab Excel** thành một tài liệu độc lập, chuyển đổi các tab sang PDF, hoặc tách các workbook lớn thành các phần dễ quản lý — tất cả đều với thư viện GroupDocs.Editor cho .NET đáng tin cậy, hiệu năng cao. Khả năng này giúp đơn giản hoá quy trình báo cáo, tự động hoá việc trích xuất dữ liệu, và giảm bớt việc xử lý bảng tính thủ công. + +--- + +**Cập nhật lần cuối:** 2026-06-06 +**Được kiểm tra với:** GroupDocs.Editor 23.11 for .NET +**Tác giả:** GroupDocs + +## Hướng dẫn liên quan + +- [Nắm bắt việc trích xuất Tab Bảng tính trong .NET với GroupDocs.Editor](/editor/net/spreadsheet-documents/mastering-spreadsheet-tab-extraction-dotnet-groupdocs-editor/) +- [Bảo vệ mật khẩu cho tệp Excel bằng GroupDocs.Editor cho .NET | Quản lý Bảng tính An toàn](/editor/net/spreadsheet-documents/groupdocs-editor-net-password-excel-files/) +- [Thành thạo việc tải tài liệu trong .NET với GroupDocs.Editor: Hướng dẫn toàn diện](/editor/net/document-loading/groupdocs-editor-net-document-loading-guide/) \ No newline at end of file