| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/inkscape/extensions/__pycache__/ |
Upload File : |
o
0�a � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZm Z dZ
e�d�ZG dd� deej
�Zed kr@e� �� dS dS )
� N)�AbortExtension)�TempDirMixin)�
take_snapshot�call�scribusz(\d+)\.(\d+)\.(\d+)c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�Scribusc C s� |j dtdddd� |j dtddd d� |j d
tjddd
d� |j dtjdddd� |j dtdddd� |j dtdddd� d S )Nz
--pdf-version�
pdfVersion�13z[PDF version (e.g. integer numbers between 11 and 15, see Scribus documentation for details))�type�dest�default�helpz--bleed�bleed�0zBleed valuez
--bleed-marks�
bleedMarksFzDraw bleed marksz
--color-marks�
colorMarkszDraw color Marksz--intent�intentzkRendering intent. Options: 0: Perceptual, 1: Relative Colorimetric, 2: Saturation, 3: Absolute Colorimetricz--title�title� zPDF title, required for PDF/X)�add_argument�int�float�inkex�Boolean�str)�self�
arg_parser� r �4/usr/share/inkscape/extensions/scribus_export_pdf.py�
add_arguments* s �����zScribus.add_argumentsc
C s� | j j}| j j}d}| j j}| j j} |s| r|dk rtd��|s"| r&|d }|�d|� d|� d|� d|� d|� d |� d
| � d|� d| j j� d
| j j� d| j j� d|� d�� d S )N� � z@You need at least 7mm bleed to show cutting marks or color marksz"
import scribus
import sys
icc = "z"
margin = zj
class exportPDF():
def __init__(self, svg=sys.argv[1], o=sys.argv[2]):
#scribus.newDocument((�,a� ), (margin,margin,margin,margin),
# PORTRAIT, 1, UNIT_MILLIMETERS, PAGE_1, 0, 1)
#scribus.placeSVG(svg, 0, 0)
scribus.openDoc(svg)
pdf = scribus.PDFfile()
scribus.setUnit(UNIT_MILLIMETERS)
pdf.bleedl = margin
pdf.bleedr = margin
pdf.bleedt = margin
pdf.bleedb = margin
pdf.useDocBleeds = False
pdf.cropMarks = z
pdf.bleedMarks = z
pdf.colorMarks = z
pdf.version = a
pdf.allowAnnots = True
pdf.allowChange = True
pdf.allowCopy = True
pdf.allowPrinting = True
pdf.noembicc = False #embed icc !
pdf.solidpr = icc
pdf.imagepr = icc
pdf.printprofc = icc
pdf.intenti = z
pdf.intents = z
pdf.info = "a0 "
pdf.profiles = True
pdf.profilei = True
pdf.outdst = 1 # output destination : 0=screen, 1=printer
pdf.file = o
pdf.compress = True
pdf.compressmtd = 0 # 0 = automatic, 1 = jpeg ; 2 = zip, 3 = none
pdf.quality = 0 #max
pdf.fontEmbedding = z>
pdf.thumbnails = True
pdf.save()
exportPDF()) �optionsr r r r r �writer r )
r �stream�width�height�icc�marginr �
embedFontsr r r r r �generate_script9 sD ���������� �(�zScribus.generate_scriptc C s$ t tdd�}t�|�}|d u rtd|� d���t|�d��}t|�d��}t|�d��}|dk s8|dkrC|dk rCtd |�d
�� d���| jj}t j
�| jd�}t j
�| jd
�} | j
j�d�}
t|
�d
krhtd��t|
�dkrrtd��|
d
�d�}t|��+}t| d��}
|D ]}|
�|� q�W d � n1 s�w Y |�� W d � n1 s�w Y t j
�| jd�}| j
�| j
�d��}| j
�| j
�d��}t|d��}| �||||� W d � n1 s�w Y t tdd|| |� t|d��}|�|�� � W d � d S 1 �sw Y d S )Nz-gz --versionz"Could not detect Scribus version (�)r � � � zFound Scribus r z(. This extension requires Scribus 1.5.x.z
scribus.pyzin.svgzsvg:color-profilez7Please select a color profile in the document settings.zVPlease only link a single color profile in the document settings. No output generated.z
xlink:href�wzout.pdfr&