Beispiel #1
0
        public void NoMarkedOptionalContent()
        {
            using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("AcroFormsBasicFields.pdf")))
            {
                var page = document.GetPage(1);
                var oc   = page.ExperimentalAccess.GetOptionalContents();

                Assert.Equal(0, oc.Count);
            }
        }
Beispiel #2
0
        public void MarkedOptionalContent()
        {
            using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("odwriteex.pdf")))
            {
                var page = document.GetPage(1);
                var oc   = page.ExperimentalAccess.GetOptionalContents();

                Assert.Equal(3, oc.Count);

                Assert.Contains("0", oc);
                Assert.Contains("Dimentions", oc);
                Assert.Contains("Text", oc);

                Assert.Equal(1, oc["0"].Count);
                Assert.Equal(2, oc["Dimentions"].Count);
                Assert.Equal(1, oc["Text"].Count);
            }
        }
        public void ReplacesObjects()
        {
            var path = IntegrationHelpers.GetDocumentPath("Single Page Simple - from inkscape.pdf");

            using (var document = PdfDocument.Open(path))
            {
                var dict = new Dictionary <NameToken, IToken>();
                dict[NameToken.Length] = new NumericToken(0);
                var replacement = new StreamToken(new DictionaryToken(dict), new List <byte>());

                var pg       = document.Structure.Catalog.GetPageNode(1).NodeDictionary;
                var contents = pg.Data[NameToken.Contents] as IndirectReferenceToken;
                document.Advanced.ReplaceIndirectObject(contents.Data, replacement);

                var page = document.GetPage(1);
                Assert.Empty(page.Letters);
            }
        }
Beispiel #4
0
        public void MarkedOptionalContentRecursion()
        {
            using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("Layer pdf - 322_High_Holborn_building_Brochure.pdf")))
            {
                var page1 = document.GetPage(1);
                var oc1   = page1.ExperimentalAccess.GetOptionalContents();
                Assert.Equal(16, oc1.Count);
                Assert.Contains("NEW ARRANGEMENT", oc1);

                var page2 = document.GetPage(2);
                var oc2   = page2.ExperimentalAccess.GetOptionalContents();
                Assert.Equal(15, oc2.Count);
                Assert.DoesNotContain("NEW ARRANGEMENT", oc2);
                Assert.Contains("WDL Shell text", oc2);
                Assert.Equal(2, oc2["WDL Shell text"].Count);

                var page3 = document.GetPage(3);
                var oc3   = page3.ExperimentalAccess.GetOptionalContents();
                Assert.Equal(15, oc3.Count);
                Assert.Contains("WDL Shell text", oc3);
                Assert.Equal(2, oc3["WDL Shell text"].Count);
            }
        }
Beispiel #5
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("journal.pone.0196757.pdf"));
 }
Beispiel #6
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("ICML03-081.pdf"));
 }
Beispiel #7
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Single Page Type 1 Font.pdf"));
 }
Beispiel #8
0
 private static string GetPath2() => IntegrationHelpers.GetDocumentPath(FileName2);
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Single Page Hyperlinks - from open office.pdf"));
 }
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Single Page Simple - from google drive.pdf"));
 }
Beispiel #11
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("2006_Swedish_Touring_Car_Championship.pdf"));
 }
Beispiel #12
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("AcroFormsBasicFields"));
 }
 private static string GetFilePath() => IntegrationHelpers.GetDocumentPath(@"Single Page Images - from libre office.pdf");
Beispiel #14
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Multiple Page - from Mortality Statistics.pdf"));
 }
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Single Page Non Latin - from acrobat distiller.pdf"));
 }
Beispiel #16
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("pop-bugzilla37292.pdf"));
 }
Beispiel #17
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Pig Production Handbook.pdf"));
 }
Beispiel #18
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Two Page Text Only - from libre office.pdf"));
 }
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Pig Reproduction Powerpoint.pdf"));
 }
Beispiel #20
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("FarmerMac.pdf"));
 }
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Single Page Form Content - from itext 1_1.pdf"));
 }
Beispiel #22
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Old Gutnish Internet Explorer.pdf"));
 }
Beispiel #23
0
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("cat-genetics.pdf"));
 }
 private static string GetFilename()
 {
     return(IntegrationHelpers.GetDocumentPath("Judgement Document.pdf"));
 }