TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Multipage PDF View with arrows
Dear All

TeamDesk enables to display in the VIEW forms images of various types.
It also displays the first page of PDF files
This is great.

It would be even better if we could display multipage pdf documents, one page at a time, with arrows to move from one page to the other.

Kind regards,

Pierre


ID
1534
Category
User Experience
Author

Pierre
Date Created
6/16/2022 7:10:32 AM
Date Updated
7/17/2022 4:21:54 PM
Status
Implemented
Score
50
Promoted By
Rick CogleyPatricio Bustosbasenine
Lawrence BricknellPierre
Comments
Slava Shinderov  Staff  6/16/2022 7:18:30 AM
@Pierre please open a question and provide me an URL to the page on your screenshot.
Pierre 6/16/2022 3:01:29 PM
@Slava : Thanks a lot

@the rest of us:

Slava provided me the following solution, which works beautifully in the forms as well as in the tables.
----- start quote ----
please consider using Formula-XHTML column with following formula for that:

<embed src="<% URLRoot() & "/attachment.aspx?fid=" & ColumnId([File Attachment Column]) & "&id=" & RecordId() %>" width="100%" height="800" type='application/pdf' ></embed>

----- end of quote ----

I wish I asked earlier !

This works with pdfs
to be perfectly efficient:
- we should make a formula working with pdf as well as images (jpeg...) - I will propose one soon
- TeamDesk coud incorporate this natively in the form when viewing pdf fields

Kind regards,

Pierre
Pierre 6/16/2022 3:17:51 PM
more from Slava:

----- start quote ----

If you've allowed Public Access to the attachment column then it's better use following formula:

<embed src="<% URLRoot() & "/attachment.aspx?fid=" & ColumnId([File Attachment Column]) & "&guid=" & Right([File Attachment Column], ";") %>" width="100%" height="800" type='application/pdf' ></embed>


----- end quote ---
Pierre 6/17/2022 3:37:30 AM
Building on Slava's recommendation, I am now using the following formula, which takes images, audio, video and texts
I am not proficient in html so there are certainly ways to do better

'<embed src="'&XHtml( URLRoot() & "/attachment.aspx?fid=" & ColumnId([fileToDisplay]) & "&guid=" & Right([fileToDisplay], ";") , 1)&'" width="100%" height="800" accept="audio/*,video/*,image/*,text/*,application/pdf">'&"</embed>"
Pierre 6/17/2022 3:40:28 AM
Sorry / there was a copy paste glitch

The formula is:

<embed src="<% URLRoot() & "/attachment.aspx?fid=" & ColumnId([fileToDisplay]) & "&guid=" & Right([fileToDisplay], ";") %>" width="100%" height="800" accept="audio/*,video/*,image/*,text/*,application/pdf"></embed>
basenine 6/17/2022 4:09:59 AM
👍
Pierre 6/17/2022 4:12:27 AM
Please note:
If your file attachments are word / excel documents, displaying this formula will provoke a download.
I thought I would prevent this with the 'accept' attribute - it is not working / I do not know why yet

Kind regards,
Pierre
basenine 6/17/2022 4:23:11 AM
That could be a setting in your browser rather than the code
Pierre 6/17/2022 4:26:33 AM
@basenine
Thanks for the idea... it could ! but then I have little control over the browsers of the users.
And when you display a table with 20 '.doc' file attachments, you have 20 downloads occurring without asking for confirmation...
So I guess I need to close that door in the code: either by testing the file name by a TD formula (efficient but not elegant), or by html (elegant / I thought accept would do the trick / it's not)
Pierre 6/22/2022 3:45:29 AM
Dear All

Using Slava's trick #1 (pdf preview) + Slava's trick #2 (TeamDesk document URL address),

You can have an automatic preview of any TeamDesk document in a TeamDesk form:

<embed src="<%Var[MyURLRootAPI]&"TABLE NAME/"&"DOCNAME"&"/document?id="& RecordId()%>" width="100%" height="800" type="application/pdf"></embed>

This one is quite neat.

Kind regards,

Pierre
Pierre 6/22/2022 3:46:39 AM
typo correction

<embed src="<%Var[MyURLRootAPI]&"TABLENAME/DOCNAME/document?id="& RecordId()%>"
Pierre 6/22/2022 3:50:14 AM
Arghh

<embed src="<%Var[MyURLRootAPI]&"TABLENAME/DOCNAME/document?id="& RecordId()%>" width="100%" height="800" type="application/pdf"></embed>

Pierre 6/22/2022 4:58:28 AM
This works with Safari

not with Firefox & Chrome :-(

I am working on it
Pierre 6/28/2022 7:47:43 AM
To make myself more clear, the XHTML formula field displaying all images, pdf, ...
with anybrowsers:
<embed src="<% URLRoot() & "/attachment.aspx?fid=" & ColumnId([fileToDisplay]) & "&guid=" & Right([fileToDisplay], ";") %>" width="100%" height="800" accept="audio/*,video/*,image/*,text/*,application/pdf"></embed>

The XTHML formal field displaying the Teamdesk Generated pdf documents works only with Safari
<embed src="<%Var[MyURLRootAPI]&"TABLENAME/DOCNAME/document?id="& RecordId()%>" width="100%" height="800" type="application/pdf"></embed>


Kirill Bondar  Staff  7/17/2022 4:21:54 PM
Content-Disposition HTTP header generated by attachment.aspx/documentopen.aspx pages allows us to specify the file name but effectively disables the use of those pages in <embed>, <iframe> and <a download="filename"> tags. First two download the file instead of displaying, in latter case filename specified by "download" attribute is ignored.

We added support for "inline" parameter to attachment.aspx/documentopen.aspx pages and Attachment/Document REST API methods. The value of the parameter does not matter, its presence merely instructs us to suppress Content-Disposition header.

So, in @Pierre's case an addition of "inline" parameter should fix the problem. Revised formulas are:

<embed src="<% URLRoot() & "/attachment.aspx?fid=" & ColumnId([fileToDisplay]) & "&guid=" & Right([fileToDisplay], ";") & "&inline="%>" width="100%" height="800" accept="audio/*,video/*,image/*,text/*,application/pdf"></embed>

<embed src="<%Var[MyURLRootAPI]&"TABLENAME/DOCNAME/document?id="& RecordId() & "&inline="%>" width="100%" height="800" type="application/pdf"></embed>
Feedback
 
Back to Search Results