I'm looking for a way to convert text/xml/json (whatever) to a Google doc. The Googles docs api only allows you to create new presentations or upload presentations, not to edit the content of those presentations. I imagine a library or api which converts text to a powerpoint could be a major part of the process.
Related
I'm working on a project in .net that has a need for a document preview function.
I've implemented a Webview2 control and, as the majority of doucments that need to be viewed are pdf, this works a treat.
However, now and again some documents may be in either docx or xlsx format.
When I set webview2.Source = New Uri(PathtoFile) on these files, the webview2 control downloads the document to my downloads folder rather than rendering it.
I get that the files are not HTML, but then again neither are PDFs and they work out of the box.
Is there some mechanism I'm missing whereby I can have the Webview2 control display the file contents for docx and xlxs rather than download?
We are having the same problem ourselves. At the moment we are using a product called Aspose that will allow us to convert Word Documents to XPS, after which we can display the document in a Document Viewer.
While this works, and it works well, the main problem is that this relies on us downloading the document, then converting it and then loading the converted document into the Viewer. Which causes a certain perception of "sluggishness" due to all of that work, whereas images and PDFs, especially when hosted on the Web, can be hosted directly in the WebView2 and this then leaves the rest of our application nicely responsive to user interaction.
So in case anyone comes up with a better suggestion, I'm following this ...
The code using Aspose is pretty straightforward (example in Visual Basic .NET):
Dim oDoc As Aspose.Words.Document = Nothing
oDoc = New Aspose.Words.Document(sFile)
oDoc.Save(fileName:=sToFileName, saveFormat:=Aspose.Words.SaveFormat.Xps)
(left out all error handling and so on in order to focus on the actual functionality. sToFileName just contains a filename along the lines of [somefolder][yourtargetfilename].xps ...)
I guess you may try to convert DOCX to PDF directly via Aspose.Words and XLSX to PDF via Aspose.Cells. Both these APIs support rendering to PDF or even image formats. Since your viewer supports to view PDF or images, so you may try this approach, it might work for your needs.
PS. I am working as Support developer/ Evangelist at Aspose.
I want to make a document viewer in Html page that views photo / txt / pdf ... and I want to edit it like to put icon on the document or make text highlight or put signature .. what is the best way ??
You can create your document viewer application using GroupDocs.Viewer API (available for .NET and Java). It supports viewing popular document types including TXT, PDFs, and images. In addition, you can use GroupDocs.Annotation and GroupDocs.Signature to annotate (highlight text) and sign the documents respectively.
Disclosure: I work as a developer evangelist at GroupDocs.
I have an existing PDF template, and I want to add some text over the top of it in a specific location on a specific page. For example, an invoice template or a scanned document.
How would I go about this? I'm using Sheets if that narrows my options.
There is a lot of documentation on how to create PDFs from documents, but nothing that will take a particular PDF and put text over it.
A bit of blue sky thinking from my side. What if you were to do the following?
Manually:
Export the PDF as an image
Resize a Google slide to be the same shape as the image
Add the image to the google slide as a background image
In Code:
Make a copy of the google slide as needed
Add your Google sheets data to the slide positioned as needed on the slide
Export the Google slide as a pdf
I mention google slides, because Google docs to not have allow background images.
Another possibility with using Google docs is to build a document that looks like your invoice, then add to it tags. In your code search for the tags and replace them with data from your sheet. Even you could use a mail merge addon to do this if you didn't fancy writing any code.
In your Google Drive right-click on your PDF;
Open With > Connect More Apps > Search docusign > Left-click blue connect button and this should take you to Docusign.
Your PDF will then open with Docusign where you can manually add a signature or text to specific places.
Alternatively... You can use App Script.
Example,
Constructing a document using HTML and replacing the specific value with a variable which is collect from a Sheet or particular location. Writing the function to do this will allow you to interpret the HTML and replace the variable with the text or possibly an image. Then it would create this as a PDF.
There are many alternative ways to do this.
Here is one example on github;
Convert Google Doc to PDF using App Script
How do you export an entire Google Sheet to PDF in Landscape with fit to width, grid lines, page numbers, and spreadsheet name but not sheet name?
How about exporting the same as above but only 1 specific sheet in the spreadsheet or specific range within a sheet?
I can do all this through the GUI when exporting from a Google Sheet but no documented way via API.
I have found various sources showing how to do this via URL but have been unable to find any documentation by Google. The parameters used are not consist between sources and have been unable to figure out all the parameters available through the GUI.
How were the parameters determined? Is this documented by Google? Is this possible via API?
URL exporting sources:
https://issuetracker.google.com/issues/36761058#c25
Google Apps Script - Add landscape parameter to PDF email attachment
I'm trying to write a script that takes images from a PDF file and puts them into a Google Doc Template. The PDF has a bunch of images in it, one image per page. What I want to do is grab the images one at a time (or take a screenshot of the entire page) and paste it into a new document. How can I access a single image at a time to import it into the google doc?
Thanks.
There is probably no way to play directly with a pdf file but you should consider to first convert these pdf to google docs and, in a second time, use the document class that can retrieve images inside the doc quite easily...