
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
github.com/Qingluan/pdf-go
Supply Chain Security
Vulnerability
Quality
Maintenance
License
this repo based on dslipak's pdf
[x] add image parse [x] /Im (png, jpeg, jpg) [x] DeviceGray [x] DeviceRGB [ ] DeviceCMYK
[x] add new line parse
package main
import (
"bytes"
"fmt"
"io"
"log"
"os"
"github.com/Qingluan/pdf-go"
)
func main() {
r, err := pdf.Open(os.Args[1])
if err != nil {
log.Fatal(err)
}
pages := r.NumPage()
var buf bytes.Buffer
for i := 1; i <= pages; i++ {
p := r.Page(i)
text, err := p.GetText()
if err != nil {
log.Fatal(err)
}
imgs, err := p.GetImgs()
if err != nil {
log.Fatal(err)
}
for i, img := range imgs {
buf, err := io.ReadAll(img)
if err != nil {
log.Fatal(err)
}
os.WriteFile(fmt.Sprintf("page_%d.png", i), buf, 0644)
}
// fmt.Println("text:", text)
if err != nil {
return
}
buf.WriteString(text)
}
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.