How to determine what page a PDF opens on? - pdf-generation

I'm generating multi-page PDF reports using pentext, which uses Apache FOP. It all works fine, but when I open the resulting PDF (in macOS Preview), it always opens on the last page rather than the first. This makes me suspect there is some concept of "current page" that is saved as part of the document, which also means there should be some way of manipulating that so that reports open on the first page instead. Can anyone tell me how to set that using FOP?
Alternatively, is there some way of setting what page a PDF document opens on using some other tool that I can use to post-process it?

Related

Checkbox on PDF template in Firefox

We have pdf templates that get data from a data source and write out a file with data in respective fields. It uses PeopleSoft delivered functionality to perform this action. What is interesting is, we open the PDF file in Chrome, Safari, IE and other browsers, a check appears (shown below) in the checkboxes. But when we open the same file, from the same run in a Firefox browser window, they appear as 4s (image below) instead of a check in the checkbox.
Does anyone have an idea if this is a known issue? Any help is appreciated.

How to perform Preview in CKEditor

I am using CKEditor to get HTML from the user. The user will use HTML tags and it will be saved in the database. I need a functionality for the user to see how the page will be displayed when open as .html before saving in the database.
Is it possible to do that using CKEditor and if yes.....then how?
Thanks-in-Advance
It's certainly possible, but depends a lot on your specific requirements.
Get the contents of the editor using editor.getData(), then open a pop up window displaying that content - this should be relatively simple with JavaScript so I won't give any examples - you'll have to try it yourself first :). If a pop up is not something you want to use, maybe use an inline dialog, such as the ones that jQuery uses.
I would create the workflow so that the preview box has a save button inside it, forcing the user to preview before saving. If that's not acceptable, then create a separate button on your page to do the preview.

XPINC launch an attachment instead of downloading it

Is there a way to launch (open without saving) an attachment through XPINC? Something like the popup in web browser that ask you whether to open the attachment using a program or just save it first. Or maybe there's some setting in the notes client that I've yet to found that will launch an attachment?
I tried to built my own file download control so that I can built the URL to directly launch the attachment. It consist of a repeat control bounded to the attachment field and just a link control within it with URL computed as curRow.getHref()
And that worked fine but still it ask for me to save instead of launching the attachment directly. Changing the above code to curRow.getHref() + "?Open" also yield the same result. Any workaround?
The only way that I could find to do this was to construct a notes url that opened a conventional Notes form that had the launch property "Launch First Attachment" and only a single attachment.
It worked well but is obviously limited to documents with a single attachment. It also prevents the form from being opened as xpages by default but that is usually manageable.
You could construct documents on the fly and open them but that seems rather clumsy.
This is the formula for my XPage link in a repeat
var repIDVar = database.getReplicaID();
"notes://"+#Name("[CN]",#Subset(#DbName(),1))+"/"+repIDVar+"/0/"+rowData.getUniversalID()

Need to disable an automatic URL hyperlinking with XSL-FO when generating a PDF document?

I'm using Apache XSL-FO to generate a PDF document from an XML using XSLT. In my XSL file I have an fo:block where I bring a URL and simply display it like this:
xsl:value-of select="company_info/website"
My website always contains a valid URL for some company, starting with www.abc.com
It seems like that by default anything with a www is being recognized as a URL and becomes linkable. It does not seem like I can force the link of that company to load in a new window, as it always loads the page in the PDF window and that's not a desirable behavior. I am trying to find a way to disable to URL altogether so that it is not linkable and the only way I'm able to do it tight now is by inserting '-' on both ends of the URL: -www.abc.com- Is there a more elegant way to insert some kind of a special character that maybe is not visible?
This is probably not something that can be fixed from the XSLT/XSL-FO side of things (except by inserting extra characters, as you have done). It is the PDF viewer that interprets certain strings as clickable links.
In Adobe Reader, you can disable automatic recognition of links by unchecking the "Create links from URLs" check box (Preferences dialog: General->Basic tools). Foxit Reader has this option too.

In a firefox extension how to save a copy of a pdf opened in the browser window

I have a Firefox extension and in some cases when a user navigates to a PDF I'd like to save a copy of the file. This is easy when the PDF is downloaded (as I can use nsIObserverService to get the file), but when the PDF is opened in the browser using the Adobe Reader plugin I can't see how to get the file without downloading it again. Any ideas?
The plugin or firefox seems to wrap the pdf in html that contains a single EMBED tag with the pdf. So I can get the embedded object via doc.embeds[0] but don't know if there's any available interface to do anything with that.
An alternative would be to use something like nsIObserverService to notice when a file has been retrieved for viewing - but I don't know if that's possible?
I don't want to simply get the url and re-retrieve it, as it will sometimes no longer be available, having been served from a web app.
thanks!
UPDATE: to clarify, I want my firefox extension to do this in code, not by pressing CTRL+S as a user.
If the pdf is opened using the Adobe Reader plugin you can simply click on the Save icon on the reader tool bar. That is the easiest way.
Press Ctrl+S
In the pop up window select the location to save the file and press Save.

Resources