There was no PDF file attached, such attachments are deleted, that's why I wrote "share". Anyway, according to the PDF specification:

https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf

   A viewport (PDF 1.6) is a rectangular region of a page. The optional
   VP entry in a page dictionary (see Table 30) shall specify an array
   of viewport dictionaries, whose entries shall be as shown in Table
   260. Viewports allow different measurement scales (specified by the
   Measure entry) to be used in different areas of a page, if necessary.

   The dictionaries in the VP array shall be in drawing order. Since
   viewports might overlap, to determine the viewport to use for any
   point on a page, the dictionaries in the array shall be examined,
   starting with the last one and iterating in reverse, and the first
   one whose BBox entry contains the point shall be chosen.



I don't see how this is related to layers. Viewports are for CAD documents.

What is the real problem you are working on?

Tilman

Am 08.02.2019 um 09:07 schrieb Евгений Король:
Hello. On this pdf i have vector image. Pdf has a layers. I try to use pdfbox lib in my Java project.
I wrote code like this:
PDDocument document = PDDocument.load(new File("C:\\Users\\user\\Documents\\Примеры PDF\\тестовые файлы PDFDocInfo\\07 642_ТР_1_1_КЖ9_АН_1 (вектор).pdf"));
            PDPage page = document.getPage(0);
            List<PDViewportDictionary> viewports = page.getViewports();
            for (int i = 0; i < viewports.size(); i++) {
                System.out.println("Viewport " + (i+1));
                PDViewportDictionary get = viewports.get(i);
                PDRectangle bBox = get.getBBox();
                System.out.println("Размер "+bBox.getWidth()+" x "+bBox.getHeight());
            }

When i get viewports from page, i can get Width and Height. What is viewport means? Its like viewports for vector images on page or it is viewports for layers of pdf file?

пт, 8 февр. 2019 г. в 00:39, Tilman Hausherr <[email protected] <mailto:[email protected]>>:

    Am 07.02.2019 um 12:29 schrieb Евгений Король:
    > Hello. I try to understand how to get Vector images from pdf
    file. I think
    > that viewport related to vector images on page of pdf document.
    Is that
    > right? How many vieports is how many vector images in pdf? And
    width and
    > height of viewport is related to vector images? Or vieports is
    related to
    > layers in Resources - Properties?
    >
    I have no idea what you mean, although there is a concept of
    viewports
    in the PDF specification and PDFBox does support viewport
    dictionaries.
    Please share a PDF file and explain what you are trying to do.

    Tilman


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    <mailto:[email protected]>
    For additional commands, e-mail: [email protected]
    <mailto:[email protected]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to