Ejemplo n.º 1
0
        public void RasterizeTransformedElements()
        {
            //ExStart:RasterizeTransformedElements
            Document doc = new Document(MyDir + "Rendering.docx");

            PclSaveOptions saveOptions = new PclSaveOptions
            {
                SaveFormat = SaveFormat.Pcl, RasterizeTransformedElements = false
            };

            doc.Save(ArtifactsDir + "WorkingWithPclSaveOptions.RasterizeTransformedElements.pcl", saveOptions);
            //ExEnd:RasterizeTransformedElements
        }
Ejemplo n.º 2
0
        public void RasterizeElements()
        {
            //ExStart
            //ExFor:PclSaveOptions
            //ExFor:PclSaveOptions.RasterizeTransformedElements
            //ExSummary:Shows how rasterized or not transformed elements before saving.
            Document doc = new Document(MyDir + "Document.EpubConversion.doc");

            PclSaveOptions saveOptions = new PclSaveOptions();

            saveOptions.RasterizeTransformedElements = true;

            doc.Save(MyDir + @"\Artifacts\Document.EpubConversion.pcl", saveOptions);
            //ExEnd
        }
        public void SetPrinterFont()
        {
            //ExStart
            //ExFor:PclSaveOptions.AddPrinterFont(string, string)
            //ExFor:PclSaveOptions.FallbackFontName
            //ExSummary:Shows how to add information about font that is uploaded to the printer and set the font that will be used if no expected font is found in printer and built-in fonts collections.
            Document doc = new Document(MyDir + "Document.EpubConversion.doc");

            PclSaveOptions saveOptions = new PclSaveOptions();

            saveOptions.AddPrinterFont("Courier", "Courier");
            saveOptions.FallbackFontName = "Times New Roman";

            doc.Save(ArtifactsDir + "Document.EpubConversion.pcl", saveOptions);
            //ExEnd
        }
Ejemplo n.º 4
0
        public void RasterizeElements()
        {
            //ExStart
            //ExFor:PclSaveOptions
            //ExFor:PclSaveOptions.SaveFormat
            //ExFor:PclSaveOptions.RasterizeTransformedElements
            //ExSummary:Shows how to rasterize complex elements while saving a document to PCL.
            Document doc = new Document(MyDir + "Rendering.docx");

            PclSaveOptions saveOptions = new PclSaveOptions
            {
                SaveFormat = SaveFormat.Pcl,
                RasterizeTransformedElements = true
            };

            doc.Save(ArtifactsDir + "PclSaveOptions.RasterizeElements.pcl", saveOptions);
            //ExEnd
        }
Ejemplo n.º 5
0
        public void AddPrinterFont()
        {
            //ExStart
            //ExFor:PclSaveOptions.AddPrinterFont(string, string)
            //ExSummary:Shows how to get a printer to substitute all instances of a specific font with a different font.
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            builder.Font.Name = "Courier";
            builder.Write("Hello world!");

            PclSaveOptions saveOptions = new PclSaveOptions();

            saveOptions.AddPrinterFont("Courier New", "Courier");

            // When printing this document, the printer will use the "Courier New" font
            // to access places where our document used the "Courier" font.
            doc.Save(ArtifactsDir + "PclSaveOptions.AddPrinterFont.pcl", saveOptions);
            //ExEnd
        }
Ejemplo n.º 6
0
        public void FallbackFontName()
        {
            //ExStart
            //ExFor:PclSaveOptions.FallbackFontName
            //ExSummary:Shows how to declare a font that a printer will apply to printed text as a substitute should its original font be unavailable.
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            builder.Font.Name = "Non-existent font";
            builder.Write("Hello world!");

            PclSaveOptions saveOptions = new PclSaveOptions();

            saveOptions.FallbackFontName = "Times New Roman";

            // This document will instruct the printer to apply "Times New Roman" to the text with the missing font.
            // Should "Times New Roman" also be unavailable, the printer will default to the "Arial" font.
            doc.Save(ArtifactsDir + "PclSaveOptions.SetPrinterFont.pcl", saveOptions);
            //ExEnd
        }
Ejemplo n.º 7
0
        public static void Run()
        {
            // ExStart:ConvertDocumentToPCL
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

            // Load the document from disk.
            Document doc = new Document(dataDir + "Test File (docx).docx");

            PclSaveOptions saveOptions = new PclSaveOptions();

            saveOptions.SaveFormat = SaveFormat.Pcl;
            saveOptions.RasterizeTransformedElements = false;

            // Export the document as an PCL file.
            doc.Save(dataDir + "Document.PclConversion_out.pcl", saveOptions);
            // ExEnd:ConvertDocumentToPCL

            Console.WriteLine("\nDocument converted to PCL successfully.");
        }