Импортировать 3D Сцены и Содержание из PDF в C#
Contents
[
Hide
]
Класс
Scene
из Aspose.3D API представляет сцену 3D. Разработчики могут извлекать сцены и содержимое 3D из файла PDF.
Открыть сцену из защищенного паролем PDF
Метод Open
класса Scene
позволяет загрузить сцену 3D из входного файла PDF. Разработчики также могут применять пароль для защищенных PDF-файлов, используя класс PdfLoadOptions
, как показано в этом примере кода C#:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Create a new scene | |
Scene scene = new Scene(); | |
// Use loading options and apply password | |
PdfLoadOptions opt = new PdfLoadOptions() { Password = Encoding.UTF8.GetBytes("password") }; | |
// Open scene | |
scene.Open("House_Design.pdf", opt); |
Извлеките все необработанное содержимое 3D из PDF
Метод Extract класса PdfFormat
позволяет извлечь содержимое 3D из файла PDF. Разработчики могут перебирать содержимое и сохранять его в отдельные файлы, как показано в этом примере кода C#:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// The path to the documents directory. | |
byte[] password = null; | |
// Extract 3D contents | |
List<byte[]> contents = FileFormat.PDF.Extract("House_Design.pdf", password); | |
int i = 1; | |
// Iterate through the contents and in separate 3D files | |
foreach (byte[] content in contents) | |
{ | |
string fileName = "3d-" + (i++); | |
File.WriteAllBytes(fileName, content); | |
} |
Извлеките все сцены 3D и сохраните их в поддерживаемых форматах 3D
Метод ExtractScene
класса PdfFormat
позволяет извлекать сцены 3D из файла PDF. Разработчики могут перебирать сцены и сохранять их в поддерживаемых форматах файлов 3D, как показано в этом примере кода C#:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
byte[] password = null; | |
List<Scene> scenes = FileFormat.PDF.ExtractScene("House_Design.pdf", password); | |
int i = 1; | |
// Iterate through the scenes and save in 3D files | |
foreach (Scene scene in scenes) | |
{ | |
string fileName = "3d-" + (i++) + ".fbx"; | |
scene.Save(RunExamples.GetOutputFilePath(fileName), FileFormat.FBX7400ASCII); | |
} |
Все поддерживаемые форматы файлов 3D перечислены на странице Обзор продукта.