This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shows how to restrict access using the HTTP "Basic" schema. | |
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication | |
* @see https://tools.ietf.org/html/rfc7617 | |
* | |
* A user-id containing a colon (":") character is invalid, as the | |
* first colon in a user-pass string separates user and password. | |
*/ | |
const BASIC_USER = "user"; | |
const BASIC_PASS = "password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "hexapdf" | |
in1 = HexaPDF::Document.open("aaa.pdf") | |
in2 = HexaPDF::Document.open("bbb.pdf") | |
out = HexaPDF::Document.new | |
[in1.pages.to_a, in2.pages.to_a.reverse].transpose.flatten.each do |page| | |
out.pages << out.import(page) | |
end |
OlderNewer