Solved

Using Access to assign Bookmarks in a PDF Report

Posted on 2013-11-23
8
1,313 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
*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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now