Solved

Using Access to assign Bookmarks in a PDF Report

Posted on 2013-11-23
8
1,420 Views
Last Modified: 2013-12-04
I have a report that I use to generate pdf checklists and I'd like to assign bookmarks to easily go to the appropriate checklist

there is a unique header at the beginning of each checklist.

Is there a simple way to do this in the Access vba process that generates the report

A web search bore no fruit

Thanks
0
Comment
Question by:rogerdjr
  • 4
  • 2
8 Comments
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39671818
In general, you need to use a 3rd party method to work with a PDF file to that level. If you have the necessary Adobe components, you can use their SDK, or there a a utilities out there you can automate from Access to do this.
0
 

Author Comment

by:rogerdjr
ID: 39684408
Well it was worth a try thanks
0
 
LVL 84
ID: 39684929
So why the C grade, without any request for additional information? I gave you a few options and would be glad to help you explore them further. Or you can just Delete the question instead of awarding the lowest possible grade you can give ...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Assisted Solution

by:rogerdjr
rogerdjr earned 0 total points
ID: 39685416
I went on line and found this solution -


I went on line and found this solution - I was hoping for a bit more of a solution from the Experts Exchange, but your was the only response and I got an email from the administrator that my "question needed attention" - what grade should I have given?

http://answers.microsoft.com/en-us/office/forum/office_2003-access/include-a-bookmark-in-an-access-report-so-pdf-will/7f8d45a8-503a-476a-b43d-c4aa4cbd5e67

Function AddBookmarks(strPDFPath As String, blnIncludeCoverTOC As Boolean) As Boolean
     Dim gApp As Object
     Dim gPDDoc As Object
     Dim jso As Object
     Dim BMR As Object
     Dim intWithCover As Integer
     Dim x As Integer
     Dim varBMName As Variant
     Dim varBM As Variant
     Dim rst As DAO.Recordset
     Dim strSQL As String

On Error GoTo Errors
     strSQL = "SELECT tbltmpTableOfContents.ReportCaption, Min(tbltmpTableOfContents.PageNumber) AS Pg " & _
                     "FROM tbltmpTableOfContents " & _
                     "GROUP BY tbltmpTableOfContents.ReportCaption " & _
                     "ORDER BY Min(tbltmpTableOfContents.PageNumber);"
     Set rst = CurrentDb.OpenRecordset(strSQL)
     Set gApp = CreateObject("AcroExch.App")

    Set gPDDoc = CreateObject("AcroExch.PDDoc")
     If gPDDoc.Open(strPDFPath) Then
         Set jso = gPDDoc.GetJSObject


         Set BMR = jso.bookmarkRoot
         
         ' if the cover/toc is included then we add this in and
         ' the integer makes sure the bookmarks are assigned right
         ' further down if the cover/toc are included.
         If blnIncludeCoverTOC Then
             BMR.createchild "Report Cover", "this.pageNum= 0", 0
             BMR.createchild "Table of Contents", "this.pageNum= 1", 1
             intWithCover = intWithCover + 1
         End If
         With rst
             Do Until .EOF
                 varBMName = "this.pageNum= " & CStr(!Pg + intWithCover)
                 x = !Pg + intWithCover
                 varBM = !ReportCaption
                 BMR.createchild varBM, varBMName, x
                 .MoveNext
             Loop
             gPDDoc.Save PDSaveCopy, strPDFPath

            gPDDoc.Close
         End With
     End If

    Set gPDDoc = Nothing
     rst.Close
     Set rst = Nothing
     AddBookmarks = True

ExitHere:
      Exit Function

Errors:
             AddBookmarks = False
             MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure AddBookmarks of Module basAcrobat2", , CurrentDb.Properties("AppTitle")
             Resume ExitHere
             Resume

End Function
0
 

Accepted Solution

by:
rogerdjr earned 0 total points
ID: 39685715
Please re-open and I'll make the change

I did not understand the grading system - my apologies to the expert that was trying to help.
0
 

Author Closing Comment

by:rogerdjr
ID: 39695016
Expert - provided a response that led me to the web to get a solution
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question