Exemplo n.º 1
0
    internal PdfNewDocument method_10(List <Image> A_0)
    {
        if (A_0 == null)
        {
            return(null);
        }
        int count = A_0.Count;
        int num2  = (count > 90) ? 3 : ((count > 60) ? 5 : ((count > 30) ? 10 : count));

        this.pdfNewDocument_0 = this.method_12();
        for (int i = 0; i < count; i++)
        {
            using (Image image = A_0[i])
            {
                PdfNewPage page = this.method_14(new SizeF(image.Width * 0.75f, image.Height * 0.75f)).get_Pages().Add();
                this.pdfPageBase_0 = page;
                using (PdfMetafile metafile = PdfImage.FromImage(image))
                {
                    metafile.set_Quality((long)this.int_0);
                    metafile.ᜀ(page, new RectangleF(PointF.Empty, page.get_Size()), true, this.method_1().EmbeddedFontNameList, this.method_1().IsEmbeddedAllFonts);
                    metafile.Dispose();
                }
                image.Dispose();
            }
            if ((i % num2) == 0)
            {
                GC.Collect();
            }
        }
        return(this.pdfNewDocument_0);
    }
Exemplo n.º 2
0
    private PdfNewDocument method_26(Class195 A_0)
    {
        this.method_15(A_0);
        int count = A_0.method_0().Count;
        int num3  = (count > 90) ? 3 : ((count > 60) ? 5 : ((count > 30) ? 10 : count));

        this.pdfNewDocument_0 = this.method_12();
        for (int i = 0; i < count; i++)
        {
            using (MemoryStream stream = new MemoryStream())
            {
                A_0.method_57(i, 1, ImageType.Metafile, stream, false, false, true);
                PdfNewPage page = this.method_13(this.method_0()[i]).get_Pages().Add();
                this.pdfPageBase_0 = page;
                using (PdfMetafile metafile = PdfImage.FromImage(A_0.method_34().method_0()[i].method_0()))
                {
                    metafile.set_Quality((long)this.int_0);
                    metafile.ᜀ(page, new RectangleF(PointF.Empty, page.get_Size()), true, this.method_1().EmbeddedFontNameList, this.method_1().IsEmbeddedAllFonts, this.method_2());
                }
                this.method_18(A_0.method_34().method_0()[i].method_2());
                A_0.method_34().method_0()[i].method_0().Dispose();
                A_0.method_34().method_0()[i].method_1(null);
            }
            if ((i % num3) == 0)
            {
                GC.Collect();
            }
        }
        this.method_27(A_0, count, false);
        if (!this.method_1().CreateWordBookmarks)
        {
            this.method_27(A_0, count, true);
        }
        else if (A_0.method_11().Count > 0)
        {
            PdfBookmark bookmark = this.pdfNewDocument_0.get_Bookmarks().Add(this.method_1().WordBookmarksTitle);
            bookmark.set_Color((PdfRGBColor)this.method_1().WordBookmarksColor);
            bookmark.set_DisplayStyle(this.method_24(this.method_1().WordBookmarksTextStyle));
            this.method_22(A_0.method_11(), bookmark);
        }
        this.method_16(A_0.method_35().BuiltinDocumentProperties);
        A_0.method_51();
        return(this.pdfNewDocument_0);
    }