How to use the pikepdf.Array function in pikepdf

To help you get started, we’ve selected a few pikepdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pikepdf / pikepdf / tests / test_object.py View on Github external
def test_nested_list(array):
    a = pikepdf.Array(array)
    assert decode_encode(a) == a
github pikepdf / pikepdf / tests / test_object.py View on Github external
def test_nested_list2(array):
    assume(isinstance(array, list))
    a = pikepdf.Array(array)
    assert decode_encode(a) == a
github pikepdf / pikepdf / tests / test_object.py View on Github external
def test_len_array():
    assert len(Array([])) == 0
    assert len(Array([3])) == 1
github pikepdf / pikepdf / tests / test_object.py View on Github external
def test_repr_dict(self):
        d = Dictionary({
            '/Boolean': True,
            '/Integer': 42,
            '/Real': Decimal('42.42'),
            '/String': String('hi'),
            '/Array': Array([1, 2, 3]),
            '/Operator': Operator('q'),
            '/Dictionary': Dictionary({'/Color': 'Red'})
        })
        expected = """\
            pikepdf.Dictionary({
                "/Array": [ 1, 2, 3 ],
                "/Boolean": True,
                "/Dictionary": {
                    "/Color": "Red"
                },
                "/Integer": 42,
                "/Operator": pikepdf.Operator("q"),
                "/Real": Decimal('42.42'),
                "/String": "hi"
            })
        """
github pikepdf / pikepdf / tests / test_object.py View on Github external
def test_list(array):
    a = pikepdf.Array(array)
    assert decode_encode(a) == a