Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncphp
/
mcClasses
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 35414fc4
authored
Sep 08, 2014
by
vuj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf druck: inkscape text to patrh in einzelne svgs ausgelagert kurz vor massensvg
1 parent
3cd29237
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
file/class_mcCairoSvg.inc.php
file/class_mcInkscape.inc.php
file/class_mcCairoSvg.inc.php
View file @
35414fc
...
@@ -2,8 +2,14 @@
...
@@ -2,8 +2,14 @@
class
mcCairoSvg
{
class
mcCairoSvg
{
public
static
function
inkscapeSvgToPdf
(
$param_input_filename
,
array
$param_outputfile
=
null
,
array
$param_quality
=
null
)
{
public
static
function
inkscapeSvgToPdf
(
$param_input_filename
,
array
$param_outputfile
=
null
,
array
$param_quality
=
null
,
$param_keep_svg
=
false
)
{
if
(
$param_keep_svg
!==
TRUE
){
$normalsvg_filename
=
mcInkscape
::
inkscapeSvgToNormalSvg
(
$param_input_filename
);
$normalsvg_filename
=
mcInkscape
::
inkscapeSvgToNormalSvg
(
$param_input_filename
);
// $normalsvg_filename=$param_input_filename;
}
else
{
$normalsvg_filename
=
$param_input_filename
;
}
mcFile
::
manipulateOutputfileArray
(
$param_outputfile
,
$param_input_filename
);
mcFile
::
manipulateOutputfileArray
(
$param_outputfile
,
$param_input_filename
);
return
mcCairoSvg
::
svgToPdf
(
$normalsvg_filename
,
$param_outputfile
,
$param_quality
);
return
mcCairoSvg
::
svgToPdf
(
$normalsvg_filename
,
$param_outputfile
,
$param_quality
);
}
}
...
...
file/class_mcInkscape.inc.php
View file @
35414fc
...
@@ -89,6 +89,27 @@ class mcInkscape {
...
@@ -89,6 +89,27 @@ class mcInkscape {
return
$outfile
;
return
$outfile
;
}
}
public
static
function
inkscapeSvgToNormalSvgPrint
(
$param_content
)
{
$param_input_filename
=
mcFile
::
createTmpFile
(
array
(
'prefix'
=>
'in_'
.
uniqid
(),
'filenameextension'
=>
'.svg'
,
'dirname'
=>
'media/tmp'
));
$param_outputfile
=
mcFile
::
createTmpFile
(
array
(
'prefix'
=>
'out_'
.
uniqid
(),
'filenameextension'
=>
'.svg'
,
'dirname'
=>
'media/tmp'
));
$doc
=
new
DOMDocument
();
$doc
->
loadXML
(
$param_content
);
$doc
->
save
(
$param_input_filename
);
self
::
replaceInSvGFile
(
$param_input_filename
);
$inkscape_order
=
"inkscape -T "
.
$param_input_filename
.
" -l "
.
$param_outputfile
.
" "
;
$shell_exec
=
mcBash
::
shell_exec
(
$inkscape_order
);
$svgfile_content
=
mcFile
::
getFileContent
(
$param_outputfile
,
true
);
unlink
(
$param_input_filename
);
unlink
(
$param_outputfile
);
return
$svgfile_content
;
}
public
function
replaceInSvGFile
(
$param_input_filename
)
{
public
function
replaceInSvGFile
(
$param_input_filename
)
{
$replacearray
=
array
(
$replacearray
=
array
(
'flowpara'
=>
'flowPara'
,
'flowpara'
=>
'flowPara'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment