pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Евгений Король <fffa...@gmail.com>
Subject Re: Questions about viewports
Date Fri, 08 Feb 2019 08:07:20 GMT
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

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 <THausherr@t-online.de>:

> 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: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org

View raw message