Is there a way to get the file type of a document in an envelope (without extension)? - docusignapi

I am interesting in obtaining the file type (e.g. PDF, Word doc) of documents sent in an envelope. Of course this could be done just by getting the extension from the file name, but if a filename does not have an extension, is there an API call that would give me the file's type?

You cannot do this. Once the document is uploaded to DocuSign, it's always converted into a PDF. The original is not stored anywhere. You can have code that uses custom fields to store this information, but other than that - you would have to use the file name and the extension in there.

Related

Changing the File extension from "Demo.xlsx" to "Demo.pdf" how does it covert the file from doc to pdf?

In work place everyday we used different type of documents to hold data. For example, DOC, XLSX, PDF files. And sometime we use software (like adobe reader) excel to PDF converter.
As far i know another way to convert a document from excel to pdf is changing the document type from the SaveAs option (correct me if i am wrong) or changing the file extension.
My question is when we change the Document type from save as option does it change the code behind the file?
Another silly question is if we can convert the file by changing extension why we are paying for 3rd party software?!
Every document type has its format. So behind the screen, every type has its style. For example, XLSX format is a combination of XML and zip compression. PDF is a rich document representation format created by Adobe uses PostScript.
When you save a document as XLSX, the document will be saved as its standards. The saving method will be changed. As an answer to your first question, Yes the coding(method) will be changed when saving.
For the second question, the changing file format is not always an easy task. You need to change the encoding of the file when performing the conversion. When you change the extension you do not apply any conversion operation. You say your computer "This is an ... file.". But the encoding of the file is still unchanged.

NetSuite: Can I expose a pdf of an invoice in a saved search for download?

I need to expose the pdf version of a NetSuite invoice in my ecommerce site. I'm using saved searches to push up invoice header info but I want to be able to click a link and it will download the NetSuite invoice pdf.
The link to the PDF of an Invoice record looks like this:
/app/accounting/print/hotprint.nl?regular=T&sethotprinter=T&formnumber=102&id=3253&label=Invoice&printtype=transaction&trantype=custinvc
You can use a formula column in your search that dynamically fills in the correct parameters and generates an appropriate <a> tag.
You need to mark the PDF files in the File Cabinet to be "Available Without Login", this should provide you with an External URL you can use to download.
Here is what you can do : taking in consideration that you want the file to be accessible without netsuite login:
To access a file without login, it must be in file cabinet and with "Available without login" checked but when you click on Print in netsuite, this doesn't save the generated file in the file cabinet, so here is what you can do:
Add a custom transaction body field of type free-text or url.
Create a userevent script that trigger on aftersubmit (I'm here giving a general idea, so you can set it otherwise if you want).
Using the "render" (suitescript 2.0) : you can generate the PDF of your Invoice, save the file in the file cabinet with "Available without login" checked.
After saving the file, reload it and get its external url and save it in the custom field created in (1).
Updated your Saved Search to add the new field as a result column
Good luck :)

DocuSign eSign REST API How to handle PDF response in PHP?

I'm trying to get all documents in an envelope as a single PDF, if I call this REST API URL:
/v2/accounts/{$accountId}/envelopes/{$envelopeId}/documents/combined
It returns a bunch of data, however, I can't find a way to store this data as a valid PDF. When I output the content with headers it does download a file, but it's not a valid PDF. Also when I store the content in a file, it will not be a valid PDF file.
Anyone encountered this problem and knows how to solve this?
The content comes back as a file, you have to read the temp file and save that to the desired file
Quick snippet using file_get_contents and file_put_contents
$docStream = $envelopeApi->getDocument($accountId, 1, $envelopeId);
file_put_contents("my_document.pdf", file_get_contents($docStream->getPathname()));
More info DocuSign REST API :: EnvelopeDocuments: get under Get a Single Document as a PDF File

Data Security Issue - Printing PDF - "deleted" information gets printed

The Problem
I recieved a pdf file at work which I then printed. In the pdf file there were several optional fields where one could enter information such as "place of birth" etc. If I open the pdf file on my computer, I can see a set of input information A (a travel request with dates from this year 2017).
If I print the pdf on the local printer, the printed document contains a set of information B which for example contained travel request dates from 2015.
This information was not visible when opening the file on my computer.
I have been able to reproduce the error multiple times.
Why is this a problem?
It seems that previous entries into the pdf were yet somehow stored in the pdf contrary to what was visible when opening the pdf. When printing, the printer seems to access only the oldest entries and prints those.
This is a potential breach regarding data privacy and security since the pdf file seems to save all previous entries without anyone knowing.
Especially at work, some of these pdfs contains bank account information and other identity related information.
The Question
Did anyone experience a simliar issue or knows how to delete the invisible old information yet stored in the pdf?
UPDATE1: I could not reproduce the error on other printers. It seems this error is caused by the specific printer. Yet the information must be present in the PDF file, which is the specific cause of my question.
UPDATE2: Using the information from the accepted answer, I used the program "PDF CHAIN" and selected the option "drop XFA from document". I then saved the manipulated document again and printed it on the same printer.
Finally, the correct information was printed.
At a guess (and that's all it is without being able to see the original file) the PDF contains optional content or annotations which contain different field data for Print and Screen.
If you open the file using a PDF consumer (eg Acrobat) then what you see is the 'screen' result. Depending on the consumer you are using it may then either send the screen data to the printer, or substitute with the 'Print' data.
The printer you note as being a problem is capable of direct PDF printing, you haven't stated if that's how you are printing the PDF file, or whether you are using an application, nor whether the other printers are PDF capable or not.
My guess is that there is a different decision being made somewhere in the 2 print paths as to which is the 'correct' information to print.
Note that this does not mean that the PDF 'seems to save all previous entries without anyone knowing'; that's not really possible with a PDF file.
A malicious PDF processing application could do so, by adding comments to the PDF file, but only that application would be able to retrieve it.
But it is possible to have multiple entries of different types for different purposes, and if they aren't the same (because of the tool used to edit the file) then you can get strange results like this.
Note that if this is a problem for you then you probably shouldn't be using PDF, but you can mitigate the issue by digitally signing your documents. Signed PDF files include means (secure cryptographic hash) for verifying that the document has not been tampered with . Of course, you can't then edit the PDF file without re-signing it.
Oh, one other possibility would be that the PDF was actually an XFA form; its possible to have part of the document be a valid PDF which prints 'something' when a PDF consumer can't handle an XFA form, but that need bear no relation to what you see when you use an XFA processor.
My money's on optional content, AcroForm fields, or annotations where the Print data is different from the Screen data though.

How to get the filename for an attachment if there already is another one with the same filename, instead of getting a random name?

In cases when two attachments with the same filename are attached to a Notes Document, the second file is renamed internally to something like ATTXXXX. Even if the first filename is deleted and document re-saved, the internal filename remains cryptic.
There doesn't seem to be any way to retrieve the original Filename through back-end functions. I have looked high and low in LS but also in the C++ API, and could find nothing. It seems to be a trick that can only be done in the front-end. I am not sure where the information in the file icon graphic is stored, and whether it is accessible. In simple cases it would be possible to do a rename, I suppose (i.e. there is a single attachment and a single file icon graphic).
Could anybody confirm that this is, indeed a limitation of Notes or is there a cool way to solve this?
This is causing me some headaches whilst processing a large number of documents. My customer has trouble believing that there are some things that can only be done in the front end.
You should be able to get the original filename, even with duplicates.
It is not when the file is attached that the name is changed, it is when you detatch it.
You are probably using the .Name property, try the .Source property of the EmbeddedObject, that should return the original filename.
From the help:
If the NotesEmbeddedObject is an embedded object or object link, this property returns the internal name that Notes uses to refer to the source document.
If the NotesEmbeddedObject is a file attachment, this property returns the file name of the original file.
Syntax
To get: source$ = notesEmbeddedObject.Source
It's in the CD records for the rich text -- you will see it if you use NotesPeek to examine the contents of the rich text item. But I don't think it's accessible through the NotesRichText navigator class, so I'm pretty sure you would have to go the C API and parse through the CD records. Or, the MIDAS Rich Text API can probably get it, but that's third party software. I.e., not free.

Resources