Browse our Products Toggle navigation
If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.
This version of the API has implemented the support for custom colored / grayscale printing mode. This allows to handle the printing of non-colored pages on the color printing devices.
The following C# sample code demonstrates how to specify color printing mode as GrayscaleAuto using API:
GrayscaleAuto
Document document = new Document(filename); // Select the required printer. PrinterSettings printerSettings = new PrinterSettings(); printerSettings.PrinterName = "Microsoft Print to PDF"; // Specify the pages to print. printerSettings.FromPage = 1; printerSettings.ToPage = doc.PageCount; AsposeWordsPrintDocument printDoc = new AsposeWordsPrintDocument(doc); printDoc.PrinterSettings = printerSettings; // Specify the new color print mode. printDoc.ColorMode = ColorPrintMode.GrayscaleAuto; printDoc.Print(); // Return the numer of pages printed in color. return printDoc.ColorPagesPrinted;
Now the API has the ability to let you create the structured document tags (SDT) of the type “Citation”.
Document doc = new Document(); // Create a structured document tag of the Citation type. StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.Citation, MarkupLevel.Inline); // Append to a paragraph. Paragraph paragraph = doc.FirstSection.Body.FirstParagraph; paragraph.AppendChild(sdt); // Create a Citation field. DocumentBuilder builder = new DocumentBuilder(doc); builder.MoveToParagraph(0, -1); builder.InsertField(@"CITATION Ath22 \l 1033 ", "(Author1, 2022)"); // Move the field to the structured document tag. while (sdt.NextSibling != null) sdt.AppendChild(sdt.NextSibling); doc.Save("output.docx");
If the document format of the input file is unidentified or unknown, then the format of that input file will be set to .txt.
.txt
public static void Main(string[] args) { string content = new string('\u0000', 20); File.WriteAllText("a.doc", content); OpenDoc("a.doc"); File.WriteAllText("b.docx", content); OpenDoc("b.docx"); } private static void OpenDoc(string fileName) { try { Document doc = new Document(fileName); } catch (UnsupportedFileFormatException e) { Console.WriteLine("{0} is opened with exception", fileName); return; } Console.WriteLine("{0} is opened successfully", fileName); } // The code produces the following output: // a.doc is opened successfully // b.docx is opened with exception
For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.Words for .NET 22.11 Release Notes.