How can I programmatically open PDF at a certain point?

Question: I've seen a few apps loading up PDF files as the documentation from a certain point within the PDF file. How were they doing this?

Answer: Specifying PDF Open Parameters in a URL. You can specify multiple PDF Open parameters in a single URL. Each parameter is separated from the others with either an ampersand (&) or a pound (#) character. Actions are processed and executed from left to right as they appear on the URL command line. Because all specified actions are executed, it is possible that later actions will override the effects of previous actions, so it is important to be aware of the order. For example, page actions should appear before zoom actions. Commands are not case sensitive (except for the value of a named destination). There can be no spaces in the URL line.

URL Examples

http://example.org/doc.pdf#nameddest=Chapter6
http://example.org/doc.pdf#page=3
http://example.org/doc.pdf#page=3&zoom=200,250,100
http://example.org/doc.pdf#zoom=50
http://example.org/doc.pdf#page=72&view=fitH,100
http://example.org/doc.pdf#view=fitb&nameddest=Chapter3
http://example.org/doc.pdf#pagemode=none
http://example.org/doc.pdf#pagemode=bookmarks&page=2
http://example.org/doc.pdf#page=3&pagemode=thumbs
http://example.org/doc.pdf#collab=DAVFDF@http://review_server/Collab/user1
http://example.org/doc.pdf#page=1&comment=452fde0e-fd22-457c-84aa-2cf5bed5a349
http://example.org/doc.pdf#fdf=http://example.org/doc.fdf

When you need to open PDF from a certain page not at a certain point, VeryPDF Advanced PDF Tools can help you specify PDF open actions. If you need to do this programmatically, please choose the developer version of this software. By the developers version, you can do the open action setting fromC#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C and others computer applications. Here are some C++ code for your reference:

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#include <io.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <conio.h>

#include <ctype.h>

#include <windows.h>

__declspec(dllexport)

int WINAPI VeryPDF_PDFTools(LPCTSTR lpCommand);

void main()

{

char szCommandLine[1024];

char *lpLicenseKey = "XXXXXXXXXXXXXX";

    sprintf(szCommandLine,"pdftools.exe \"-$\" \"%s\" -x \

    "0 0 612 792\" -j \"612 792 true\" -i \"%s\" -o \"%s\"",

    lpLicenseKey, "C:\\test.pdf", "C:\\_test.pdf");

int nRet = VeryPDF_PDFTools(szCommandLine);

}

When you use this software to specify how to open PDF, you can specify those actions like: open page, end page, bookmark, page magnification, page layout, user interface actions and Window actions. This applications can help you edit PDF in many aspects like edit PDF description, PDF custom description, PDF Open Action options, PDF page view options, PDF metadata contents, and so on. 

Hoping the above information will be helpful for you. If you have better idea about this, please tell us then we can discuss together. During the using VeryPDF software, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!