小编Spl*_*eer的帖子

如何在 Linux 上将 PDF 转换为 DOCX

我尝试将 pdf 文件转换为 word、excel 和 powerpoint。我已经尝试了很多这样的命令:

soffice -env:UserInstallation=file:///$HOME/.libreoffice-headless/ --convert-to docx:"Microsoft Word 2007/2010/2013 XML" file.pdf
/usr/bin/soffice --headless --invisible --convert-to docx file.pdf
soffice --infilter="writer_pdf_import" --convert-to doc file.pdf

/usr/bin/libreoffice --headless --invisible --convert-to doc file.pdf
/usr/bin/soffice --headless --convert-to docx:"Microsoft Word 2007/2010/2013 XML" file.pdf

abiword --to=doc file.pdf
unoconv -f doc file.pdf
lowriter --invisible --convert-to doc 'file.pdf'
Run Code Online (Sandbox Code Playgroud)

总是从 soffice/libreoffice/unoconv 收到此错误消息:

:1: parser error : Document is empty
%PDF-1.7
Run Code Online (Sandbox Code Playgroud)

这是 abiword 的

Unable to init server: Could not connect: Connection refused

** (abiword:6477): WARNING **: clutter failed …
Run Code Online (Sandbox Code Playgroud)

linux ubuntu type-conversion soffice libreoffice

7
推荐指数
1
解决办法
1万
查看次数

如何使用nuxt加载本地JS文件

我的文件夹/ assets / js中有多个脚本。我像这样将它们添加到nuxt.config.js中:

script: [
  { src: 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' },
  { src: '~assets/js/bootstrap.min.js' },
  { src: '~assets/js/retina-1.1.0.js' },
  { src: '~assets/js/jquery.hoverdir.js' },
  { src: '~assets/js/jquery.hoverex.min.js' },
  { src: '~assets/js/jquery.prettyPhoto.js' },
  { src: '~assets/js/jquery.isotope.min.js' },
  { src: '~assets/js/custom.js' }
],
Run Code Online (Sandbox Code Playgroud)

对于第一个文件没有问题,但是对于本地文件,没有任何文件正在加载。我试过了:'@ / assets','/ assets','js /','〜/ assets'等,但是没有任何作用。

我总是收到此错误:

GET http://localhost:3000/~assets/js/custom.js net::ERR_ABORTED
Run Code Online (Sandbox Code Playgroud)

那么,我该如何加载我的文件?谢谢

javascript vuejs2 nuxt.js

5
推荐指数
1
解决办法
3164
查看次数

如何在没有用户和登录的情况下使用JWT?

我正在 Node.js 中制作一个简单的文件转换器 API,并且希望避免请求中的滥用。所以我正在寻找一种无需 userModel、登录等即可使用 JWT 的方法。

但我不能在网上做事。

谢谢

api rest node.js jwt

4
推荐指数
1
解决办法
1万
查看次数

AES-192 的 IV 长度无效

我正在更新我的旧函数来加密密码,因为createCipher它已被弃用。

这是我的旧功能:

  encrypt(payload) {
    let AES192 = crypto.createCipher('aes192', Buffer.from(config.secret))
    let crypted = AES192.update(payload, 'utf8', 'hex')
    crypted += AES192.final('hex')
    return crypted
  },

  decrypt(payload) {
    let AES192 = crypto.createDecipher('aes192', Buffer.from(config.secret))
    let decrypted = AES192.update(payload, 'hex', 'utf8')
    decrypted += AES192.final('utf8')
    return decrypted
  }
Run Code Online (Sandbox Code Playgroud)

这是我尝试做的:

  encrypt(payload) {
    const iv = crypto.randomBytes(96)
    const cipher = crypto.createCipheriv('aes192', Buffer.from(config.secret, 'hex'), iv)
    const encrypted = cipher.update(payload)
    encrypted = Buffer.concat([encrypted, cipher.final()])
    return iv.toString('hex') + ':' + encrypted.toString('hex')
  },

  decrypt(payload) {
    let textParts = payload.split(':')
    let iv = …
Run Code Online (Sandbox Code Playgroud)

encryption node.js

3
推荐指数
1
解决办法
556
查看次数

SQLSTATE [HY000] [2002]连接被拒绝 - MAMP和Symfony 2

我有一个symfony的问题.当我尝试运行此命令时:

php app/console doctrine:schema:update --force
Run Code Online (Sandbox Code Playgroud)

我错了:

[PDOException]                             
SQLSTATE[HY000] [2002] Connection refused 
Run Code Online (Sandbox Code Playgroud)

这是我的config.yml

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }

framework:
    #esi:             ~
    #translator:      { fallback: "%locale%" }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
    fragments:       ~ …
Run Code Online (Sandbox Code Playgroud)

php pdo symfony doctrine-orm

1
推荐指数
1
解决办法
5598
查看次数