serverlesspub / pandoc-aws-lambda-binary Goto Github PK
View Code? Open in Web Editor NEWpandoc precompiled binary for AWS Lambda with a Node.js wrapper
License: Other
pandoc precompiled binary for AWS Lambda with a Node.js wrapper
License: Other
AFAICT when we get data from the pandoc process's stdout/stderr streams, node is giving us a Buffer, which isn't so readable when passed to console.log. Please see my comment on the line in question, 9464d99#commitcomment-19144267
It would be helpful if we converted it to a string before console.logging it
Let me know if you'd like a PR
I tried to build a lambda function to create a PDF from a tex template.
And this is the output I'm getting:
> executing /tmp/pandoc in .
> pandoc: ./tex2pdf.-6d47e0bd3f553783: createDirectory: permission denied (Read-only file system)
This is the relevant code from my lambda function:
const pandoc = require('pandoc-aws-lambda-binary');
exports.lambdaHandler = async (event, context) => {
const result = await pandoc('test_input.tex', '/tmp/test_output.pdf');
The issue seems that anything but the /tmp
folder inside the lambda container is read-only.
Is there a way to tell pandoc to create its temp directory in /tmp
?
Or is there a way to execute pandoc from /tmp
?
I'm getting this error:
`cabal: The following packages are likely to be broken by the reinstalls:
parsec-3.1.13.0
Cabal-2.2.0.1
Use --force-reinstalls if you want to install anyway.
make: *** [bin/pandoc] Error 1
make: *** [all] Error 2`
Do you know how to fix this?
Thank you so much for the Lambda Layer for pandoc! Great to see more amazing libraries ready for the serverless world. I am having an issue with trying to do a docx conversion. I am trying to convert to json, but tried others as well. I was able to convert a text file, so I know everything is installed properly. I also read the file before trying the convert in memory and all looks good.
This is a link to the docx file I am using as a test.
https://s3.amazonaws.com/content.ambifi.com/ec60016e-e6d2-4d6b-bb2b-5442a5b15cea/assets/1587897009299-hello-from-google.docx
The error I am getting is...
2020-04-26T14:13:01.163Z 2053c5da-f305-43d0-9b68-9f9adf0bd4d4 ERROR couldn't parse
2020-04-26T14:13:01.163Z 2053c5da-f305-43d0-9b68-9f9adf0bd4d4 ERROR docx file
2020-04-26T14:13:01.180Z 2053c5da-f305-43d0-9b68-9f9adf0bd4d4 INFO /opt/bin/pandoc completed with 63:null
I tried a docx created on OSX as well as one downloaded from Google Docs. Any ideas why docx is not working?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.