Parámetros de consola para trabajar con PDF

Contenido

# Parámetros de consola para exportar a PDF

The PDF filter accepts a string of options containing PDF properties for export.

## Ejemplos:

#### Windows Command Prompt CMD

The double quotes in the parameter string must be escaped (\").

Para exportar las páginas 2 a 5 de un documento de Writer:

"C:\Program Files\LibreOffice\program\soffice" --convert-to pdf:writer_pdf_Export:{\"PageRange\":{\"type\":\"string\",\"value\":\"2-5\"}} --outdir C:\Users\myuser\Documents C:\Users\myuser\Documents\myfile.odt

To add a tiled watermark:

"C:\Program Files\LibreOffice\program\soffice" --convert-to pdf:draw_pdf_Export:{\"TiledWatermark\":{\"type\":\"string\",\"value\":\"draft\"}} C:\Users\myuser\Documents\test.odg

Para cifrar un archivo:

"C:\Program Files\LibreOffice\program\soffice" --convert-to pdf:draw_pdf_Export:{\"EncryptFile\":{\"type\":\"boolean\",\"value\":\"true\"},\"DocumentOpenPassword\":{\"type\":\"string\",\"value\":\"secret\"}} test.odg

To set version 1.5 (instead of the default 1.7):

"C:\Program Files\LibreOffice\program\soffice" --convert-to pdf:draw_pdf_Export:{\"SelectPdfVersion\":{\"type\":\"long\",\"value\":\"15\"}} test.odg

#### Windows PowerShell

La cadena de parámetros debe ir entre comillas simples para permitir el análisis de las comillas dobles. El carácter «&» se conoce como operador de llamada. Se utiliza para ejecutar una orden, un bloque de secuencias o una función almacenada en una variable o una cadena.

Para exportar las páginas 2 a 5 de un documento de Writer:

& 'C:\Program Files\LibreOffice\program\soffice' --convert-to 'pdf:writer_pdf_Export:{"PageRange":{"type":"string","value":"2-5"}}' --outdir C:\Users\myuser\Documents C:\Users\myuser\Documents\myfile.odt

To add a tiled watermark:

& 'C:\Program Files\LibreOffice\program\soffice' --convert-to 'pdf:draw_pdf_Export:{"TiledWatermark":{"type":"string","value":"draft"}}' test.odg

Para cifrar un archivo:

& 'C:\Program Files\LibreOffice\program\soffice' --convert-to 'pdf:draw_pdf_Export:{"EncryptFile":{"type":"boolean","value":"true"},"DocumentOpenPassword":{"type":"string","value":"secret"}}' test.odg

To set version 1.5 (instead of the default 1.7):

& 'C:\Program Files\LibreOffice\program\soffice' --convert-to 'pdf:draw_pdf_Export:{"SelectPdfVersion":{"type":"long","value":"15"}}' test.odg

#### Linux (BASH) and MacOS (ZSH)

Para exportar las páginas 2 a 5 de un documento de Writer:

soffice --convert-to 'pdf:writer_pdf_Export:{"PageRange":{"type":"string","value":"2-5"}}' --outdir /home/myuser myfile.odt

To add a tiled watermark:

soffice --convert-to 'pdf:draw_pdf_Export:{"TiledWatermark":{"type":"string","value":"draft"}}' test.odg

Para cifrar un archivo:

soffice --convert-to 'pdf:draw_pdf_Export:{"EncryptFile":{"type":"boolean","value":"true"},"DocumentOpenPassword":{"type":"string","value":"secret"}}' test.odg

To set version 1.5 (instead of the default 1.7):

soffice --convert-to 'pdf:draw_pdf_Export:{"SelectPdfVersion":{"type":"long","value":"15"}}' test.odg

## Índice

Propiedades generales

Initial View

Interfaz de usuario

Enlaces

Seguridad

Firma digital

## Propiedades generales

Generales

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
PageRange | If this property is set, it indicates the range of pages to be exported. To export all the pages, leave this property unset. To export a selection, leave this property unset and set only the property Selection. | string | Vacío (se exportan todas las páginas)
Selection | An any corresponding to the current selection in the document. | Any |
UseLosslessCompression | Especifica si las imágenes se deben exportar a PDF usando un formato con compresión sin pérdidas como PNG u otro como JPEG. | boolean | false
Quality | Specifies the quality of the JPG export. A higher value produces a higher-quality image and a larger file. Minimum inclusive value: 1. Represents the lowest value that can be used. The lower the value, the worse is the image quality and the smaller is the file size. Maximum inclusive value: 100. Represents the highest value that can be used. The higher the value, the better is the image quality and the larger is the file size. | long | 90
ReduceImageResolution | Specifies if the resolution of each image is reduced to the resolution specified by the property MaxImageResolution. | boolean | false
MaxImageResolution | If the property ReduceImageResolution is set to true, all images will be reduced to the given value in DPI. Possible values are: 75, 150, 300, 600 and 1200. | long | 300
SelectPdfVersion | Specifies the PDF version to emit. Possible values are: 0: PDF 1.7 (default choice). 1: PDF/A-1b 2: PDF/A-2b 3: PDF/A-3b 15: PDF 1.5 16: PDF 1.6 17: PDF 1.7 | long | 0
PDFUACompliance | Crea un archivo PDF accesible que cumple los requisitos de la especificación PDF/UA (ISO 14289). | boolean | false
UseTaggedPDF | Determines if PDFs are created using special accessibility tags. | boolean | false
ExportFormFields | Specifies whether form fields are exported as widgets or only their fixed print representation is exported. | boolean | true
FormsType | Specifies the submit format of a PDF form. Possible values are: 0: especifica que se usa el tipo de formulario FDF. 1: especifica que se usa el tipo de formulario PDF. 2: especifica que se usa el tipo de formulario HTML. 3: especifica que se usa el tipo de formulario XML. | long | 0
AllowDuplicateFieldNames | Specifies whether multiple form fields exported are allowed to have the same field name. | boolean | false
ExportBookmarks | Specifies if bookmarks are exported to PDF. | boolean | true
ExportPlaceholders | Exporta solo las marcas visuales de los campos sustitutivos. Este indicador exportado es inoperante. | boolean | false
ExportNotes | Specifies if notes are exported to PDF. | boolean | false
ExportNotesPages | Specifies if notes pages are exported to PDF. (Notes pages are available in Impress documents only). | boolean | false
ExportOnlyNotesPages | If the property ExportNotesPages is set to true, specifies if only notes pages are exported to PDF. | boolean | false
ExportNotesInMargin | Specifies if notes in margin are exported to PDF. | boolean | false
ExportHiddenSlides | En LibreOffice Impress, exporta las diapositivas excluidas del pase de diapositivas. | boolean | false
IsSkipEmptyPages | Specifies that automatically inserted empty pages are suppressed. This option is active only if storing Writer documents. | boolean | false
EmbedStandardFonts | Specifies whether to embed the 14 standard PDF fonts or not. | boolean | false
IsAddStream | Specifies that a stream is inserted to the PDF file which contains the original document for archiving purposes. | boolean | false
Watermark | Especifica el texto para una marca de agua que se reproducirá en todas las páginas del archivo PDF exportado. | string | (empty)
WatermarkColor | Specifies the color of the watermark text | long | 8388223 (light green)
WatermarkFontHeight | Especifica la altura de letra del texto de la marca de agua. | long |
WatermarkRotateAngle | Specifies angle of the watermark text. | long |
WatermarkFontName | Specifies font name of the watermark text. | string | Helvetica
TiledWatermark | Specifies the tiled watermark text. | string |
UseReferenceXObject | When the option is enabled, then the reference XObject markup is used: this is a simple operation, but viewers have to support this markup to show vector images. Otherwise a fallback bitmap is shown in the viewer. | boolean | false
IsRedactMode |  | boolean | false
SinglePageSheets | Ignores each sheet’s paper size, print ranges and shown/hidden status and puts every sheet (even hidden sheets) on exactly one page. | boolean | false

## Initial View

Vista inicial

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
InitialView | Specifies how the PDF document should be displayed when opened. Possible values are: 0: Select the default viewer mode, neither outlines nor thumbnails. 1: The document is opened with outline pane opened 2: The document is opened with thumbnail pane opened | long | 0
InitialPage | Specifies the page on which a PDF document should be opened in the viewer application. | long | 1
Magnification | Specifies the action to be performed when the PDF document is opened. Possible values are: 0: se abre con el zum predeterminado. 1: se abre con la ampliación precisa para encajar la página entera en la ventana. 2: Opens magnified to fit the entire page width within the window. 3: Opens magnified to fit the entire width of its bounding box within the window (cuts out margins). 4: Opens with the zoom level specified in the Zoom property. | long | 0
Zoom | Specifies the zoom level a PDF document is opened with. Only valid if Magnification is set to "4". | long | 100
PageLayout | Specifies the page layout to be used when the document is opened. Possible values are: 0: Display the pages according to the reader configuration. 1: Display one page at a time. 2: Display the pages in one column. 3: Display the pages in two columns odd pages on the right, to have the odd pages on the left the FirstPageOnLeft property should be used as well. | long | 0
FirstPageOnLeft | Used with the value 3 of the PageLayout property above, true if the first page (odd) should be on the left side of the screen. | boolean | false

## Interfaz de usuario

Interfaz de usuario

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
ResizeWindowToInitialPage | Specifies that the PDF viewer window is opened showing whole initial page when the document is opened. | boolean | false
CenterWindow | Specifies that the PDF viewer window is centered to the screen when the PDF document is opened. | boolean | false
OpenInFullScreenMode | Specifies that the PDF viewer window is opened full screen, on top of all windows. | boolean | false
DisplayPDFDocumentTitle | Specifies that the title of the document, if present in the document properties, is displayed in the PDF viewer window title bar. | boolean | true
HideViewerMenubar | Specifies whether to hide the PDF viewer menubar when the document is active. | boolean | false
HideViewerToolbar | Specifies whether to hide the PDF viewer toolbar when the document is active. | boolean | false
HideViewerWindowControls | Specifies whether to hide the PDF viewer controls when the document is active. | boolean | false
UseTransitionEffects | Especifica que las transiciones entre diapositivas se exporten al PDF. Esta opción está activa solamente si se van a almacenar documentos de Impress. | boolean | true
OpenBookmarkLevels | Especifica cuántos niveles de marcadores deben abrirse en la aplicación de lectura cuando se abra el PDF. Los valores posibles son: -1: all bookmark levels are opened 1–10: indicate a bookmark level (from 1 to 10) | long | -1

## Enlaces

Enlaces

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
ExportBookmarksToPDFDestination | Specifies that the bookmarks contained in the source LibreOffice file should be exported to the PDF file as Named Destination. | boolean | false
ConvertOOoTargetToPDFTarget | Specifies that the target documents with .od[tpgs] extension, will have that extension changed to .pdf when the link is exported to PDF. The source document remains untouched. | boolean | false
ExportLinksRelativeFsys | Specifies that the file system related hyperlinks (file:// protocol) present in the document will be exported as relative to the source document location. | boolean | false
PDFViewSelection | Specifies the way the exported PDF will be viewed (experienced) by the user. Possible values are: 0: Specifies that the PDF will be exported with all the links external to the document treated as URI. This is the Default 1: Specifies that the PDF will be exported in order to be viewed through a PDF reader application only. Valid only if not exporting to PDF/A-1 (e.g. SelectPdfVersion not set to 1). 2: Specifies that the PDF will be exported in order to be viewed through an Internet browser, using the PDF plug-in provided with it. The bookmark of the URI will be rendered compatible with the target bookmark generated with LibreOffice PDF Export feature (see ExportBookmarksToPDFDestination). | long | 0

## Seguridad

Seguridad

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
EncryptFile | If true, selects to encrypt the PDF document with a password. The PDF file can be opened only when the user enters the correct password. | boolean | false
DocumentOpenPassword | This is the password that allows the user to open the PDF file when EncryptFile is set to true. | string |
RestrictPermissions | If true, selects to restrict some permissions. The permissions can be changed only when the user enters the correct password. | boolean | false
PermissionPassword | This is the password that allows the user to access some permissions restricted if RestrictPermissions is set to true. | string |
PreparedPasswords |  |  |
PreparedPermissionPassword |  | string |
Printing | Especifica qué impresiones se permiten. Los valores posibles son: 0: el documento no se puede imprimir. 1: el documento puede imprimirse solo en resolución baja. 2: The document can be printed at maximum resolution. | long | 2
Changes | Specifies the changes that can be made to the document. Possible values are: 0: el documento no puede modificarse. 1: se permite insertar, eliminar y girar páginas. 2: se permite rellenar campos de formulario. 3: se permite tanto rellenar los campos de formulario como añadir comentarios. 4: se permiten todos los cambios de las selecciones anteriores, salvo la extracción (copia) de páginas. | long | 4
EnableCopyingOfContent | Especifica que las páginas y el contenido del documento se pueden extraer para utilizarlos en otros documentos (copiar y pegar). | boolean | true
EnableTextAccessForAccessibilityTools | Especifica que el contenido del documento se puede extraer para utilizarlo en aplicaciones de accesibilidad. | boolean | true

## Firma digital

Firmas digitales

Nombre | Descripción | Tipo | Valor predeterminado
--- | --- | --- | ---
SignPDF | If true, sign the PDF. | boolean | false
SignatureLocation | Additional information about the digital signature, location of the signatory. | string |
SignatureReason | Additional information about the digital signature, reason for signature. | string |
SignatureContactInfo | Additional information about the digital signature, signatory contact information. | string |
SignaturePassword | Contraseña del certificado | string |
SignatureCertificate |  |  |
SignCertificateSubjectName |  | string |
SignatureTSA | Durante el proceso de firma del PDF, se utilizará el URL de la autoridad de cronomarcación para obtener un cronomarcador firmado digitalmente que luego se incrustará en la firma. | string |

¡Necesitamos su ayuda!