Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Page numbers wrong in PDF after Merge {Solved}

Featured Replies

I am trying to join multiple PDFs in to one PDF. 

The issue I am having is that the page numbers are not displaying correctly. 

It will list the page number as 1, 2, 2, 2, 2 etc instead of 1, 2 ,3 ,4, 5. 

My code looks like:

#Setting the desitination 
 Set Variable [ $dFilename ; Value: "/" & builderdoc.builder.file::file_number_n &" " &  builderdoc.Builder::name_t & ".pdf" ] 
 Set Variable [ $destPath ; Value: MBS("Folders.SystemTemporary") &  $dFilename ] 

#New PDF 
 Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ] 
 Set Variable [ $r ; Value: MBS("DynaPDF.OpenOutputFile"; $pdf; $destPath) ] 

#Loop though records and merge pdfs
 Set Variable [$Page ; Value: 1]
 Loop
	 Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; builderdoc.Doc::document_r) ] 
	 Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFFile"; $pdf; $Page) ] 
	  If [  GetAsNumber ( $r ) > 0 ] 
	       Set Variable [ $Page ; Value: $r+1 ] 
	  End If
	 Set Variable [ $r ; Value: MBS("DynaPDF.FlushPages"; $pdf; $Page) ] 
	 Go to Record/Request/Page [ Next ; Exit after last: On ]
 End Loop

#Close the PDF
 Set Variable [ $Merge ; Value: MBS("DynaPDF.Save"; $pdf; "Merged.pdf") ] 
 Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ] 

Let me know if more details will help.  

 

Thank you for taking a look!

 

-=fred=-

Edited by Vegas Fred
Solved issue

Do the pages already have page numbers?
 
Do you want to add new page numbers?
 
To add page numbers, you may need to draw white rectangles over the old page number and add new ones.
  • Author

Thank you for your response! 

I apologize that I did not explain myself well. 

After merging the PDF the displayed page number in the Adobe software is not correct. 

For example, at the top where it list what page you are on: 

It shows that I am on page number 2, but it is 31 of 441. 

909532509_ScreenShot2019-07-25at8_41_23AM.png.2b9775cae562620d7cb1eb48ea7ff2f8.png

Also on the thumbnail view:

1552380881_ScreenShot2019-07-25at8_41_40AM.thumb.png.05f7ac26f95aa3ba5029ea4b93e5f59c.png
( I did cover up the actual contents of the pages ) 


Hopefully that makes more sense. 

-=fred=-
 

  • Author

I found a solution. 

Apparently a PDF in my import set had page labels that were causing issues with the merge. 

So I had to filter what things get imported with the PDF via the MBS( "DynaPDF.SetImportFlags"; PDF; Flags ).

The filter that I am currently using is ImportAsPage

So now right after I set up the new PDF in memory space I set the filter :

#New PDF 
 Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ] 

#Set PDF Filter
 Set Variable [ $r ; Value: MBS("DynaPDF.SetImportFlags"; $pdf; "ImportAsPage") ] 

#Set File Destination
 Set Variable [ $r ; Value: MBS("DynaPDF.OpenOutputFile"; $pdf; $destPath) ] 
 

So far this is working with the PDF that were giving me issues. 

 

Hopefully this will help others out. 

-=fred=-

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.