PDF File Automatically Generate Directory Bookmarks
This article is translated by AI.
The following method is suitable for PDF files that have a directory but no directory bookmarks.
Advantages: Graphical interface + AI + simple operation, no need to use complex python knowledge.
Tool: QuickOutline
The following content is based on version 2.1.0.
Installation (Taking Windows system as an example)
The tool homepage is as follows:
ririv/QuickOutline: Add outline, contents, bookmark to PDF
It is recommended to download the portable version, no installation required, clean uninstallation.

If you want to display a shortcut on the desktop, just right-click QuickOutline.exe and send it to the desktop shortcut.

Basic Usage Process

- Open PDF file
- Drag and drop the PDF file directly into the software window.
- Get/Write Directory Text
Auto Extract: Click the [Get Directory] button, the software will automatically try to extract the directory text from the PDF.
Manual Writing: Enter the directory and the corresponding original page number in the text box in either of the following formats.
- By Serial Number Format (The serial number will be retained in the final bookmark):
1 I am the title 1 1.1 I am the subtitle 2 1.1.1 I am the sub-subtitle 3 - By Indentation Format (Recommended to use
Tabkey for indentation):I am the title 1 I am the subtitle 2 I am the sub-subtitle 3
- By Serial Number Format (The serial number will be retained in the final bookmark):
- Set Page Number Offset
- If the page number in the PDF is inconsistent with the actual page number of the book, you need to set an offset.
- Formula: Page Number Offset = Page number displayed in PDF reader - Page number printed on the book
- For example, page 1 of the book is displayed as page 15 in the PDF, then the offset is
15 - 1 = 14.
- Add Directory
- Click the [Add Directory] button, the software will generate a PDF file with a new directory and save it in the same directory as the original file (the file name will automatically add the suffix "_with directory").
Advanced Features
Find Directory Resources
If the PDF is a scanned copy or has no text directory, you can get it from the following ways:
- Major book sales websites, such as JD.com, Douban, Taobao.
- For text version PDF, you can use the [Get Directory] function in the software.
Note: This software does not include OCR function and cannot extract directory directly from pictures or scanned copies. You can use external OCR tools (such as OCR built into macOS and Windows 11 systems, or PowerToys text extractor) to recognize text and then paste it into this software.
VSCode Sync Editing
In order to use advanced editing functions such as regular expression search and replace, you can click the VSCode button to synchronize the current directory text to VSCode for editing.
- After saving the file in VSCode, the content will be automatically synchronized back to QuickOutline.
- This function is one-way synchronization (VSCode → QuickOutline), but during synchronization, you can still use the "Auto Indent" function in QuickOutline, and the result will be synchronized to VSCode.
Configuration Method:
- Install VSCode: Go to VSCode Official Website to download and install.
- Add to Environment Variable (PATH):
- Windows: Check "Add to PATH" during installation (checked by default), restart the computer after installation.
- macOS: Open VSCode, press
Cmd+Shift+P, entershell commandand selectInstall 'code' command in PATH.
Text Editing Tips
- Auto Indent/Format: Click the [Auto Indent] button, the software will automatically format the text according to the serial number structure.
- Quick Indent: In the text editing area, select one or more lines, press
Tabkey to increase indentation,Shift+Tabkey to decrease indentation.
AI Extract Directory Text
It is recommended to use the prompt words I summarized. When using, you need to change "The main text of this book starts from page 23." according to the actual situation.
For more complex situations, it is recommended to use more specific prompt words.
Please enter the directory text in the following format
By indentation (recommended to use Tab key):
I am title 1 Pure digital page number in pdf
I am subtitle 2 Pure digital page number in pdf
I am sub-subtitle 3 Pure digital page number in pdf
(If there is a serial number in this method, it will be regarded as a title and will not affect)
Additional requirements:
1. The page number of the main text part in the directory may be repeated with the previous part, intelligently process the main text part, such as adding the start page number of the main text and subtracting one.
2. For mathematical symbols, use unicode symbols.
3. Need to include all structures in the directory, and also include the directory itself.
4. Each title needs to have a corresponding page number.
5. The Preface part of this book starts from page 4. The directory part starts from page . The main text part of this book starts from page 9.
Example as follows
Symbol Description 16
Directory 18
I. Divisibility Theory 24
1 Natural Numbers and Integers 25
1.1 Basic Properties 25
1.2 Principle of Least Natural Number and Principle of Mathematical Induction 27
Exercise 1 30
2 Basic Knowledge of Divisibility 31
2.1 Definition and Basic Properties of Divisibility 31
2.2 Prime Numbers and Composite Numbers 33
2.3 Greatest Common Divisor and Least Common Multiple 36
Exercise 2 40
3 Division with Remainder 44
3.1 Division with Remainder and Its Basic Applications 44
3.2 Euclidean Algorithm 49
Exercise 3 51
4 Greatest Common Divisor Theory 57
4.1 The First Way of Proof 58
4.2 The Second Way of Proof 63
4.3 The Third Way of Proof 67
Exercise 4 68
5 Fundamental Theorem of Arithmetic 74
5.1 The First Way of Proof 74
5.2 The Second Way of Proof 80
Exercise 5 83
6 Summary of Divisibility Theory 84
Exercise 6 86
7 Prime Factorization of n! 87
7.1 Symbol [x] 87
7.2 Prime Factorization of n! 91
Exercise 7 94
II. Indeterminate Equations (I) 98
1 Linear Indeterminate Equations 98
1.1 Solution of Linear Indeterminate Equations 98
1.2 Non-negative Solutions and Positive Solutions of Binary Linear Indeterminate Equations 105
Exercise 1 109
2 x²+y²=z² and Its Applications 113
2.1 Solution of x²+y²=z² 114
2.2 Applications 119
Exercise 2 122
III. Basic Knowledge of Congruence 125
1 Definition and Basic Properties of Congruence 125
Exercise 1 133
2 Congruence Classes and Residue Systems 136
2.1 Basic Properties of Congruence Classes and Residue Systems 137
2.2 Overall Properties and Structure of Residue Systems 145
Exercise 2 158
3 Euler Function φ(m) 163
3.1 Properties of φ(m) 163
3.2 Public Key Cryptosystem 170
Exercise 3 171
4 Wilson's Theorem 173
Exercise 4 177
IV. Congruence Equations 179
1 Basic Concepts of Congruence Equations 179
Exercise 1 184
2 Linear Congruence Equations in One Variable 186
Exercise 2 191
3 System of Linear Congruence Equations in One Variable - Sun Zi Theorem 193
3.1 Sun Zi Theorem 193
3.2 Relationship between Sun Zi Theorem and Congruence Classes, Residue Systems 197
Exercise 3 203
4 General Solution of Congruence Equations in One Variable 206
Exercise 4 215
5 Quadratic Residues Modulo a Prime 217
Exercise 5 222
6 Gauss Quadratic Reciprocity Law 226
6.1 Legendre Symbol 226
6.2 Gauss Lemma 227
6.3 Quadratic Reciprocity Law 229
Exercise 6 236
7 Jacobi Symbol 241
Exercise 7 244
8 Higher Degree Congruence Equations in One Variable Modulo a Prime 246
8.1 Basic Knowledge 246
8.2 Binomial Congruence Equations Modulo a Prime 253
Exercise 8 257
9 Introduction to Multivariate Congruence Equations, Chevalley Theorem 258
Exercise 9 261
V. Index and Primitive Root 263
1 Index 263
Exercise 1 269
2 Primitive Root 272
Exercise 2 278
3 Index, Index Group and Construction of Reduced Residue System 279
Exercise 3 290
4 Binomial Congruence Equations 291
Exercise 4 297
VI. Indeterminate Equations (II) 299
1 x₁²+x₂²+x₃²+x₄²=n 299
Exercise 1 302
2 x²+y²=n 303
2.1 Necessary and Sufficient Conditions for Solution 303
2.2 Solution Number Formula 308
Exercise 2 315
3 ax²+by²+cz²=0 319
Exercise 3 325
4 x³+y³=z³ 326
VII. Continued Fractions 332
1 What is Continued Fraction 332
Exercise 1 342
2 Finite Simple Continued Fractions 344
Exercise 2 347
3 Infinite Simple Continued Fractions 348
Exercise 3 357
4 Best Rational Approximation of Irrational Numbers 359
Exercise 4 364
5 Quadratic Irrational Numbers and Periodic Continued Fractions 367
Exercise 5 380
6 x²-dy²=±1 383
Exercise 6 388
VIII. Elementary Results of Prime Number Distribution 391
1 Eratosthenes Sieve Method and π(N) 393
1.1 Quantitative Analysis of Eratosthenes Sieve Method and Algorithm of π(N) 393
1.2 Mobius Function 398
1.3 Simple Estimation of the Number and Size of Prime Numbers 400
1.4 Inclusion-Exclusion Principle 402
Exercise 1 410
2 Upper and Lower Bound Estimation of π(x) 414
2.1 Inequality 414
2.2 Betrand Hypothesis 419
2.3 Functions θ(x) and ψ(x) 422
Exercise 2 426
3 Euler Identity 428
Exercise 3 430
IX. Number Theoretic Functions 433
1 Multiplicative Functions 434
Exercise 1 438
2 Mobius Transformation and Its Inversion Formula 439
Exercise 2 447
3 Mean Value of Number Theoretic Functions 452
3.1 Dirichlet Divisor Problem 453
3.2 Gauss Circle Problem 459
3.3 Mean Value of Euler Function φ(n) 461
3.4 Mertens Theorem 463
Exercise 3 468
4 Dirichlet Character 471
4.1 Definition, Construction and Basic Properties 472
4.2 Several Applications 484
Exercise 4 489
Appendix 1 Natural Numbers 497
1 Peano Axioms 497
2 Addition and Multiplication 499
3 Order (Size) Relation 506
Exercise 510
Appendix 2 Z[√-5] - An Example Where the Fundamental Theorem of Arithmetic Does Not Hold 513
Exercise 517
Appendix 3 Several Applications of Elementary Number Theory 526
1 Schedule of Round Robin Tournament 526
2 How to Calculate the Day of the Week 528
3 Laying of Telephone Cables 532
4 Chip Game 534
Exercise 538
Appendix 4 IMO Questions Related to Number Theory 540
1 Questions Related to Number Theory in the 1st~53rd IMO 542
2 Examples of Solutions to Typical Questions 554
Hints and Solutions to Exercises 606
Chapter 1 606
Exercise 1 606
Exercise 2 606
Exercise 3 609
Exercise 4 612
Exercise 5 615
Exercise 7 616
Chapter 2 620
Exercise 1 620
Exercise 2 622
Chapter 3 623
Exercise 1 623
Exercise 2 625
Exercise 3 627
Exercise 4 629
Chapter 4 629
Exercise 1 629
Exercise 2 630
Exercise 3 631
Exercise 4 633
Exercise 5 633
Exercise 6 635
Exercise 7 639
Exercise 8 639
Exercise 9 640
Chapter 5 641
Exercise 1 641
Exercise 2 646
Exercise 3 647
Exercise 4 651
Chapter 6 652
Exercise 1 652
Exercise 2 652
Exercise 3 654
Chapter 7 655
Exercise 1 655
Exercise 2 655
Exercise 3 656
Exercise 4 656
Exercise 5 658
Exercise 6 659
Chapter 8 661
Exercise 1 661
Exercise 2 663
Exercise 3 664
Chapter 9 665
Exercise 1 665
Exercise 2 666
Exercise 3 669
Exercise 4 671
Attached Table 1 Table of Prime Numbers and Smallest Positive Primitive Roots (Within 5000) 675
Attached Table 2 Table of Continued Fractions of √d and Smallest Positive Solutions of Pell Equation (2≤d≤100) 682
Index of Terms 686
Bibliography 694Practice
Take Pan Chengdong's "Foundation of Number Theory" as an example.
First, use Adobe Acrobat pro to extract the directory page as a separate PDF file.

We found that the main text starts from the fourth page.

Then OCR the directory in google AI studio.

Get the following results.
Directory
Chapter 1 Divisibility of Integers 4
§1 Divisibility, Division with Remainder 4
§2 Greatest Common Divisor, Least Common Multiple 8
§3 Euclidean Algorithm 14
§4 Linear Indeterminate Equations 17
§5 Functions [x], {x} 19
Exercise 22
Chapter 2 Number Theoretic Functions 26
§1 Examples of Number Theoretic Functions 26
§2 Dirichlet Product 28
§3 Multiplicative Functions 31
§4 Estimation of Order 41
§5 Generalized Dirichlet Product 47
Exercise 54
Chapter 3 Some Elementary Results of Prime Number Distribution 58
§1 Function π(x) 58
§2 Chebyshev Theorem 61
§3 Functions ω(n) and Ω(n) 71
§4 Bertrand Hypothesis 75
§5 Function M(x) 79
§6 Function L(x) 84
Exercise 85
Chapter 4 Congruence 87
§1 Concept and Basic Properties 87
§2 Residue Class and Residue System 91
§3 General Concept of Congruence Equation, Linear Congruence Equation 98
§4 Sun Zi Theorem 104
§5 (Identical) Congruence of Polynomials 113
§6 Higher Degree Congruence Equation Modulo p 116
Exercise 121
Chapter 5 Quadratic Residue and Gauss Reciprocity Law 125
§1 Quadratic Residue 125
§2 Legendre Symbol 127
§3 Jacobi Symbol 137
Exercise 140
Chapter 6 Index, Primitive Root and Index 143
§1 Index and Primitive Root 143
§2 Existence Theorem of Primitive Root 151
§3 Modification of Reduced System Modulo p^α (p≥2) 154
§4 Index and Index Group 158
§5 Binomial Congruence Equation 163
Exercise 167
Chapter 7 Dirichlet Character 170
§1 Definition and Properties of Character Modulo Prime Power 170
§2 Definition and Properties of Character Modulo Arbitrary Modulus 178
§3 Character Sum 186
Postscript 193Then drag the "Foundation of Number Theory" PDF file into QuickOutline and paste the extracted directory text.

Select "By Indentation".

Click "Add Directory" again to get the PDF file with directory bookmarks added.
The effect is as follows.


Very good!
Appeal
It is recommended that everyone upload the PDF to the network after adding the directory, one of the ways is Z-Library, so as to facilitate everyone.
