This file contains hidden or 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
| // Load input HTML from URL | |
| HTMLDocument document = new HTMLDocument("https://www.aspose.com"); | |
| // Initialize PdfPermissions class object to allow printing and form filling in the PDF document | |
| PdfPermissions permissions = PdfPermissions.PrintDocument | PdfPermissions.FillForm; | |
| // Initialize PdfSaveOptions class object and set the encryption properties | |
| PdfSaveOptions options = new PdfSaveOptions(); | |
| options.Encryption = new PdfEncryptionInfo("user", "owner", permissions, Encryption.PdfEncryptionAlgorithm.RC4_128); |
This file contains hidden or 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
| // Load input PDF document | |
| Document pdfDocument = new Document(dataDir + "Input.pdf"); | |
| // Access any page of the input PDF | |
| Page testpage = pdfDocument.Pages[1]; | |
| // Create image stamp | |
| ImageStamp imageStamp = new ImageStamp(dataDir + "aspose-logo.png"); | |
| imageStamp.Background = true; | |
| imageStamp.Height = 300; |
This file contains hidden or 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
| // Set license for all APIs one by one | |
| Aspose.Words.License WordsLicense = new Aspose.Words.License(); | |
| WordsLicense.SetLicense(@"D:\Test\Aspose.Total.Product.Family.lic"); | |
| // Comment the code if you do not want to set license for any of the API | |
| //Aspose.Pdf.License PdfLicense = new Aspose.Pdf.License(); | |
| //PdfLicense.SetLicense(@"D:\Test\Aspose.Total.Product.Family.lic"); | |
| Aspose.Cells.License CellsLicense = new Aspose.Cells.License(); | |
| CellsLicense.SetLicense(@"D:\Test\Aspose.Total.Product.Family.lic"); |
This file contains hidden or 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
| Aspose.Words.License license = new Aspose.Words.License(); | |
| // This line attempts to set a license from several locations relative to the executable and Aspose.Words.dll. | |
| // You can also use the additional overload to load a license from a stream, this is useful for instance when the | |
| // license is stored as an embedded resource | |
| try | |
| { | |
| license.SetLicense("Aspose.Words.lic"); | |
| Console.WriteLine("License set successfully."); | |
| } |
This file contains hidden or 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
| auto doc = System::MakeObject<XpsDocument>(); | |
| // Geometry for magenta grid VisualBrush | |
| System::SharedPtr<XpsPathGeometry> pathGeometry = doc->CreatePathGeometry(); | |
| pathGeometry->AddSegment(doc->CreatePolyLineSegment(System::MakeArray<System::Drawing::PointF>({ System::Drawing::PointF(240.f, 5.f), System::Drawing::PointF(240.f, 310.f), System::Drawing::PointF(0.f, 310.f) }))); | |
| pathGeometry->idx_get(0)->set_StartPoint(System::Drawing::PointF(0.f, 5.f)); | |
| // Canvas for magenta grid VisualBrush | |
| System::SharedPtr<XpsCanvas> visualCanvas = doc->CreateCanvas(); |
This file contains hidden or 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
| // Create new XPS Document | |
| System::SharedPtr<XpsDocument> doc = System::MakeObject<XpsDocument>(); | |
| // Add Image | |
| System::SharedPtr<XpsPath> path = doc->AddPath(doc->CreatePathGeometry(u"M 30,20 l 258.24,0 0,56.64 -258.24,0 Z")); | |
| // Creating a matrix is optional, it can be used for proper positioning | |
| path->set_RenderTransform(doc->CreateMatrix(0.7f, 0.f, 0.f, 0.7f, 0.f, 20.f)); | |
| //Create Image Brush |
This file contains hidden or 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
| // The path to the documents directory. | |
| string sourceFilePath = MyDir + "50states.plt"; | |
| // Load input PLT file | |
| using (Image cadImage = Image.Load(sourceFilePath)) | |
| { | |
| // Initilize JpegOptions class instance | |
| ImageOptionsBase imageOptions = new JpegOptions(); | |
| // Specify CadRasterizationOptions properties |
This file contains hidden or 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
| String content = File.ReadAllText(dataDir1 + "Product.html"); | |
| // Create an instance of HTML document | |
| var document = new HTMLDocument(content, ""); | |
| // Split HTML webpage to multiple files | |
| // find all paragraph elements inside document by using CSS Selector Query | |
| var elements = document.QuerySelectorAll("p"); | |
| for (int i = 0; i < elements.Length; i++) | |
| { | |
| // create an empty document to export content |
This file contains hidden or 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
| String dataDir = Utils.getDataDir(AIToJPG.class) + "AI/"; | |
| String sourceFileName = dataDir + "34992OStroke.ai"; | |
| String outFileName = dataDir + "34992OStroke.jpg"; | |
| // Load input AI file | |
| AiImage image = (AiImage)Image.load(sourceFileName); | |
| // Initialize JpegOptions class instance | |
| JpegOptions options = new JpegOptions(); |
This file contains hidden or 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
| // Load the FBX file to be converted | |
| Scene scene = new Scene(dataDir + "Test1.fbx"); | |
| // Save in wavefront OBJ file format | |
| scene.Save(dir + "output.obj", FileFormat.WavefrontOBJ); |