Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
f925e5ca
Commit
f925e5ca
authored
Dec 14, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save zip if convert thumbnail with first=false
parent
13d57361
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
X2tConverter/src/ASCConverters.cpp
X2tConverter/src/ASCConverters.cpp
+26
-10
X2tConverter/src/cextracttools.cpp
X2tConverter/src/cextracttools.cpp
+4
-0
No files found.
X2tConverter/src/ASCConverters.cpp
View file @
f925e5ca
...
@@ -697,6 +697,26 @@ namespace NExtractTools
...
@@ -697,6 +697,26 @@ namespace NExtractTools
NSFile
::
CFileBinary
::
Remove
(
sPdfBinFile
);
NSFile
::
CFileBinary
::
Remove
(
sPdfBinFile
);
return
nRes
;
return
nRes
;
}
}
std
::
wstring
getExtentionByRasterFormat
(
int
format
)
{
std
::
wstring
sExt
;
switch
(
format
)
{
case
1
:
sExt
=
L".bmp"
;
break
;
case
2
:
sExt
=
L".gif"
;
break
;
case
3
:
sExt
=
L".jpg"
;
break
;
default:
sExt
=
L".png"
;
break
;
}
return
sExt
;
}
//doct_bin -> image
//doct_bin -> image
int
doct_bin2image
(
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
,
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
bool
bPaid
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
)
int
doct_bin2image
(
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
,
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
bool
bPaid
,
const
std
::
wstring
&
sThemeDir
,
InputParams
&
params
)
{
{
...
@@ -756,9 +776,7 @@ namespace NExtractTools
...
@@ -756,9 +776,7 @@ namespace NExtractTools
{
{
sThumbnailDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"thumbnails"
);
sThumbnailDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"thumbnails"
);
FileSystem
::
Directory
::
CreateDirectory
(
sThumbnailDir
);
FileSystem
::
Directory
::
CreateDirectory
(
sThumbnailDir
);
std
::
wstring
::
size_type
pos
=
sTo
.
find_last_of
(
'.'
);
imageWriter
.
m_sFileName
=
sThumbnailDir
+
FILE_SEPARATOR_STR
+
L"image"
+
getExtentionByRasterFormat
(
imageWriter
.
m_nRasterFormat
);
std
::
wstring
sExt
=
std
::
wstring
::
npos
==
pos
?
L""
:
sTo
.
substr
(
pos
);
imageWriter
.
m_sFileName
=
sThumbnailDir
+
FILE_SEPARATOR_STR
+
L"image"
+
sExt
;
}
}
BYTE
*
pData
;
BYTE
*
pData
;
DWORD
nBytesCount
;
DWORD
nBytesCount
;
...
@@ -1777,9 +1795,7 @@ namespace NExtractTools
...
@@ -1777,9 +1795,7 @@ namespace NExtractTools
{
{
sThumbnailDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"thumbnails"
);
sThumbnailDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"thumbnails"
);
FileSystem
::
Directory
::
CreateDirectory
(
sThumbnailDir
);
FileSystem
::
Directory
::
CreateDirectory
(
sThumbnailDir
);
std
::
wstring
::
size_type
pos
=
sTo
.
find_last_of
(
'.'
);
sFileToExt
=
getExtentionByRasterFormat
(
nRasterFormat
);
sFileToExt
=
std
::
wstring
::
npos
==
pos
?
L""
:
sTo
.
substr
(
pos
);
}
}
int
nPagesCount
=
pReader
->
GetPagesCount
();
int
nPagesCount
=
pReader
->
GetPagesCount
();
if
(
bIsOnlyFirst
)
if
(
bIsOnlyFirst
)
...
@@ -1908,7 +1924,7 @@ namespace NExtractTools
...
@@ -1908,7 +1924,7 @@ namespace NExtractTools
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
DOCT
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
DOCT
;
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_IMAGE
==
nFormatTo
)
else
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_IMAGE
&
nFormatTo
)
)
{
{
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
DOCT
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
DOCT
;
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
...
@@ -2075,7 +2091,7 @@ namespace NExtractTools
...
@@ -2075,7 +2091,7 @@ namespace NExtractTools
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
XLST
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
XLST
;
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_IMAGE
==
nFormatTo
)
else
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_IMAGE
&
nFormatTo
)
)
{
{
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
XLST
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
XLST
;
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
...
@@ -2204,7 +2220,7 @@ namespace NExtractTools
...
@@ -2204,7 +2220,7 @@ namespace NExtractTools
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
PPTT
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
PPTT
;
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2pdf
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_IMAGE
==
nFormatTo
)
else
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_IMAGE
&
nFormatTo
)
)
{
{
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
PPTT
;
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
eFromType
=
NSDoctRenderer
::
DoctRendererFormat
::
FormatFile
::
PPTT
;
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
nRes
=
doct_bin2image
(
eFromType
,
sFrom
,
sTo
,
sTemp
,
bPaid
,
sThemeDir
,
params
);
...
@@ -2334,7 +2350,7 @@ namespace NExtractTools
...
@@ -2334,7 +2350,7 @@ namespace NExtractTools
oHtmlRenderer
.
CloseFile
();
oHtmlRenderer
.
CloseFile
();
RELEASEOBJECT
(
pReader
);
RELEASEOBJECT
(
pReader
);
}
}
else
if
(
AVS_OFFICESTUDIO_FILE_IMAGE
==
nFormatTo
)
else
if
(
0
!=
(
AVS_OFFICESTUDIO_FILE_IMAGE
&
nFormatTo
)
)
{
{
IOfficeDrawingFile
*
pReader
=
NULL
;
IOfficeDrawingFile
*
pReader
=
NULL
;
nRes
=
PdfDjvuXpsToImage
(
&
pReader
,
sFrom
,
nFormatFrom
,
sTo
,
sTemp
,
params
,
&
oApplicationFonts
);
nRes
=
PdfDjvuXpsToImage
(
&
pReader
,
sFrom
,
nFormatFrom
,
sTo
,
sTemp
,
params
,
&
oApplicationFonts
);
...
...
X2tConverter/src/cextracttools.cpp
View file @
f925e5ca
...
@@ -293,6 +293,10 @@ namespace NExtractTools
...
@@ -293,6 +293,10 @@ namespace NExtractTools
}
}
oBuilder
.
WriteString
(
_T
(
"</Changes>"
));
oBuilder
.
WriteString
(
_T
(
"</Changes>"
));
oBuilder
.
WriteString
(
sMailMerge
);
oBuilder
.
WriteString
(
sMailMerge
);
if
(
NULL
!=
params
.
m_oThumbnail
&&
(
NULL
==
params
.
m_oThumbnail
->
first
||
true
==
*
params
.
m_oThumbnail
->
first
))
{
oBuilder
.
WriteString
(
_T
(
"<OnlyOnePage>1</OnlyOnePage>"
));
}
oBuilder
.
WriteString
(
_T
(
"</Settings>"
));
oBuilder
.
WriteString
(
_T
(
"</Settings>"
));
return
oBuilder
.
GetData
();
return
oBuilder
.
GetData
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment