You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating from V5 to V6, and I'm having trouble uploading a PDF for the letters.create endpoint.
Specifically, when I pass in File.open("path-to-file.pdf") to the file argument of Lob::LetterEditable.new, the generated thumbnails in the Lob dashboard do add a page for the PDF, but it only contains a # character (see screenshot below).
Alternatives I have tried:
Passing just the local filename (not opening the file) -- yields "file must be a valid PDF or HTML file" (Lob::ApiError)
Passing File.read rather than File.open -- yields "source sequence is illegal/malformed utf-8" (JSON::GeneratorError)
(I also unsuccessfully tried various squish-to-valid-encodings methods from Ruby, but that doesn't feel like the right path)
Passing a variety of different input PDFs
Here is a minimal reproduction (just need to set LOB_API_KEY and ADDRESS_ID env vars):
#!/usr/bin/env rubyrequire"lob"config=Lob::Configuration.defaultconfig.username=ENV.fetch("LOB_API_KEY")api_client=Lob::ApiClient.new(config)lob_letters=Lob::LettersApi.new(api_client)pdf=File.open("tmp/input.pdf")beginletter=Lob::LetterEditable.new({file: pdf,from: ENV.fetch("ADDRESS_ID"),to: ENV.fetch("ADDRESS_ID"),color: false,address_placement: "insert_blank_page",description: "Manual test script - PDF attachment issues"})putslob_letters.create(letter).inspectensurepdf.closeend
And regardless of what file I use as tmp/input.pdf, this is the output in the Lob dashboard:
The text was updated successfully, but these errors were encountered:
This is definitely a bug in our V6 release, I will add a ticket for the team to address this. I don't have a specific window for when we will be able to address it. If possible stay with V5 and I will update this comment when this issue is resolved.
I'm migrating from V5 to V6, and I'm having trouble uploading a PDF for the
letters.create
endpoint.Specifically, when I pass in
File.open("path-to-file.pdf")
to thefile
argument ofLob::LetterEditable.new
, the generated thumbnails in the Lob dashboard do add a page for the PDF, but it only contains a#
character (see screenshot below).Alternatives I have tried:
File.read
rather thanFile.open
-- yields "source sequence is illegal/malformed utf-8" (JSON::GeneratorError)Here is a minimal reproduction (just need to set
LOB_API_KEY
andADDRESS_ID
env vars):And regardless of what file I use as
tmp/input.pdf
, this is the output in the Lob dashboard:The text was updated successfully, but these errors were encountered: