mirror of
				https://github.com/johnwhitington/cpdf-source.git
				synced 2025-06-05 22:09:39 +02:00 
			
		
		
		
	Bookmark @B on splitting now dowes utf8, raw
This commit is contained in:
		| @@ -2600,12 +2600,13 @@ let write_pdf ?(encryption = None) ?(is_decompress=false) mk_id pdf = | |||||||
| (* Returns empty string on failure. Should only be used in conjunction with | (* Returns empty string on failure. Should only be used in conjunction with | ||||||
| split at bookmarks code, so should never fail, by definiton. *) | split at bookmarks code, so should never fail, by definiton. *) | ||||||
| let remove_unsafe_characters s = | let remove_unsafe_characters s = | ||||||
|  |   if args.encoding = Cpdf.Raw then s else | ||||||
|     let chars = |     let chars = | ||||||
|       lose |       lose | ||||||
|         (function x -> |         (function x -> | ||||||
|            match x with |            match x with | ||||||
|            '/' | '?' | '<' | '>' | '\\' | ':' | '*' | '|' | '\"' | '^' | '+' | '=' -> true |            '/' | '?' | '<' | '>' | '\\' | ':' | '*' | '|' | '\"' | '^' | '+' | '=' -> true | ||||||
|          | x when int_of_char x < 32 || int_of_char x > 126 -> true |            | x when int_of_char x < 32 || (int_of_char x > 126 && args.encoding <> Cpdf.Stripped) -> true | ||||||
|            | _ -> false) |            | _ -> false) | ||||||
|         (explode s) |         (explode s) | ||||||
|     in |     in | ||||||
| @@ -3503,7 +3504,7 @@ let bookmarks_open_to_level n pdf = | |||||||
|   let marks = Pdfmarks.read_bookmarks pdf in |   let marks = Pdfmarks.read_bookmarks pdf in | ||||||
|   let newmarks = |   let newmarks = | ||||||
|     List.map |     List.map | ||||||
|       (fun m -> {m with Pdfmarks.isopen = true(*m.Pdfmarks.level < n*)}) |       (fun m -> {m with Pdfmarks.isopen = m.Pdfmarks.level < n}) | ||||||
|       marks |       marks | ||||||
|   in |   in | ||||||
|     Pdfmarks.add_bookmarks newmarks pdf |     Pdfmarks.add_bookmarks newmarks pdf | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user