Pagepeek API Document
  • Introduction
    • Conventions
    • Versioning
    • Authentication
    • Rate Limits
  • Quick Start
  • Objects
  • PagePeek Document Viewer
  • API Endpoints
    • Documents
    • Knowledge Base
    • Questions
    • Users
Powered by GitBook
On this page
  • Interactive Viewing
  • Document Analysis
  • Text Summarization
  • Question & Answer Interface
  • Annotations and Highlights
  • Formula Recognition
  • Table Extraction
  • Sidebar Navigation
  • Search Functionality
  • Document Sharing and Collaboration
  • User Customization

PagePeek Document Viewer

The PagePeek Document Viewer is a powerful interface designed to provide users with an interactive and insightful viewing experience for their documents. Leveraging the capabilities of the PagePeek AI, the Document Viewer not only allows for viewing documents but also provides a rich set of features to analyze, summarize, and interact with the document content. Here's an overview of the core features provided by the PagePeek Document Viewer:

Interactive Viewing

Users can seamlessly navigate through the pages of their documents, zoom in/out, and adjust the viewing settings to their preference. The Document Viewer supports a wide range of document formats including PDF, DOCX, XML, and others.

// Initializing the PagePeek Document Viewer
const viewer = new PagePeek.Viewer('#document-viewer-container', {
    documentId: 'abc123'
});

// Navigating to a specific page
viewer.goToPage(5);

Document Analysis

On the fly, PagePeek AI analyzes the document content, identifying key concepts, terms, and structures within the document. This analysis is visualized within the Document Viewer, providing users with insights into the document content.

// Requesting document analysis
fetch('https://api.pagepeek.com/v1/documents/abc123/analyze', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer your_api_key_here'
    }
})
.then(response => response.json())
.then(data => console.log(data));

Text Summarization

Users can request a summary of the entire document or specific sections, which is generated by the PagePeek AI and displayed within the Document Viewer. This summary can also be exported for further use.

// Requesting document summary
fetch('https://api.pagepeek.com/v1/documents/abc123/summary', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer your_api_key_here'
    }
})
.then(response => response.json())
.then(data => console.log(data.summary));

Question & Answer Interface

The Document Viewer provides an interactive Q&A interface where users can ask questions regarding the document content. PagePeek AI processes these questions and provides precise answers based on the document content.

// Asking a question about the document
fetch('https://api.pagepeek.com/v1/documents/abc123/ask', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer your_api_key_here',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ question: 'What is the main conclusion?' })
})
.then(response => response.json())
.then(data => console.log(data.answer));

Annotations and Highlights

Users can highlight text, annotate sections, and add comments within the Document Viewer. These annotations are saved and can be shared with other users, facilitating collaborative review and discussion on the document.

// Adding an annotation
viewer.addAnnotation({
    page: 2,
    text: 'Important point',
    coordinates: { x: 100, y: 200 }
});

// Getting all annotations
const annotations = viewer.getAnnotations();
console.log(annotations);

Formula Recognition

For documents containing mathematical or chemical formulas, the PagePeek AI recognizes these formulas and displays them in a structured format within the Document Viewer.

// (Assuming an endpoint exists for formula recognition)
fetch('https://api.pagepeek.com/v1/documents/abc123/formulas', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer your_api_key_here'
    }
})
.then(response => response.json())
.then(data => console.log(data.formulas));

Table Extraction

Tables within documents are recognized and can be interacted with. Users can sort, filter, and export table data directly from the Document Viewer.

// (Assuming an endpoint exists for table extraction)
fetch('https://api.pagepeek.com/v1/documents/abc123/tables', {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer your_api_key_here'
    }
})
.then(response => response.json())
.then(data => console.log(data.tables));

Sidebar Navigation

A sidebar is provided for easy navigation between pages, sections, and annotations. Users can quickly jump to different parts of the document or view a list of their annotations.

// Opening the sidebar
viewer.openSidebar();

// Closing the sidebar
viewer.closeSidebar();

Search Functionality

Users can search for specific terms or phrases within the document. The search results are highlighted within the Document Viewer, and users can navigate through the occurrences of the search term.

// Searching for a term
viewer.search('budget');

// Navigating to the next occurrence
viewer.searchNext();

// Navigating to the previous occurrence
viewer.searchPrev();

Document Sharing and Collaboration

Documents can be shared with others directly from the Document Viewer, and collaborative features allow for real-time discussion and annotation sharing among multiple users.

// Sharing the document
viewer.share({
    email: 'example@example.com',
    permissions: 'read-write'
});

User Customization

The Document Viewer allows users to customize the viewing interface according to their preferences, including theme selection, text size adjustment, and layout configurations.

// Changing the theme
viewer.setTheme('dark');

// Changing the text size
viewer.setTextSize('large');

The PagePeek Document Viewer is engineered to provide a comprehensive, interactive, and insightful document viewing and analysis experience. Through its integration within the PagePeek platform, it empowers users to delve deeper into their document content, fostering a more informed and collaborative document management process.

PreviousObjectsNextAPI Endpoints

Last updated 1 year ago