Документация к pyPDF Сравнение версий

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
wiki:pypdf_documentation [2012/07/20 00:16]
Форматирование страницы
wiki:pypdf_documentation [2012/09/18 22:21] (текущий)
[Класс PageObject]
Строка 1: Строка 1:
-====== Документация к pyPDF (в процессе перевода на русский) ​======+====== Документация к pyPDF ======
  
-<​note ​important>Если вы попали сюда, не злитесь из-за того, что не все переведено. Перевод документации ​- дело довольно непростое. Нужно быть внимательным к мелочам, что я и стараюсь делать.</​note> ​+<​note ​warning>Это любительский ​перевод документации. Не стоит относится к нему со 100%-ным доверием.</​note>​ 
 +<note important>​Много оригинальных английских предложений есть в сносках (активируются при наведении.)</​note>​
  
-''​**[[pypdf_documentation#​класс_destination|Destination(title,​ page, typ, *args)]]** (класс)''​+''​**[[#​класс_destination|Destination(title,​ page, typ, *args)]]** (класс)''​
 <​колонки 60% 5%><​новаяколонка>​ <​колонки 60% 5%><​новаяколонка>​
 Класс олицетворяет //​пункт назначения//​ в PDF файле. Класс олицетворяет //​пункт назначения//​ в PDF файле.
Строка 9: Строка 10:
 </​колонки>​ </​колонки>​
  
-''​ **[[pypdf_documentation#​класс_documentinformation|DocumentInformation()]]** (класс) ''​+''​ **[[#​класс_documentinformation|DocumentInformation()]]** (класс) ''​
 <​колонки 60% 5%><​новаяколонка>​ <​колонки 60% 5%><​новаяколонка>​
 Класс предоставляет элементарные метаданные,​ содержащиеся в PDF файле. Класс предоставляет элементарные метаданные,​ содержащиеся в PDF файле.
Строка 15: Строка 16:
 </​колонки>​ </​колонки>​
  
-''​ **[[pypdf_documentation#​класс_pageobject|PageObject(pdf)]]** (класс) ''​+''​ **[[#​класс_pageobject|PageObject(pdf)]]** (класс) ''​
 <​колонки 60% 5%><​новаяколонка>​ <​колонки 60% 5%><​новаяколонка>​
 Класс олицетворяет страницу из PDF файла, одну страницу. Класс олицетворяет страницу из PDF файла, одну страницу.
Строка 21: Строка 22:
 </​колонки>​ </​колонки>​
  
-''​ **[[pypdf_documentation#​класс_pdffilereader|PdfFileReader(stream)]]** (класс) ''​+''​ **[[#​класс_pdffilereader|PdfFileReader(stream)]]** (класс) ''​
 <​колонки 60% 5%><​новаяколонка>​ <​колонки 60% 5%><​новаяколонка>​
 Инициализирует объект PdfFileReader. Инициализирует объект PdfFileReader.
Строка 29: Строка 30:
  
 </​колонки>​ </​колонки>​
-''​ **[[pypdf_documentation#​класс_pdffilewriter|PdfFileWriter()]]** (класс) ''​+''​ **[[#​класс_pdffilewriter|PdfFileWriter()]]** (класс) ''​
 <​колонки 60% 5%><​новаяколонка>​ <​колонки 60% 5%><​новаяколонка>​
-Этот класс поддерживает запись PDF файлов на диск, которые сделаны другим классом:​ [[pypdf_documentation#​класс_pdffilereader|PdfFileReader]].+Этот класс поддерживает запись PDF файлов на диск, которые сделаны другим классом:​ [[#​класс_pdffilereader|PdfFileReader]].
  
 </​колонки>​ </​колонки>​
Строка 52: Строка 53:
 ((Each item in the outline or each thumbnail image can be associated with a corresponding //​destination//​ in the document, so that the user can jump directly to the destination by clickingwith the mouse.)) ((Each item in the outline or each thumbnail image can be associated with a corresponding //​destination//​ in the document, so that the user can jump directly to the destination by clickingwith the mouse.))
  
-[[pypdf_documentation#​раздел_821_из_спецификации_pdf|Раздел 8.2.1 вы можете найти здесь]],​ так как он слишком объемный.+[[#​раздел_821_из_спецификации_pdf|Раздел 8.2.1 вы можете найти здесь]],​ так как он слишком объемный.
 </​note>​ </​note>​
  
Строка 60: Строка 61:
 **''​bottom''​** **''​bottom''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property accessing the bottom vertical coordinate.+Read-only ​свойство,​ дающее доступ к нижней вертикальной координате
  
-^//​Возвращает://​ |  A number, or None if not available.|+^//​Возвращает://​ | Число или **None**, если недоступно.|
 </​колонки>​ </​колонки>​
  
 **''​left''​** **''​left''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property accessing the left horizontal coordinate.+Read-only ​свойство,​ дающее доступ к левой горизонтальной координате.
  
-^//​Возвращает://​ | A number, or None if not available. |+^//​Возвращает://​ | Число или **None**, если недоступно.|
 </​колонки>​ </​колонки>​
  
 **''​page''​** **''​page''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property accessing the destination page.+Read-only ​свойство,​ дающее доступ странице пункта назначения
  
 ^//​Возвращает://​ | An integer. | ^//​Возвращает://​ | An integer. |
Строка 82: Строка 83:
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
  
-Read-only ​property accessing the right horizontal coordinate.+Read-only ​свойство,​ дающее доступ к правой горизонтальной координате
  
-^//​Возвращает://​ | A number, or None if not available. |+^//​Возвращает://​ | Число или **None**, если недоступно.|
 </​колонки>​ </​колонки>​
  
 **''​title ''​** **''​title ''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
 +Read-only свойство,​ дающее доступ к названию //(title)// пункта назначения.
  
-Read-only property accessing the destination title. +^//​Возвращает://​ | Строку ​|
- +
-^//​Возвращает://​ | A string. ​|+
 </​колонки>​ </​колонки>​
  
 **''​top ''​** **''​top ''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
 +Read-only свойство,​ дающее доступ к верхней вертикальной координате.
  
-Read-only property accessing the top vertical coordinate. +^//​Возвращает://​ | Число или **None**, если недоступно.|
- +
-^//​Возвращает://​ | A number, or None if not available.|+
 </​колонки>​ </​колонки>​
  
 **''​typ ''​** **''​typ ''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
 +Read-only свойство,​ дающее доступ к типу пункта назначения.
  
-Read-only property accessing the destination type. +^//​Возвращает://​ | Строку|
- +
-^//​Возвращает://​ |A string. ​|+
 </​колонки>​ </​колонки>​
  
 **''​zoom''​** **''​zoom''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property accessing the zoom factor.+Read-only ​свойство,​ дающее доступ к коэффициенту увеличения.
  
-^//​Возвращает://​ | A number, or None if not available. |+^//​Возвращает://​ | Число или **None**, если недоступно.|
 </​колонки>​ </​колонки>​
 ====== Класс DocumentInformation ====== ====== Класс DocumentInformation ======
Строка 185: Строка 183:
 ''​**PageObject(pdf)** (класс)''​ ''​**PageObject(pdf)** (класс)''​
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-This class represents a single page within a PDF fileTypically this object will be created by accessing the {@link #PdfFileReader.getPage ​getPage} function of the {@link ​#​PdfFileReader ​PdfFileReader} class.+Класс олицетворяет одиночную страницу в PDF файлеБанально этот объект может быть создан с помощью доступа к функции ​PdfFileReader.getPage, принадлежащей классу [[#класс_pdffilereader|PdfFileReader]]. 
 </​колонки>​ </​колонки>​
  
 **''​artBox''​** **''​artBox''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-A rectangle (RectangleObject),​ expressed in default user space units, defining the extent of the page's meaningful content as intended by the page's creator.+Прямоугольник (RectangleObject),​ выраженный в дефолтных пользовательских единицах измерения,​ определяющий размеры значимого контента,​ как было задумано создателем. ((A rectangle (RectangleObject),​ expressed in default user space units, defining the extent of the page's meaningful content as intended by the page's creator.))
  
-|//​Стабильность://​ |  ​Added in v1.4will exist for all future v1.x releases. |+|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпусках. |
 </​колонки>​ </​колонки>​
  
 ''​**bleedBox**''​ ''​**bleedBox**''​
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-A rectangle (RectangleObject),​ expressed in default user space units, defining the region to which the contents of the page should be clipped when output in a production enviroment.+Прямоугольник (RectangleObject),​ выраженный в дефолтных пользовательских единицах измерения,​ определяющий область,​ в которую контент страницы должен быть обрезан,​ когда производится вывод в реальный мир. ((A rectangle (RectangleObject),​ expressed in default user space units, defining the region to which the contents of the page should be clipped when output in a production enviroment.))
  
-|//​Стабильность://​ |  ​Added in v1.4will exist for all future v1.x releases. |+|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпусках. |
 </​колонки>​ </​колонки>​
  
 **''​compressContentStreams()''​** **''​compressContentStreams()''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Compresses the size of this page by joining all content streams and applying a FlateDecode filter.+Сжимает размер этой страницы,​ объединяя все контентные потоки и применяя FlateDecode фильтр.((Compresses the size of this page by joining all content streams and applying a FlateDecode filter.))
  
 |//​Стабильность://​ |Added in v1.6, will exist for all future v1.x releases. However, it is possible that this function will perform no action if content stream compression becomes "​automatic"​ for some reason. | |//​Стабильность://​ |Added in v1.6, will exist for all future v1.x releases. However, it is possible that this function will perform no action if content stream compression becomes "​automatic"​ for some reason. |
Строка 211: Строка 210:
 **''​cropBox''​** **''​cropBox''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-A rectangle (RectangleObject),​ expressed in default user space units, defining the visible region of default user space. When the page is displayed or printed, its contents are to be clipped (cropped) to this rectangle and then imposed on the output medium in some implementation-defined manner. ​Default value: same as MediaBox.+Прямоугольник (RectangleObject),​ выраженный в дефолтных пользовательских единицах измерения,​ определяющий видимую область дефолтного пользовательского пространства. Когда страница отображается,​ или распечатывается,​ ее контент должен быть обрезан этим прямоугольником и затем наложен на внешнюю среду каким-нибудь способом.((A rectangle (RectangleObject),​ expressed in default user space units, defining the visible region of default user space. When the page is displayed or printed, its contents are to be clipped (cropped) to this rectangle and then imposed on the output medium in some implementation-defined manner.))
  
-|//​Стабильность://​ |  ​Added in v1.4will exist for all future v1.x releases.|+^Значение по умолчанию:​| same as MediaBox.| 
 +|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпусках.|
 </​колонки>​ </​колонки>​
  
 **''​extractText()''​** **''​extractText()''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Locate all text drawing commands, in the order they are provided in the content stream, and extract the text. This works well for some PDF files, but poorly for others, depending on the generator used. This will be refined in the future. Do not rely on the order of text coming out of this function, as it will change if this function is made more sophisticated. 
  
-^//​Возвращает://​ | unicode string ​object ​+Найти все рисующие текст команды,​ в порядке их представления в потоке содержания,​ и извлечь текст. ((Locate all text drawing commands, in the order they are provided in the content stream, and extract the text.)) 
-|//​Стабильность://​ |  ​Added in v1.7will exist for all future v1.x releasesMay be overhauled to provide more ordered text in the future.|+Это хорошо работает для некоторых PDF, но ужасно для других,​ это зависит от используемого генератора. Это будет усовершенствовано в будущем. Не полагайтесь на порядок текста,​ исходящий от этой функции,​ из-за того, что он может изменится при усложнении функции.  
 + 
 +^//​Возвращает://​ | unicode string-объект ​
 +|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпускахМожет быть переписана с нуля, чтобы предоставить более упорядоченный текст в будущем.|
 </​колонки>​ </​колонки>​
  
 ''​**mediaBox**''​ ''​**mediaBox**''​
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-A rectangle (RectangleObject),​ expressed in default user space units, defining the boundaries of the physical medium on which the page is intended to be displayed or printed.+Прямоугольник (RectangleObject),​ выраженный в дефолтных пользовательских единицах измерения,​ определяющий границы физической среды, на которой страница предназначена быть показанной или распечатанной.((A rectangle (RectangleObject),​ expressed in default user space units, defining the boundaries of the physical medium on which the page is intended to be displayed or printed.))
  
-|//​Стабильность://​ |  ​Added in v1.4will exist for all future v1.x releases.|+|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпусках.|
 </​колонки>​ </​колонки>​
  
 ''​**mergePage(page2)**''​ ''​**mergePage(page2)**''​
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Merges the content streams of two pages into oneResource references ​(i.e. fontsare maintained from both pagesThe mediabox/​cropbox/​etc of this page are not alteredThe parameter page's content stream will be added to the end of this page's content streammeaning that it will be drawn afteror "on top" of this page.+Объединяет потоки с контентом двух страниц в одинСсылки на ресурсы ​(вроде шрифтовподдерживаются из обоих страниц. mediabox/​cropbox/​прочее,​ принадлежащее этой страницы не изменится. Параметр контентного потока страницы будет добавлен в конец контентного потока этой страницыЭто означаетчто все будет дорисовано послеили на вершине этой страницы
  
-^page2 |An instance of {@link ​#​PageObject ​PageObject} to be merged into this one.| +^page2 | Экземпляр класса [[#класс_pageobject|PageObject]], который нужно объединить с текущим. | 
-|//​Стабильность://​ |  ​Added in v1.4, will exist for all future 1.x releases.|+|//​Стабильность://​ |  ​Добавлено в версии 1.4, будет существовать во всех будущих выпусках. |
  
 </​колонки>​ </​колонки>​
Строка 242: Строка 244:
 **''​rotateClockwise(angle)''​** **''​rotateClockwise(angle)''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Rotates a page clockwise by increments of 90 degrees. 
  
-^ angle | Angle to rotate the pageMust be an increment of 90 deg.| +Поворачивает страницу по часовой стрелки на число градусов,​ кратное 90.  
-|//​Стабильность://​ |  ​Added in v1.1, will exist for all future v1.x releases.|+ 
 +^angle|Угол на который нужно повернуть страницуДолжен увеличиваться только на 90 градусов за раз.| 
 +|//​Стабильность://​ |  ​Добавлено в v1.1, будет существовать во всех будущих 1.х выпусках.|
  
  
Строка 252: Строка 255:
 **''​rotateCounterClockwise(angle)''​** **''​rotateCounterClockwise(angle)''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Rotates a page counter-clockwise by increments of 90 degrees.+Поворачивает страницу против часовой стрелки на число градусов,​ кратное ​90. 
  
-^angle|Angle to rotate the pageMust be an increment of 90 deg.| +^angle|Угол на который нужно повернуть страницуДолжен увеличиваться только на 90 градусов за раз.| 
-|//​Стабильность://​ |  ​Added in v1.1, will exist for all future v1.x releases.|+|//​Стабильность://​ |  ​Добавлено в v1.1, будет существовать во всех будущих 1.х выпусках.|
  
 </​колонки>​ </​колонки>​
Строка 261: Строка 264:
 **''​trimBox''​** **''​trimBox''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-A rectangle (RectangleObject),​ expressed in default user space units, defining the intended dimensions of the finished page after trimming.+Прямоугольник (RectangleObject),​ выраженный в дефолтных пользовательских единицах измерения,​ определяющий придуманные вами габариты конечной страницы после обрезки. ((A rectangle (RectangleObject),​ expressed in default user space units, defining the intended dimensions of the finished page after trimming.))
  
-|//​Стабильность://​ |  ​Added in v1.4will exist for all future v1.x releases. |+|//​Стабильность://​ |  ​Добавлено в v1.1будет существовать во всех будущих 1.х выпусках. |
 </​колонки>​ </​колонки>​
 ====== Класс PdfFileReader ====== ====== Класс PdfFileReader ======
Строка 303: Строка 306:
  
 Возвращает экземпляр DocumentInformation или None, если ничего не существует. Возвращает экземпляр DocumentInformation или None, если ничего не существует.
-^//​Возвращает://​ | Returns a {@link ​#​DocumentInformation ​DocumentInformation} instance, or None if none exists.|+^//​Возвращает://​ | Экземпляр [[#класс_documentinformation|DocumentInformation]] или ​None если ничего нет.|
  
 //​Стабильность:​ Добавлено в версии 1.6. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.6. Будет существовать во всех 1.х выпусках.//​
Строка 311: Строка 314:
 **''​getNamedDestinations(tree=None,​ retval=None)''​** **''​getNamedDestinations(tree=None,​ retval=None)''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Retrieves the named destinations present in the document.+Извлекает именованные пункты назначения в документе.
  
-^//​Возвращает://​ | Returns a dict which maps names to {@link #​Destination destinations}.|+^//​Возвращает://​ | Возвращает словарь-отображение имен в пункты назначения.|
  
  
Строка 330: Строка 333:
 **''​getOutlines(node=None,​ outlines=None)''​** **''​getOutlines(node=None,​ outlines=None)''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Retrieves the document outline present in the document.+Извлекает структуру документа,​ присутствующую в нем.
  
-^//​Возвращает://​ | Returns a nested list of {@link #​Destination destinations}.|+^//​Возвращает://​ | Возвращает вложенный список пунктов назначения.|
  
 //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​
Строка 342: Строка 345:
  
 ^pageNumber| Номер извлекаемой страницы. | ^pageNumber| Номер извлекаемой страницы. |
-^//​Возвращает://​ | Экземпляр класса [[pypdf_documentation#​класс_pageobject|PageObject]] |+^//​Возвращает://​ | Экземпляр класса [[#​класс_pageobject|PageObject]] |
  
 //​Стабильность:​ Добавлено в версии 1.0. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.0. Будет существовать во всех 1.х выпусках.//​
Строка 349: Строка 352:
 **''​isEncrypted''​** **''​isEncrypted''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​boolean property showing whether this PDF file is encryptedNote that this propertyif truewill remain true even after the {@link #PdfFileReader.decrypt ​decrypt} function is called.+Read-only ​булево свойство,​ показывающее зашифрован ли файлЗаметьтечто это свойствоесли оно **True**, то оно останется **True** даже после вызова дешифрирующей функции //PdfFileReader.decrypt//
 </​колонки>​ </​колонки>​
  
Строка 355: Строка 358:
 **''​namedDestinations''​** **''​namedDestinations''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property that accesses the {@link #PdfFileReader.getNamedDestinations ​getNamedDestinations} function.+Read-only ​свойство,​ дающее доступ к функции //PdfFileReader.getNamedDestinations.//
  
 //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​
Строка 362: Строка 365:
 **''​numPages''​** **''​numPages''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property that accesses the {@link #PdfFileReader.getNumPages ​getNumPages} function.+Read-only ​свойство,​ дающее доступ к функции //PdfFileReader.getNumPages.//
  
 //​Стабильность:​ Добавлено в версии 1.7. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.7. Будет существовать во всех 1.х выпусках.//​
Строка 369: Строка 372:
 ''​**outlines**''​ ''​**outlines**''​
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property that accesses the {@link #PdfFileReader.getOutlines ​getOutlines} function.+Read-only ​свойство,​ дающее доступ к функции //PdfFileReader.getOutlines.//
  
 //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.10. Будет существовать во всех 1.х выпусках.//​
Строка 376: Строка 379:
 **''​pages''​** **''​pages''​**
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
-Read-only ​property that emulates a list based upon the {@link #PdfFileReader.getNumPages ​getNumPages} and {@link #PdfFileReader.getPage ​getPage} functions.+Read-only ​свойство,​ которое эмулирует список основанный на PdfFileReader.getNumPages ​И PdfFileReader.getPage ​функциях.
  
 //​Стабильность:​ Добавлено в версии 1.7. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.7. Будет существовать во всех 1.х выпусках.//​
Строка 385: Строка 388:
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
  
-Этот класс поддерживает запись PDF объектов на диск, которые сделаны ​ классом [[pypdf_documentation#​класс_pdffilereader|PdfFileReader]].+Этот класс поддерживает запись PDF объектов на диск, которые сделаны ​ классом [[#​класс_pdffilereader|PdfFileReader]].
 </​колонки>​ </​колонки>​
  
Строка 391: Строка 394:
 <​колонки 80% 3%><​новаяколонка>​ <​колонки 80% 3%><​новаяколонка>​
  
-Добавляет страницу к этому PDF файлу. Страница обычно получена от экземпляра [[pypdf_documentation#​класс_pdffilereader|PdfFileReader]].+Добавляет страницу к этому PDF файлу. Страница обычно получена от экземпляра [[#​класс_pdffilereader|PdfFileReader]].
  
-^page|Страницу,​ которую нужно добавить к документу. Аргумент должен быть экземпляром класса [[pypdf_documentation#​класс_pageobject|PageObject]] |+^page|Страницу,​ которую нужно добавить к документу. Аргумент должен быть экземпляром класса [[#​класс_pageobject|PageObject]] |
  
 //​Стабильность:​ Добавлено в версии 1.0. Будет существовать во всех 1.х выпусках.//​ //​Стабильность:​ Добавлено в версии 1.0. Будет существовать во всех 1.х выпусках.//​
Строка 418: Строка 421:
 </​колонки>​ </​колонки>​
  
-===== Раздел 8.2.1 из спецификации PDF =====+====== Раздел 8.2.1 из спецификации PDF =====
 +=== 8.2.1 Пункты назначения === 
 + 
 +Пункт назначения определяет конкретный вид документа,​ состоящего из следующих элементов:​ 
 +  * Страница,​ которая будет отображена 
 +  * Расположение окна документа на этой странице. ((The location of the document window on that page)) 
 +  * Увеличение,​ которое нужно использовать при показе страницы 
 +Пункт назначения в документе может ассоциироваться с элементом структуры документа (смотрите раздел 8.2.2, "​Document Outline"​),​ аннотациями (смотрите “Link Annotations” на странице 587), или действиями (“Go-To Actions” на странице 616 и “Remote Go-To Actions” на 617-й), в каждом случае пункт назначения указывает что будет показано при открытии элемента структуры документа или аннотации,​ или если выполнено действие. В дополнение,​ дополнительный ввод OpenAction в каталог документа (смотрите раздел 3.6.1, “Document Catalog”) может указывать пункт назначения,​ который будет показан при открытии документа. Пункт назначения может быть указан явно с помощью массива ​ параметров,​ определяющим эти параметры или косвенно с помощью имени. (( A destination may be specified either explicitly by an array of parameters defining its properties or indirectly by name.)) 
 + 
 + 
 +=== Явный пункт назначения === 
 +Таблица 8.2 показывает разрешенные синтаксические формы для явного указания пункта назначения в PDF файле. 
 +В любом случае,​ страница является неявной ссылкой на объект-страницу. Все значения координат (слева,​ справа,​ сверху,​ снизу) выражены в дефолтной пользовательской системе координат.  
 + 
 + ​Ограничительная рамка страницы является наименьшим прямоугольником вмещающем все ее содержание. (Если какая-либо сторона ограничительной рамки лежит за пределами обрезающей рамки, соответствующая сторона обрезающей рамки используется вместо. Смотрите раздел 10.10.1, "Page Boundaries",​ для дальнейшего обсуждения обрезающей рамки.) 
 + 
 +<​note>​Никакой page-объект на может быть указан для ассоциации с пунктом назначения с помощью операции goto (смотрите "​Remote Go-To Actions"​ на странице 617) потому что страница пункта назначения находится в другом PDF документе. В этом случае,​ параметр страницы указывает номер страницы в удаленном документе вместо page-объекта в текущем документе. 
 +((Note: No page object can be specified for a destination associated with a remote goto action (see “Remote Go-To Actions” on page 617) because the destination page is in a different PDF document. In this case, the page parameter specifies a page number within the remote document instead of a page object in the current document.))</​note>​ 
 + 
 + 
 +=== TABLE 8.2 Destination syntax === 
 +^ Синтаксис..................... ^ MEANING | 
 +^ [page /XYZ left top zoom] | Display the page designated by page, with the coordinates (left, top) positioned at the upper-left corner of the window and the contents of the pagemagnified by the factor zoom. A null value for any of the parameters left, top,  or zoom specifies that the current value of that parameter is to be retained unchanged. A zoom value of 0 has the same meaning as a null value. | 
 +^[page /Fit] | Display the page designated by page, with its contents magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension. | 
 +^[page /FitH top] | Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window.| ​               
 +^[page /FitV left] | Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window.| ​                
 +^[page /FitR left bottom right top]| Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension.| 
 +^[page /FitB] | (PDF 1.1) Display the page designated by page, with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the bounding box within the window in the other dimension.| 
 +^ [page /FitBH top] |(PDF 1.1) Display the page designated by page, with the vertical coordinate top positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window.| 
 +^ [page /FitBV left] | (PDF 1.1) Display the page designated by page, with the horizontal coordinate left positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window.| 
 + 
  
 +=== Именованные пункты назначения ===
 +Instead of being defined directly with the explicit syntax shown in Table 8.2, a
 +destination may be referred to indirectly by means of a name object (PDF 1.1) or
 +a string (PDF 1.2). This capability is especially useful when the destination is lo-
 +cated in another PDF document. For example, a link to the beginning of Chapter
 +6 in another document might refer to the destination by a name, such as
 +Chap6.begin,​ instead of by an explicit page number in the other document. Then,
 +the location of the chapter in the other document could change without invalidat-
 +ing the link. If an annotation or outline item that refers to a named destination
 +has an associated action, such as a remote go-to action (see “Remote Go-To Ac-
 +tions” on page 617) or a thread action (“Thread Actions” on page 623), the desti-
 +nation is in the file specified by the action’s F entry, if any; if there is no F entry,
 +the destination is in the current file.
 +In PDF 1.1, the correspondence between name objects and destinations is
 +defined by the Dests entry in the document catalog (see Section 3.6.1, “Docu-
 +ment Catalog”). The value of this entry is a dictionary in which each key is a des-
 +tination name and the corresponding value is either an array defining the
 +destination,​ using the syntax shown in Table 8.2, or a dictionary with a D entry
 +whose value is such an array. The latter form allows additional attributes to be
 +associated with the destination,​ as well as enabling a go-to action (see “Go-To
 +Actions” on page 616) to be used as the target of a named destination.
 +In PDF 1.2, the correspondence between strings and destinations is defined by
 +the Dests entry in the document’s name dictionary (see Section 3.6.3, “Name Dic-
 +tionary”). The value of this entry is a name tree (Section 3.8.5, “Name Trees”)
 +mapping name strings to destinations. (The keys in the name tree may be treated
 +as text strings for display purposes.) The destination value associated with a key
 +in the name tree may be either an array or a dictionary, as described in the pre-
 +ceding paragraph.
  
 +<​note>​Note:​ The use of strings as destination names is a PDF 1.2 feature. If compatibility
 +with earlier versions of PDF is required, only name objects may be used to refer to
 +named destinations. A document that supports PDF 1.2 can contain both types.
 +However, if backward compatibility is not a consideration,​ applications should use
 +the string form of representation in the Dests name tree.</​note>​
  
 {{tag>​pypdf_documentation}} {{tag>​pypdf_documentation}}