File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 4.10.0] - 2025-09-04
9+
10+ ### Added
11+
12+ - Add ` Invoices.PreviewPdfAsync ` method to preview invoice PDF before stamping.
13+
814## [ 4.9.1] - 2025-07-21
915
1016### Fixed
Original file line number Diff line number Diff line change @@ -62,5 +62,10 @@ public static string CopyInvoice(string id)
6262 {
6363 return $ "invoices/{ id } /copy";
6464 }
65+
66+ public static string PreviewPdf ( Dictionary < string , object > query = null )
67+ {
68+ return UriWithQuery ( "invoices/preview/pdf" , query ) ;
69+ }
6570 }
6671}
Original file line number Diff line number Diff line change @@ -183,5 +183,18 @@ public async Task<Invoice> CopyToDraftAsync(string id)
183183 var invoice = JsonConvert . DeserializeObject < Invoice > ( resultString , this . jsonSettings ) ;
184184 return invoice ;
185185 }
186+
187+ public async Task < Stream > PreviewPdfAsync ( Dictionary < string , object > query = null )
188+ {
189+ var response = await client . GetAsync ( Router . PreviewPdf ( query ) ) ;
190+ if ( ! response . IsSuccessStatusCode )
191+ {
192+ var resultString = await response . Content . ReadAsStringAsync ( ) ;
193+ var error = JsonConvert . DeserializeObject < JObject > ( resultString , this . jsonSettings ) ;
194+ throw new FacturapiException ( error [ "message" ] . ToString ( ) ) ;
195+ }
196+ var stream = await response . Content . ReadAsStreamAsync ( ) ;
197+ return stream ;
198+ }
186199 }
187200}
Original file line number Diff line number Diff line change 1111 API Keys creando una cuenta gratuita en https://www.facturapi.io</Summary >
1212 <PackageTags >factura factura-electronica cfdi facturapi mexico conekta</PackageTags >
1313 <Title >Facturapi</Title >
14- <Version >4.9.1 </Version >
14+ <Version >4.10.0 </Version >
1515 <PackageVersion >$(Version)</PackageVersion >
1616 <Owners >Facturapi</Owners >
1717 <ApplicationIcon >facturapi.ico</ApplicationIcon >
You can’t perform that action at this time.
0 commit comments