forked from pimcore/pimcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Assets] Support document (PDF) version preview (pimcore#13858)
* support document (PDF) version preview * add version date as download file name suffix * use ExtJS to format date to have same display logic as in versions panel
- Loading branch information
1 parent
03a07aa
commit af29ff9
Showing
4 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
bundles/AdminBundle/templates/admin/asset/show_version_document.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
{% include '@PimcoreAdmin/admin/asset/show_version_unknown.html.twig' %} | ||
{% if asset.getMimeType() == 'application/pdf' %} | ||
{% set tempFile = asset.getTemporaryFile() %} | ||
{% set dataUri = pimcore_asset_version_preview(tempFile) %} | ||
|
||
<div style="display: flex; width: 100%; height: 100%; flex-direction: column; overflow: hidden;"> | ||
<iframe src="{{ dataUri }}" frameborder="0" style="flex-grow: 1; border: none; margin: 0; padding: 0;"></iframe> | ||
</div> | ||
{% else %} | ||
{% include '@PimcoreAdmin/admin/asset/show_version_unknown.html.twig' %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters