Default page size for Google docs - api

We have a system that generates documents using the Google API, we would like the page set-up to default to A4 for all documents we generate. We have set the default as A$ in the Google Doc settings but this doesn't carry through for files created using the API.
Is there something we need to set in the API call to generate the doc?
Thanks in advance,
David

Is there something we need to set in the API call to generate the doc?
Unfortunately it looks like this option isn't supported via the API, either on file creation or on file update. Google Docs/Drive treats page setup as an application setting as opposed to a per-file setting.
Here's the full list of metadata that you can specify about a file: https://developers.google.com/drive/v2/reference/files

Related

Headers are not picking up from the Google sheet in Google big query

I am trying to upload a google sheet to my dataset in the google bigquery. Below are the settings
Uploading configuration snap
I have made the "Header rows to skip" = 1 and =0 as well
Result doesn't pick the header on the top. It shows "string_field_0"
Here is the file with just one header column and 3 values https://docs.google.com/spreadsheets/d/1mnYBiDe-eOauhVa5QbM-BRelW2iwlhQD9lPMR50A9Lk/edit?usp=sharing
What am I doing wrong?
I was getting the same error. Then I realized that I got it because all the columns are in string format. After adding a field in integer format the issue was resolved.
It is important to follow the steps from the official documentation.
We need to take care of:
Retrieving the Google Drive URI by getting shareable link.
Enabling Google Drive access, because accessing data hosted within Google Drive requires an additional OAuth scope. We can use following command to authenticate with Google Drive:
gcloud auth login --enable-gdrive-access
Check if we are granted with required permissions and scopes. Finally, we can create a table.
Keep in mind that for JSON or CSV files, you can check the Auto-detect option to enable schema auto-detect. Schema auto-detection in the web UI is not currently supported for Google Sheets (though it is available using the bq command-line tool and the API).
I hope you find the above pieces of information useful.

Exporting a list of images from Google Photos or DropBox as CSV

Do any of the major online photo storage/sharing platforms offer a reasonable way to export a set of image URLs and titles as something like a CSV or fetch them as JSON from a REST API?
I am trying to get any sort of clean list of title, url value pairs for all the images in a particular folder or gallery.
Google Drive/Photos would be my prefered platform, but I would switch to DropBox or other service if I could easily get such an export list.
If you're going to use Google Drive, you'll probably end up using these properties from File Resource:
webViewLink - a link for opening the file in a relevant Google editor
or
webContentLink - a link for downloading the content of the file in a
browser.
You can fetch this properties using files.list or files.get.
For Dropbox, you would use the /2/files/list_folder[/continue] endpoints to list the desired files:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue
Then, you can use /2/sharing/create_shared_link_with_settings to create shared links for the desired files:
https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings
Or, to retrieve existing shared links, use /2/sharing/list_shared_links:
https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links
Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible:
https://www.dropbox.com/developers/documentation
Those have corresponding native methods for the HTTPS endpoints.

Windward Document Generation - PDF Copy Protected

In our application, we generate a few reports and documents through Windward. The documents are generated based on specific user conditions and the user is able to download the document.
As part of a new requirement, we would like to enable copy protection of the generated PDF -- basically, users would not be able to Copy the contents of the document.
Is there anyway we can achieve this through Windward? Or do we have to integrate with external third party software like LockLizard or Win2PDF?
We did think of converting the document to an image and recreating the PDF but this is unacceptable as the document formatting became off the mark.
Appreciate any insights or alternate solutions.
Thanks,
Aravind
Windward does this. If you're using the Java engine use the following calls (javadoc):
ProcessPdfAPI.setOwnerPassword()
ProcessPdfAPI.setUserPassword()
For the .NET engine use the following calls (api docs):
ReportPdf.OwnerPassword
ReportPdf.Security
ReportPdf.UserPassword
Is this what you need?

Get document property from script in google apps script

I have an addon which stores Properties in google documents.
I developed this addon and I used PropertiesService.getDocumentProperties().
Now I wrote a standalone google apps script which needs to iterate on every doc in a specific folder and, for each doc, to get the stored properties.
I'm trying to use the same PropertiesService.getDocumentProperties().getProperties() function but it seems that PropertiesService.getDocumentProperties() is returning NULL.
var documentProperties = PropertiesService.getDocumentProperties().getProperties();
Is it possible to call it from a standalone google apps script? how can I set the active document?
Otherwise, how can I get all properties I stored in each of the different docs?

Is is possible to set per file custom metadata in dropbox

I want to be able to set custom metadata on a file in dropbox. Ideally a string of at least 32 bytes for each file. I've looked through the core API docs but I haven't seen a way.
However I'm new to Dropbox so maybe I missed something or there is another way?
Thanks!
There isn't any way to set additional metadata on the file for your app. You could use the Datastore API (https://www.dropbox.com/developers/datastore) to store the string and the associated file path.