Solved

Using Access to assign Bookmarks in a PDF Report

Posted on 2013-11-23
8
1,373 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Passing variables to a function 6 34
VBA SQL statement - 2 "OR"s and 1 "And" 4 27
Opening forms with an input box 5 20
2 IIF's in Access query 25 23
This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

770 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