How do get blob data of pdf?
See original GitHub issueI’m trying to use the BlobProvider to get the blob data:
MyDocument = () => {
return (
<Document>
<Page size="A4" style={stylez.page}>
<View style={stylez.section}>
<Text>Section TesterYo</Text>
</View>
<View style={stylez.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
)
}
LoadPdf = () => {
let myPdf = <BlobProvider document={this.MyDocument()}/>
var file = new File([myPdf], 'filename.pdf', { type: 'application/pdf', lastModified:Date.now()});
this.setState({ files: [...this.state.files, file] }, () => console.log(this.state))
}
This does not return MyDocument
Any insight on this would be appreciated
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
Properly Create and Serve PDF Blob via HTML5 File and URL ...
done(function(data){ var file = new Blob([data], {type:'application/pdf'}), url = URL.createObjectURL(file), _iFrame = document.createElement(' ...
Read more >JavaScript: Save BLOB as PDF File - ASPSnippets
The PDF file will be downloaded as BLOB (Binary Data) using XmlHttpRequest AJAX call and then will be sent for download in the...
Read more >How can I process the content of my PDF blob as File in azure ...
I just tried to read the pdf file from blob and created a new pdf file at different directory of blob storage using...
Read more >Opening a document in WebViewer from Blob - PDFTron
If your document is already in Blob format you can pass the Blob object directly to loadDocument function. v8.0+. v6.0+. WebViewer ...
Read more >creating pdf file from a blob column(containing pdf file) of a sql ...
1.Import the sql server database source. · 2. create an expression transformation to flag every row with some number · 3.create the transaction...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brvnonascimento I’ve found in 2.0 beta I am able to call “updateContainer” to populate the pdf and avoid the errors you mentioned.
I am curious though how are you offloading the process to a web worker? Would you mind giving an example of how you would do this?
Should this become an issue “Imperative Blob Data doesn’t work on beta2.0”?