- Catalogo: qualità di stampa, margini. ora è 300 DPI.
This commit is contained in:
0
src/rootgen/admin/convertPDF/convertPDF.scss
Executable file
0
src/rootgen/admin/convertPDF/convertPDF.scss
Executable file
135
src/rootgen/admin/convertPDF/convertPDF.ts
Executable file
135
src/rootgen/admin/convertPDF/convertPDF.ts
Executable file
@@ -0,0 +1,135 @@
|
||||
import { CMyPage } from '../../../components/CMyPage/index'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import axios from 'axios'
|
||||
|
||||
import { defineComponent, ref, onMounted } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { IParamsQuery } from 'model'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { StringDecoder } from 'string_decoder'
|
||||
import { GlobalConfig } from '@src/common'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'convertPDF',
|
||||
components: { CMyPage },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const arrSector = ref(<any[]>[])
|
||||
const arrSectorGood = ref(<any[]>[])
|
||||
const arrSkill = ref(<any[]>[])
|
||||
const arrGood = ref(<any[]>[])
|
||||
|
||||
const importasulserver = ref(false)
|
||||
const skipfirstrow = ref(true)
|
||||
|
||||
const incaricamento = ref(false)
|
||||
const checkAggiornaQta = ref(false)
|
||||
|
||||
const inputfile = ref('')
|
||||
const risultato = ref('')
|
||||
const risraw = ref('')
|
||||
|
||||
const width = ref('8.88')
|
||||
const height = ref('12.31')
|
||||
|
||||
const cosafare = ref(shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI)
|
||||
|
||||
const caricaDatiToggle = ref(false)
|
||||
|
||||
const pdfFile = ref(<any>null);
|
||||
|
||||
const compressione = ref('prepress')
|
||||
|
||||
const ListaCmd = ref(
|
||||
[
|
||||
{
|
||||
label: 'Riduci Dimensioni',
|
||||
value: shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI,
|
||||
},
|
||||
]
|
||||
)
|
||||
const ListaCompressione = ref(
|
||||
[
|
||||
{
|
||||
label: '[Nessuna]',
|
||||
value: '',
|
||||
},
|
||||
{
|
||||
label: '[screen - Buona per la visualizzazione su schermo; bassa qualità e dimensione del file ridotta]',
|
||||
value: 'screen',
|
||||
},
|
||||
{
|
||||
label: '[Ebook - Ottimizza il PDF per la lettura su ebook; qualità media e dimensione media]',
|
||||
value: 'ebook',
|
||||
},
|
||||
{
|
||||
label: '[Printer - Ottimizza il PDF per la stampa di qualità; migliora la risoluzione rispetto a /ebook.]',
|
||||
value: 'printer',
|
||||
},
|
||||
{
|
||||
label: '[Prepress - Ottimizza per la stampa di alta qualità; ideale per progetti di stampa professionali.]',
|
||||
value: 'prepress',
|
||||
},
|
||||
{
|
||||
label: '[Default - Usa impostazioni predefinite; generalmente fornisce un buon equilibrio tra qualità e dimensione]',
|
||||
value: 'default',
|
||||
},
|
||||
]
|
||||
)
|
||||
|
||||
function caricadati() {
|
||||
|
||||
}
|
||||
|
||||
function created() {
|
||||
|
||||
inputfile.value = ''
|
||||
|
||||
if (caricaDatiToggle.value) {
|
||||
caricadati()
|
||||
}
|
||||
}
|
||||
|
||||
const uploadPdf = (event: any) => {
|
||||
pdfFile.value = event.target.files[0];
|
||||
};
|
||||
|
||||
const convertPdf = async () => {
|
||||
globalStore.convertPdf(pdfFile.value, width.value, height.value, compressione.value)
|
||||
}
|
||||
|
||||
const execPdf = async () => {
|
||||
|
||||
if (cosafare.value === shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI) {
|
||||
convertPdf()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(created)
|
||||
|
||||
return {
|
||||
shared_consts,
|
||||
ListaCmd,
|
||||
cosafare,
|
||||
convertPdf,
|
||||
uploadPdf,
|
||||
width,
|
||||
height,
|
||||
execPdf,
|
||||
ListaCompressione,
|
||||
compressione,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
40
src/rootgen/admin/convertPDF/convertPDF.vue
Executable file
40
src/rootgen/admin/convertPDF/convertPDF.vue
Executable file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div class="column">
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
rounded
|
||||
outlined
|
||||
v-model="cosafare"
|
||||
:options="ListaCmd"
|
||||
label="Operazione"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-input v-model="width" label="Width:" filled></q-input>
|
||||
<q-input v-model="height" label="Height:" filled></q-input>
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
rounded
|
||||
outlined
|
||||
v-model="compressione"
|
||||
:options="ListaCompressione"
|
||||
label="Compressione"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<input type="file" @change="uploadPdf" />
|
||||
<q-btn @click="execPdf" label="Esegui"></q-btn>
|
||||
|
||||
<br />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./convertPDF.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './convertPDF.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user