-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when used in electron #33
Comments
Hello I believe this is more related to the HummusJS. Do you have the build codes for electron? |
this is my project: |
你好 感謝你分享程式碼 Hello @hl-a-k You are right about the font path issue. My solution for you at this moment is to use your custom fonts in your electron repo, since that electron has it's own file system. Here is my debug code // LandingPage.vue line 40
stamp () {
// ...
const path = require('path')
const fontSrcPath = path.join(__dirname, '../assets/fonts')
// I put a ttf file called `myfont.ttf` in the fonts directory
// `src/renderer/assets/fonts/myfont.ttf`
// Dont forget to comment back the codes in `hummus-recipe/lib/vector.helper.js`
const output = path.join(__dirname, 'output4.pdf')
const HummusRecipe = require('hummus-recipe')
const pdfDoc = new HummusRecipe('new', output, {
fontSrcPath
})
pdfDoc
.createPage()
.text('Add some texts to an existing pdf file', 150, 300, {
font: 'myfont'
})
.endPage()
.endPDF()
} You can see more details in #32. |
Thank you for your help. |
Does it work? |
My electron App run well by use:
yarn dev
but it crash after I built the app, and run it.
code cause crash:
I have use humus-recipe
the crash log from MAC system:
yunmao-kit_2018-04-30-195058_zhoudeMacBook-Pro.crash.log
The text was updated successfully, but these errors were encountered: